This API provides endpoints for managing quizzes, questions, and user authentication.
- User registration and login
- User authentication using JWT stored in cookies
- Quiz creation, retrieval, update, and deletion
- Question creation, retrieval, update, and deletion
- Participant management for quizzes
- Quiz attempt and scoring
-
Clone the repository: git clone https://github.com/excellencyjumo/quiz-management-api.git
-
Install the dependencies: cd quiz-management-api npm install
-
Configure the environment variables:
- Create the
.envfile in your root folder. - Update the database connection details and other configuration settings in the
.envfile.
- Start the server:
- npm start
The API documentation is available on Postman. You can access it here.
- Please refer to the documentation for comprehensive information on each route,
- Including detailed descriptions and examples of the request and response.
- Register a new user using the
/users/authendpoint. - Log in with the registered user using the
/users/auth/loginendpoint. - Use the provided JWT token for authentication in subsequent requests.(stored in cookie header)
- Create quizzes using the
/quizzesendpoint. - Add questions to quizzes using the
/quizzes/:quiz_id/questionsendpoint. - Manage participants, quiz attempts, and scoring using the respective endpoints.
- Refer to the API documentation for more details on each endpoint.
To run the tests, use the following command:
- npm test
- Node.js
- Express.js
- PostgreSQL
- JOI Validator
- JSON Web Tokens (JWT)
- Jest (for testing)
This project is licensed under the MIT License.