Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

QuizApplication

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.

Code Structure

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.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

You need to have Node.js and MongoDB installed on your machine to run this project locally.

Setup Instructions

  1. Clone the repository to your local machine.

  2. Install the dependencies by running npm install in both the root directory and the client folder.

  3. Add a .env file in both the root directory and the client folder with the following configurations:

    /.env

    MONGO_URL=YourMongoDB-URL
    JWT_COOKIE_EXPIRES_IN=30
    JWT_EXPIRES_IN=30m
    JWT_SECRET=testapp
    

    /client/.env

    REACT_APP_SERVER_URL=http://localhost:5000
    
  4. Modify addQuestions.js & addUsers.js according to your needs. These scripts are used to populate the database with initial data.

  5. After adding your remote MongoDB URL, run the following commands to add Questions and Users respectively:

    node addQuestions.js
    

    and

    node addUsers.js
    
  6. Start the server by running nodemon server.js in the root directory and the client by running npm start in the client folder.

Usage

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.

Contributing

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.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages