Giter VIP home page Giter VIP logo

kahoot-js's Introduction

Kahoot-JS

Watch the YouTube video to see how it works

App Video

The project is inspired by the Kahoot app. The main functionality of the application is the creation of educational games in the form of quizzes, which then can be solved by several students at the same time in the form of a game. Quizzes can be created with the use of a special wizard that allows you to select the type of question, determine the method of awarding points and answer time for a particular question, and the number of correct answers. During the quiz, the teacher acts as the host who creates a room that students can access using an access code. During the game, students see the scoreboards after each question in real time. Quizzes are divided into public and private. Each logged in user can view the list of public quizzes, add likes and comments to them.

Installation

Client side

cd client
npm install

Server side

cd server
npm install

Run the app

You need four terminal instances - one for client app and three for backend servers.

cd client
npm start
cd server
npm run devStart
cd server
npm run devStartAuth
cd server
npm run devStartSocket

Generate JWT tokens

ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub

Env configuration

DATABASE_URL=string (required)
PORT=3000 (required number)
AUTH_PORT=4000 (required number)
ACCESS_TOKEN_SECRET=string (required string)
REFRESH_TOKEN_SECRET=string (required string)

Contributing

As this is my first project in the Javascript ecosystem, most of the code needs to be refactored or rewritten :) There are a lot of bugs in the code, which I'm sure you'll find quickly.

Also many new features needs to be added to call this project as a full-fledged Kahoot clone.

Feel free to contribute.

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

kahoot-js's People

Contributors

adrianboratyn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

kahoot-js's Issues

Auth Server started on port undefined

[sysadmin@srvens01pro server]$ npm run devStartAuth

[email protected] devStartAuth /kahoot/kahoot-js/server
nodemon authServer.js

[nodemon] 2.0.13
[nodemon] to restart at any time, enter rs
[nodemon] watching path(s): .
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node authServer.js
Auth Server started on port undefined
(node:432) UnhandledPromiseRejectionWarning: MongooseError: The uri parameter to openUri() must be a string, got "undefined". Make sure the first parameter to mongoose.connect() or mongoose.createConnection() is a string.
at NativeConnection.Connection.openUri (/kahoot/kahoot-js/server/node_modules/mongoose/lib/connection.js:684:11)
at /kahoot/kahoot-js/server/node_modules/mongoose/lib/index.js:329:10
at /kahoot/kahoot-js/server/node_modules/mongoose/lib/helpers/promiseOrCallback.js:32:5
at new Promise ()
at promiseOrCallback (/kahoot/kahoot-js/server/node_modules/mongoose/lib/helpers/promiseOrCallback.js:31:10)
at Mongoose._promiseOrCallback (/kahoot/kahoot-js/server/node_modules/mongoose/lib/index.js:1150:10)
at Mongoose.connect (/kahoot/kahoot-js/server/node_modules/mongoose/lib/index.js:328:20)
at Object. (/kahoot/kahoot-js/server/authServer.js:9:10)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
(node:432) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:432) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

npm and node versions

What version of npm and node do you use?

This are my versions:

[sysadmin@srvens01pro kahoot-js]$ node -v
v12.18.4
[sysadmin@srvens01pro kahoot-js]$ npm -v
6.14.6

Server started on port undefined

[sysadmin@srvens01pro server]$ npm run devStart

[email protected] devStart /kahoot/kahoot-js/server
nodemon server.js

[nodemon] 2.0.13
[nodemon] to restart at any time, enter rs
[nodemon] watching path(s): .
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node server.js
Server started on port undefined
(node:32728) UnhandledPromiseRejectionWarning: MongooseError: The uri parameter to openUri() must be a string, got "undefined". Make sure the first parameter to mongoose.connect() or mongoose.createConnection() is a string.
at NativeConnection.Connection.openUri (/kahoot/kahoot-js/server/node_modules/mongoose/lib/connection.js:684:11)
at /kahoot/kahoot-js/server/node_modules/mongoose/lib/index.js:329:10
at /kahoot/kahoot-js/server/node_modules/mongoose/lib/helpers/promiseOrCallback.js:32:5
at new Promise ()
at promiseOrCallback (/kahoot/kahoot-js/server/node_modules/mongoose/lib/helpers/promiseOrCallback.js:31:10)
at Mongoose._promiseOrCallback (/kahoot/kahoot-js/server/node_modules/mongoose/lib/index.js:1150:10)
at Mongoose.connect (/kahoot/kahoot-js/server/node_modules/mongoose/lib/index.js:328:20)
at Object. (/kahoot/kahoot-js/server/server.js:20:10)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
(node:32728) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:32728) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Compiled with warnings

When run npm start inside of client:

Compiled with warnings.

src/components/Game/HostScreen/HostScreen.js
Line 8:3: 'getLeaderboard' is defined but never used no-unused-vars
Line 72:6: React Hook useEffect has a missing dependency: 'updateLeaderboard'. Either include it or remove the dependency array react-hooks/exhaustive-deps

src/components/Game/PlayerScreen/PlayerScreen.js
Line 145:6: React Hook useEffect has a missing dependency: 'sendAnswer'. Either include it or remove the dependency array react-hooks/exhaustive-deps

src/components/MyQuizes/MyQuizes.js
Line 28:6: React Hook useEffect has a missing dependency: 'user.result._id'. Either include it or remove the dependency array react-hooks/exhaustive-deps

src/components/Navbar/Navbar.js
Line 35:6: React Hook useEffect has missing dependencies: 'logout' and 'user?.accessToken'. Either include them or remove the dependency array react-hooks/exhaustive-deps

src/components/QuizCreator/QuizCreator.js
Line 55:6: React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array react-hooks/exhaustive-deps

src/components/QuizDetails/QuizDetails.js
Line 26:6: React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array react-hooks/exhaustive-deps
Line 34:6: React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array react-hooks/exhaustive-deps

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.