Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

125 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ SkillMatrix - Enterprise Learning Management System (LMS)

Release Version Build Status Node.js React MongoDB

SkillMatrix is an enterprise-grade, high-performance Learning Management System (LMS) built with React, Vite, Node.js, Express, and MongoDB. It features dual-token JWT authentication, Role-Based Access Control (RBAC), interactive video lesson playback, real-time progress calculations, Admin analytics dashboards, full-text search & recommendation discovery algorithms, storage provider abstraction, multi-stage Docker containerization, and GitHub Actions CI/CD automation.


πŸš€ Key Feature Modules

πŸ” 1. Authentication & Security Hardening

  • Dual JWT Token Architecture: Access Tokens (Authorization header) + Rotated Refresh Tokens (HttpOnly cookies).
  • Session Revocation: activeSessionHash tracking enables instant global logouts and session termination.
  • RBAC Guards: Role-based access boundaries enforcing Admin vs Student route policies.
  • Security Headers: Helmet CSP (Content Security Policy), CORS origin enforcement, rate limiters (authLimiter), and Mongo injection sanitization.

πŸ“š 2. Course & Lesson Management

  • Course Lifecycle: Scaffold draft courses, edit metadata, filter by level (Beginner, Intermediate, Advanced), upload thumbnail assets, publish, or archive.
  • Interactive Lesson Player: Video playback supporting YouTube, Vimeo, and direct MP4 streams.
  • Syllabus & Ordering: Sequential lesson ordering, manual drag/reordering, and free guest preview support.
  • Resource Attachments: Direct PDF, ZIP, TXT, and image resource file uploads with storage adapter abstraction.

πŸŽ“ 3. Enrollment & Progress Tracking

  • Course Enrollments: Student self-enrollment with duplicate record prevention.
  • Real-Time Progress Tracking: Calculates course completion percentages based on completed lessons (not_started, in_progress, completed).
  • Student My Learning Portal: Continue Learning hero banner, active enrolled courses list, and progress indicators.

πŸ“Š 4. Admin Analytics Dashboard

  • Real-Time KPI Cards: Total Students, Active Courses, Total Enrollments, and Platform Completion Rate.
  • Top Enrolled Courses: Ranking by student volume and completion rates.
  • Recent Activity Feed: Real-time event timeline of student registrations, course enrollments, and lesson completions.

πŸ” 5. Search, Discovery & UX

  • Full-Text & Compound Indexing: Optimized search across course titles, short descriptions, and tags.
  • Multi-Attribute Filters & Sorting: Category, level, tags, and sorting by newest, oldest, most_enrolled, highest_completion.
  • Recommendation Algorithms: Popular trending courses and personalized recommendations based on student learning categories.

🐳 6. Dockerization & CI/CD Operations

  • Container Orchestration: docker-compose.yml orchestrating frontend (Nginx Alpine), backend (Node 18 Alpine), and mongodb with persistent named volumes.
  • Health Monitoring: GET /health monitoring endpoint and SIGTERM/SIGINT graceful shutdown handlers.
  • CI/CD Pipeline: GitHub Actions workflow (.github/workflows/ci.yml) automating ESLint checks, client production build, and 74 Vitest integration tests.

πŸ—οΈ System Architecture Diagram

graph TD
    User([Browser Client / Student / Admin]) -->|HTTPS| Nginx[Nginx Reverse Proxy / Port 80]
    
    subgraph Frontend Container
        Nginx -->|Static Assets| ReactApp[React 18 SPA / Vite]
    end
    
    subgraph Backend Container
        Nginx -->|/api & /uploads| ExpressAPI[Express REST API / Port 5000]
        ExpressAPI --> Middlewares[Security / CORS / RateLimiter / Auth]
        Middlewares --> Controllers[REST Controllers]
        Controllers --> Services[Business Logic Services]
        Services --> StorageAdapter[LocalStorageProvider / S3 Adapter]
    end
    
    subgraph Database Container
        Services -->|Mongoose ODM| MongoDB[(MongoDB v6.0 / Port 27017)]
    end
    
    StorageAdapter -->|File Uploads| UploadsDir[(public/uploads Volume)]
Loading

πŸ—„οΈ Database Entity-Relationship (ER) Diagram

erDiagram
    USER ||--o{ ENROLLMENT : enrolls
    USER ||--o{ PROGRESS : tracks
    USER ||--o{ COURSE : creates
    COURSE ||--o{ LESSON : contains
    COURSE ||--o{ ENROLLMENT : has
    LESSON ||--o{ RESOURCE : attaches
    LESSON ||--o{ PROGRESS : logged_in

    USER {
        ObjectId _id PK
        string fullName
        string email UK
        string passwordHash
        string role "admin | student"
        string activeSessionHash
        boolean isDeleted
        date createdAt
    }

    COURSE {
        ObjectId _id PK
        string title
        string slug UK
        string shortDescription
        string description
        string category
        string level "beginner | intermediate | advanced"
        string status "draft | published | archived"
        string thumbnailUrl
        string[] tags
        ObjectId createdBy FK
        boolean isDeleted
    }

    LESSON {
        ObjectId _id PK
        ObjectId courseId FK
        string title
        string slug UK
        string description
        string videoUrl
        string thumbnailUrl
        number duration
        number order
        boolean isPreview
        string status "draft | published | archived"
        resourceSchema[] resources
        ObjectId createdBy FK
    }

    RESOURCE {
        string title
        string type "pdf | zip | link | code | image"
        string url
        string size
    }

    ENROLLMENT {
        ObjectId _id PK
        ObjectId studentId FK
        ObjectId courseId FK
        string status "active | cancelled | completed"
        date enrolledAt
    }

    PROGRESS {
        ObjectId _id PK
        ObjectId studentId FK
        ObjectId courseId FK
        ObjectId lessonId FK
        string status "not_started | in_progress | completed"
        date completedAt
    }
Loading

πŸ“– API Documentation Reference

SkillMatrix provides complete OpenAPI 3.0 documentation. See openapi.yaml for full schema definitions and request/response examples.

Method Endpoint Description Auth Required
GET /health Application & database health status None
POST /api/auth/register Register a new student account None
POST /api/auth/login Authenticate user & issue JWT tokens None
POST /api/auth/refresh Rotate access token via HttpOnly refresh cookie Cookie
POST /api/auth/logout Revoke session & clear cookies Bearer JWT
GET /api/auth/me Fetch authenticated user profile Bearer JWT
GET /api/courses List published courses with search, filters & pagination Optional
POST /api/courses Create draft course Admin
GET /api/courses/popular Fetch top enrolled popular courses Optional
GET /api/courses/recommended Fetch personalized course recommendations Student
GET /api/courses/recent-learning Fetch student continue learning status Student
GET /api/courses/:slug Fetch single course details by slug or ID Optional
POST /api/courses/:courseId/enroll Enroll student in published course Student
GET /api/courses/:courseId/lessons List course lessons syllabus Optional
POST /api/lessons/:lessonId/progress Update lesson progress & completion Student
GET /api/admin/dashboard Real-time Admin analytics overview Admin
POST /api/uploads/image Upload thumbnail image Admin
POST /api/uploads/resource Upload PDF/ZIP resource file Admin

πŸ“ Repository Folder Structure

SkillMatrix/
 β”œβ”€β”€ .github/
 β”‚   └── workflows/
 β”‚       └── ci.yml               # GitHub Actions CI/CD pipeline
 β”œβ”€β”€ client/                      # React Frontend Single Page Application
 β”‚   β”œβ”€β”€ src/
 β”‚   β”‚   β”œβ”€β”€ components/          # Reusable UI components (FilterBar, FileUpload, ImagePreview, etc.)
 β”‚   β”‚   β”œβ”€β”€ constants/           # System routing paths and constants
 β”‚   β”‚   β”œβ”€β”€ context/             # Auth, Theme, and Toast React Context providers
 β”‚   β”‚   β”œβ”€β”€ hooks/               # Custom React hooks
 β”‚   β”‚   β”œβ”€β”€ layouts/             # Shared, Admin, Student, and Auth layouts
 β”‚   β”‚   β”œβ”€β”€ pages/               # Container pages (CourseCatalog, LessonPlayer, MyLearning, AdminDashboard)
 β”‚   β”‚   β”œβ”€β”€ routes/              # App routes, lazy loading, and security guards
 β”‚   β”‚   └── services/            # Axios API service bindings
 β”‚   β”œβ”€β”€ Dockerfile               # Multi-stage Nginx client Dockerfile
 β”‚   β”œβ”€β”€ nginx.conf               # Nginx reverse proxy configuration
 β”‚   └── package.json
 β”œβ”€β”€ server/                      # Node.js & Express REST API Backend
 β”‚   β”œβ”€β”€ src/
 β”‚   β”‚   β”œβ”€β”€ config/              # Environment schema validation
 β”‚   β”‚   β”œβ”€β”€ constants/           # Domain enums & HTTP constants
 β”‚   β”‚   β”œβ”€β”€ controllers/         # Thin REST API controllers
 β”‚   β”‚   β”œβ”€β”€ database/            # Mongoose connection & retry strategy
 β”‚   β”‚   β”œβ”€β”€ errors/              # Operational error classes
 β”‚   β”‚   β”œβ”€β”€ logger/              # Structured Pino logging
 β”‚   β”‚   β”œβ”€β”€ middlewares/         # Auth, security, rate-limiting, error handlers
 β”‚   β”‚   β”œβ”€β”€ models/              # Mongoose database models (User, Course, Lesson, Enrollment, Progress)
 β”‚   β”‚   β”œβ”€β”€ routes/              # Express API routers
 β”‚   β”‚   β”œβ”€β”€ services/            # Core business logic services
 β”‚   β”‚   β”œβ”€β”€ tests/               # Vitest integration test suite (74 passing tests)
 β”‚   β”‚   └── validators/          # Zod validation schemas
 β”‚   β”œβ”€β”€ public/uploads/          # Local media storage directory
 β”‚   β”œβ”€β”€ Dockerfile               # Multi-stage Node Alpine Dockerfile
 β”‚   β”œβ”€β”€ server.js                # Server entry point & graceful shutdown
 β”‚   └── package.json
 β”œβ”€β”€ docs/                        # Complete technical documentation suite
 β”‚   β”œβ”€β”€ openapi.yaml             # OpenAPI 3.0 specification
 β”‚   β”œβ”€β”€ ARCHITECTURE.md          # Architecture guide & patterns
 β”‚   β”œβ”€β”€ DEPLOYMENT.md            # Production deployment guide
 β”‚   β”œβ”€β”€ DOCKER_GUIDE.md          # Containerization manual
 β”‚   β”œβ”€β”€ CICD_GUIDE.md            # CI/CD automation guide
 β”‚   β”œβ”€β”€ BACKUP_ROLLBACK_GUIDE.md # Backup & rollback strategy
 β”‚   └── RELEASE_CHECKLIST.md     # Pre-release checklist matrix
 β”œβ”€β”€ docker-compose.yml           # Full-stack container orchestration
 β”œβ”€β”€ .env.example                 # Root environment template
 β”œβ”€β”€ CHANGELOG.md                 # Version release history
 β”œβ”€β”€ README.md                    # System documentation
 └── package.json                 # Workspace dependencies

⚑ Quick Start & Deployment Options

Option A: One-Command Docker Compose Deployment (Recommended)

# Clone the repository
git clone https://github.com/Vishnu3568/SkillMatrix.git
cd SkillMatrix

# Start full-stack containers (Frontend, Backend, MongoDB)
docker-compose up -d --build
  • Access Frontend UI at http://localhost
  • Access Backend API at http://localhost:5000
  • Access Health Check at http://localhost:5000/health

Option B: Local Node.js Development Setup

  1. Install Dependencies:

    npm install
  2. Configure Environment Variables: Copy .env.example templates:

    cp .env.example .env
    cp server/.env.example server/.env
  3. Start Development Servers:

    npm run dev
  4. Execute Quality & Test Verification:

    npm run lint          # Run ESLint quality checks (0 errors)
    npm run build         # Build client production bundle
    npm test              # Run backend Vitest integration suite (74 tests passing)

πŸ› οΈ Verification & Test Suite Output

 βœ“ src/tests/security.test.js (3 tests)
 βœ“ src/tests/media.test.js (6 tests)
 βœ“ src/tests/discovery.test.js (8 tests)
 βœ“ src/tests/dashboard.test.js (3 tests)
 βœ“ src/tests/progress.test.js (6 tests)
 βœ“ src/tests/enrollment.test.js (14 tests)
 βœ“ src/tests/lesson.test.js (9 tests)
 βœ“ src/tests/course.test.js (13 tests)
 βœ“ src/tests/auth.test.js (12 tests)

 Test Files  9 passed (9)
      Tests  74 passed (74)
   Duration  4.52s

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages