Skip to content

Reza97312/edunext-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

132 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EduNext API - Enterprise Backend & Microservices

Node.js Express.js MongoDB Docker Swagger

The core backend infrastructure powering the EduNext Learning Management System. Built with Node.js, Express, and MongoDB, this RESTful API is fully containerized using Docker and designed for high availability, robust security, and seamless multimedia handling.

Live API Documentation: Interactive Swagger UI

Architecture & Core Features

  • Advanced Authentication Flow: Implements secure JWT-based authentication with short-lived Access Tokens and long-lived Refresh Tokens. Features silent token rotation on the client-side for an uninterrupted user experience.
  • Enterprise-Grade Security: Hardened Express app using Helmet for secure HTTP headers, express-rate-limit to prevent brute-force/DDoS attacks, and strictly configured CORS policies.
  • Cloud Media Management: Seamless integration with Cloudinary via multer-storage-cloudinary. Automatically categorizes and optimizes user avatars, course thumbnails, and heavy video content.
  • Dockerized Infrastructure: Fully containerized environment with multi-container orchestration (docker-compose) linking the Node.js API with a persistent MongoDB instance.
  • Role-Based Access Control (RBAC): Custom middleware to handle complex permission layers across Admin, Teacher, and Student routes.

Technical Stack

  • Runtime & Framework: Node.js (v20), Express.js (v5)
  • Database & ORM: MongoDB, Mongoose
  • Authentication & Security: JSON Web Tokens (JWT), bcrypt, Helmet, Express Rate Limit
  • Validation: Joi
  • File Uploads: Multer, Cloudinary API
  • Deployment & DevOps: Docker, Docker Compose, Render

Modular Domain Structure

The application follows a clean, modular architecture separating concerns into distinct domains:

  • Auth
  • Users
  • Courses
  • Categories
  • Exams & Questions
  • Certificates
  • Payments
  • Comments & Replies
  • Admin & User Panels

Getting Started (Docker Ready)

The recommended way to run this project locally is with Docker. This setup automatically provisions both the API server and the MongoDB database.

  1. Clone the repository:
git clone https://github.com/Reza97312/edunext-api.git
cd edunext-api
  1. Create a .env file in the project root using the following template:
NODE_ENV=development
CLIENT_URL=http://localhost:3000

# Database
DATABASE_URI=mongodb://admin:edunext_secret@mongo:27017/edunext?authSource=admin

# JWT
JWT_SECRET=your_jwt_secret_key
JWT_EXPIRES_IN=15m
JWT_REFRESH_SECRET=your_jwt_refresh_secret_key
JWT_REFRESH_EXPIRES_IN=7d

# Cloudinary
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
  1. Build and start the containers:
docker compose up --build

If you're using an older version of Docker Compose, replace docker compose with docker-compose.

  1. Once the containers are running, the services will be available at:
API:      http://localhost:5050
Swagger:  http://localhost:5050/api-docs
MongoDB:  localhost:27017

About

Backend REST API for EduNext project built with Node.js, Express, Docker, Swagger , MongoDB

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors