Backend Task: Create REST API for a questionnaire using Node.js and a database of your choice. (Used Mongodb). This project is a task given by CareerCarve in their Internship Cum PPO Recruitment Drive.
This is a questionnaire API built using Node.js that allows users to choose and complete tests from a selection of available tests. It provides endpoints for user registration, login, submitting tests, and managing user details.
- User registration and login
- Submitting tests with user responses
- Storing test responses and calculating scores
- Test and question details can be hardcoded in the database
- Enforcing that a user can only take a test once
- Clone the repository: git clone
https://github.com/adnan1710/CareerCarve-Backend-MiniProject.git
- Install the dependencies:
npm install
- Set up the database connection by modifying the
database/dbConfig.js
file. - Start the application:
npm start
- Access the API at:
http://localhost:3000
The following endpoints are available in the API:
- [POST] /api/signup - Sign up a new user.
- [POST] /api/login - User login.
- [PUT] /api/edit/phonenumber - Edit or add a user's phone number.
- [POST] /api/submit-test - Submit a test with user responses.
Please refer to the API documentation for detailed information about each endpoint, including request and response examples.
- Node.js
- Express.js
- MongoDB
- bcrypt.js (for password encryption)
- JSON Web Tokens (JWT) for authentication
- Create a Front-End for Questionnare API
- Implement a Database over the internet for accessibility in the real world scenario.