QuizApplication is a full-stack web application that allows users to take quizzes on various topics. It is built using Node.js for the backend, MongoDB for the database, and React.js for the frontend. The application supports user authentication, quiz creation, and score tracking.
The application is divided into two main parts: the server and the client. The server is written in Node.js and is located in the root directory. It contains the logic for user authentication, quiz creation, and score tracking. The client is written in React.js and is located in the client folder. It contains the user interface for the application.
The addQuestions.js and addUsers.js scripts are used to populate the database with initial data. They are located in the root directory.
The .env files contain environment variables for the server and client. They are located in the root directory and the client folder respectively.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
You need to have Node.js and MongoDB installed on your machine to run this project locally.
-
Clone the repository to your local machine.
-
Install the dependencies by running
npm installin both the root directory and theclientfolder. -
Add a
.envfile in both the root directory and theclientfolder with the following configurations:MONGO_URL=YourMongoDB-URL JWT_COOKIE_EXPIRES_IN=30 JWT_EXPIRES_IN=30m JWT_SECRET=testappREACT_APP_SERVER_URL=http://localhost:5000 -
Modify
addQuestions.js&addUsers.jsaccording to your needs. These scripts are used to populate the database with initial data. -
After adding your remote MongoDB URL, run the following commands to add Questions and Users respectively:
node addQuestions.jsand
node addUsers.js -
Start the server by running
nodemon server.jsin the root directory and the client by runningnpm startin theclientfolder.
After starting the server and client, open your browser and navigate to http://localhost:3000 to start using the application. You can register a new user, login, take quizzes, and view your scores.
We welcome contributions from everyone. If you're interested in contributing, please fork the repository, make your changes, and submit a pull request. If you have any questions or need help with the process, feel free to reach out.
This project is licensed under the MIT License - see the LICENSE.md file for details.