The LMS Backend runs as a local Node.js server on port 4000. You will clone the repository, install dependencies, set up your environment variables, start the server with nodemon, verify it is healthy, and then register your first user account.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Pragyat-Nikunj/Learning-Management-System-backend/llms.txt
Use this file to discover all available pages before exploring further.
You need Node.js 18 or later, npm, and a running MongoDB instance (local or Atlas) before you begin.
Clone the repository and install dependencies
Clone the repository and install all npm dependencies:The install pulls in Express 5, Mongoose, Stripe, Razorpay, Cloudinary, Multer, Helmet, and the rest of the security middleware declared in
package.json.Create your .env file
Create a Open
.env file in the project root and fill in your credentials:.env in your editor. At minimum you must set MONGO_URI, SECRET_KEY, and PORT before the server will start. Stripe and Cloudinary keys are required for payment and upload features respectively.See Environment Setup for a full description of every variable.Start the development server
Start the server with hot reload via nodemon:When the server is ready you will see:The server listens at
http://localhost:4000. In development mode, Morgan logs every incoming request to your terminal and Mongoose logs all database queries.Verify the server with the healthcheck endpoint
Confirm the server and database are both healthy:A healthy response looks like this:If
databases.status is "unhealthy", check that your MONGO_URI in .env is correct and that your MongoDB instance is reachable.Register your first user
Create a user account by posting to the signup endpoint:A successful response sets a The
token HTTP-only cookie and returns:token cookie is sent automatically by the server and must be included in subsequent requests to protected endpoints. Use curl -b cookies.txt -c cookies.txt or a client like Postman that handles cookies automatically.What to do next
Environment Setup
Full reference for every environment variable — database, auth, payments, and media storage.
API Reference
Explore all endpoints with complete request/response documentation.
Authentication
Understand how JWT cookies work and how to call protected routes.
Payments
Set up Stripe Checkout and test webhooks with the Stripe CLI.