MPC-Lab-X-server is the backend component of the MPC-Lab-X project. It handles question generation, problem solving, and data management for mathematics, physics, and chemistry.
- Randomized question generation in various subjects (mathematics, physics, chemistry).
- Provides solutions and detailed steps for each generated question.
- Supports multiple categories and detailed sub-types of questions.
- Uses Express.js for API handling and MongoDB for data storage.
- Supports user authentication and session management.
- Classroom creation, student management, TA/admin management, task creation/management (using mpclab library for problem generation), and task grading.
- Node.js
- MongoDB
- SMTP server for sending emails
- Clone the repository:
git clone https://github.com/MPC-Lab-X/MPC-Lab-X-server.git
- Install the dependencies:
npm install
- Create a
.env
file in the root directory and add the following environment variables:
PORT=5000 # Port number for the server (default: 5000)
HOST=localhost # Host address for the server (default: localhost)
MONGODB_URI=mongodb://localhost/mpc-lab-x # MongoDB connection URI
JWT_SECRET=secret # Secret key for JWT token generation
EMAIL_HOST=smtp-relay.brevo.com # SMTP host for sending emails
EMAIL_PORT=587 # SMTP port for sending emails
EMAIL_SECURE=false # SMTP secure connection (default: false)
EMAIL_USERNAME=user # SMTP username
EMAIL_PASSWORD=pass # SMTP password
EMAIL_SENDER=[email protected] # Email sender address
Note: The SMTP host, port, username, password, and sender address should be replaced with your own SMTP server details.
- Start the server:
npm start
The server provides a RESTful API for question generation, problem solving, and data management. The API endpoints are documented in the docs/API.md file.
The server uses Jest for testing. To run the tests, use the following command.
npm test
We would like to thank the following libraries and tools for making this project possible:
- Express.js: A fast, unopinionated, minimalist web framework for Node.js.
- MongoDB: A NoSQL database program that uses JSON-like documents with optional schemas.
- Jest: A delightful JavaScript testing framework with a focus on simplicity.
- Nodemailer: A module for Node.js to send emails easily.
- JWT: A compact, URL-safe means of representing claims to be transferred between two parties.
- bcrypt: A library to help you hash passwords.
- mpclab: A problem generator for mathematics, physics, and chemistry.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.