Skip to content

subhaushsingh/LMS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📚 LMS API

A production-ready RESTful API for a Learning Management System (LMS), built with Node.js, Express, and MongoDB.
Supports user roles (students, instructors), course & lecture management, secure enrollment, and JWT-based authentication.


🧩 Features

  • User authentication & authorization (JWT, role-based access)
  • Course & Lecture management: create, update, delete, publish
  • Enrollment management: students enroll in courses and access their lectures
  • Schema validation & data integrity via Mongoose models
  • Environment-based configuration (development / production)
  • Utilities & helpers for cleaner, reusable code (utils/)
  • Structured folder layout: controllers, routes, models, config, utils
  • Error handling: centralized middleware with custom error classes

⚙️ Technologies & Packages

Package Purpose
express Web framework for routing and middleware
mongoose MongoDB object modeling and schema enforcement
dotenv Load configuration via environment variables
jsonwebtoken Token-based authentication
bcrypt Secure password hashing
express-validator Request body / parameter validation
helmet Security headers
morgan HTTP request logging
cors Handle cross-origin requests

🚀 Getting Started

Prerequisites

  • Node.js (v16+ recommended)
  • npm or yarn
  • MongoDB (local or Atlas)
  • (Optional) Postman / REST client for testing

Installation

# Clone the repository
git clone https://github.com/subhaushsingh/LMS.git
cd LMS

# Install dependencies
npm install

Configuration

Create a .env file in the root directory with the following variables:

# Server
PORT=8000
NODE_ENV=development
CLIENT_URL=http://localhost:5173

# MongoDB
MONGODB_URL=your_mongodb_connection_string

# JWT Secret
SECRET_KEY=your_secret_key

# Cloudinary (optional)
CLOUDINARY_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret

# Razorpay (optional)
RAZORPAY_KEY_ID=your_razorpay_key_id
RAZORPAY_KEY_SECRET=your_razorpay_key_secret

🔗 References

  1. Express Documentation
  2. Mongoose Documentation
  3. JWT Documentation
  4. Bcrypt Documentation
  5. Dotenv Documentation
  6. Razorpay Documentation
  7. Cloudinary Documentation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published