anishjoshi1999 / mcq-app

MIT License
0 stars 0 forks source link

MCQ-App

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.

MCQ-App Backend

Table of Contents

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/mcq-app.git
    cd mcq-app
    cd backend
  2. Install the dependencies:

    npm install
  3. Set up your environment variables in a .env file. See Environment Variables for more information.

  4. Start the server:

    npm run dev

Usage

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 Endpoints

Upload MCQs

Show All Topics

Get All MCQs By Topic

Get Specific MCQ By Topic and Slug

Project Structure

├── Controllers
│   └── mcqControllers.js
├── Data
│   └── c_language_mcqs.json
├── Models
│   ├── mcqSchema.js
│   ├── optionSchema.js
│   └── topicSchema.js
├── Routes
│   └── mcqRoute.js
├── .env
├── .gitignore
├── app.js
└── package.json

Environment Variables

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.

License

This project is licensed under the MIT License. See the LICENSE file for details.