This repository contains the frontend and backend code for the MCQ-App, which allows users to upload, manage, and retrieve multiple choice questions (MCQs) related to different topics. The backend is built with Node.js, Express, and MongoDB.
Clone the repository:
git clone https://github.com/yourusername/mcq-app.git
cd mcq-app
cd backend
Install the dependencies:
npm install
Set up your environment variables in a .env
file. See Environment Variables for more information.
Start the server:
npm run dev
Once the server is running, you can interact with the API using tools like Postman or cURL. The server will be running on the port specified in the .env
file.
/api/mcq/upload
POST
{
"name": "C Language"
}
/api/mcq/show-all
GET
/api/mcq/:slug
GET
slug
: The slug of the topic./api/mcq/:topicSlug/mcq/:questionSlug
GET
topicSlug
: The slug of the topic.questionSlug
: The slug of the question.├── Controllers
│ └── mcqControllers.js
├── Data
│ └── c_language_mcqs.json
├── Models
│ ├── mcqSchema.js
│ ├── optionSchema.js
│ └── topicSchema.js
├── Routes
│ └── mcqRoute.js
├── .env
├── .gitignore
├── app.js
└── package.json
Create a .env
file in the root of your project and add the following environment variables:
PORT=3000
MONGODB_URI=your_mongodb_connection_string
Replace your_mongodb_connection_string
with the actual connection string for your MongoDB database.
This project is licensed under the MIT License. See the LICENSE file for details.