Skip to content

udaycodespace/learnhub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


 _                                _   _       _     
| |                              | | | |     | |    
| |      ___  __ _ _ __ _ __     | |_| |_   _| |__  
| |     / _ \/ _` | '__| '_ \    |  _  | | | | '_ \ 
| |____|  __/ (_| | |  | | | |   | | | | |_| | |_) |
\_____/ \___|\__,_|_|  |_| |_|   \_| |_/\__,_|_.__/ 
                                                    

A full-stack e-learning platform for video-based courses


MongoDB Express React Vite License: MIT Status


LearnHub connects students and educators through video courses, enrollment, and progress tracking, built on the MERN stack.

🚧 Runs locally for now. Hosting decision is still open, see Deployment.


Features Β· Tech Stack Β· Getting Started Β· Demo Accounts Β· Architecture Β· Deployment Β· Open Source Β· License


🌟 Overview

LearnHub is a course platform where teachers upload video lectures and students work through them at their own pace. Students enroll, watch content, mark sections complete, and download a PDF certificate once they finish a course. Teachers get their own dashboard to publish courses and check who's enrolled. Admins can view and delete registered users and courses via the React dashboard.


🧭 How it fits together

flowchart LR
    A[Student] -->|Browse & Enroll| B(Course Catalog)
    B --> C{Free or Paid?}
    C -->|Free| D[Instant Access]
    C -->|Paid| E[Mock Payment Form]
    E --> D
    D --> F[Video Player]
    F --> G[Progress Tracking]
    G --> H[Certificate PDF]

    I[Teacher] -->|Create & Upload| B
    I --> J[Manage Enrollments]

    K[Admin] -->|Moderate| B
    K --> L[User Management]
Loading

πŸ›  Tech Stack

Backend

Technology Purpose
Express.js Routes, middleware, and controllers
MongoDB Stores users, courses, and mock payment records (login activity is recorded but not exposed in the UI)
Node.js Runs the server

Frontend

Technology Purpose
React Component-based UI
Material UI Tables, dashboard buttons, icons
Bootstrap Grid layouts, forms, modals

Tooling & DevX

Technology Purpose
Vite Dev server and build tool
Axios HTTP requests to the backend

Stack breakdown

pie showData
    title Codebase composition (by concern)
    "Frontend (React/MUI/Bootstrap)" : 45
    "Backend (Express/Node)" : 30
    "Database layer (MongoDB/Mongoose)" : 15
    "Tooling & config" : 10
Loading

✨ Key Features

πŸ‘¨β€πŸŽ“ Student

  • Browse and search courses by title or category
  • Enroll instantly in free courses, or submit mock card details for premium ones
  • Stream lectures with the built-in video player
  • Mark sections complete and download a certificate

πŸ‘©β€πŸ« Teacher

  • Create courses with title, category, description, and price
  • Upload lecture videos as .mp4 files (stored locally on server filesystem)
  • Track enrollment numbers for your own courses
  • Delete courses you created

πŸ›‘οΈ Admin

  • View and manage every registered account
  • Remove any course from the platform
  • View enrollment counts per course

πŸ‘₯ Who does what

graph TD
    subgraph Student
        S1[Browse courses]
        S2[Mock Enroll & Pay]
        S3[Watch & track progress]
        S4[Download certificate]
    end
    subgraph Teacher
        T1[Create course]
        T2[Upload lectures locally]
        T3[Monitor enrollments]
    end
    subgraph Admin
        A1[Manage users]
        A2[Manage courses]
    end
Loading

πŸ“ Project Structure

learnhub/
β”‚
β”œβ”€β”€ backend/                    # Express API and database models
β”‚   β”œβ”€β”€ config/                 # DB connection setup
β”‚   β”œβ”€β”€ controllers/            # Controller logic
β”‚   β”œβ”€β”€ middlewares/            # Auth and role verification middlewares
β”‚   β”œβ”€β”€ routers/                # Express routing files
β”‚   β”œβ”€β”€ schemas/                # Mongoose schemas
β”‚   β”œβ”€β”€ seed.js                 # Standalone seeding script
β”‚   β”œβ”€β”€ .env
β”‚   └── package.json
β”‚
└── frontend/                   # React SPA powered by Vite
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ components/         # UI components (Admin/User/Common)
    β”‚   β”œβ”€β”€ App.css
    β”‚   β”œβ”€β”€ App.jsx
    β”‚   └── main.jsx
    └── package.json

πŸš€ Getting Started

There's no live demo yet, so you'll need to run this locally.

Prerequisites

  • Node.js Node.js 18+
  • MongoDB MongoDB

1. Clone & install

git clone https://github.com/udaycodespace/learnhub.git
cd learnhub

cd backend && npm install
cd ../frontend && npm install

2. Configure environment

Copy the example environment file to .env and fill in your own values:

cp backend/.env.example backend/.env

3. Run it

# Terminal A β€” Backend
cd backend
npm start
# β†’ http://localhost:5000
# Terminal B β€” Frontend
cd frontend
npm run dev
# β†’ http://localhost:5173

4. Seed demo data

Run the database seed script to populate roles, courses, and default test accounts:

cd backend
node seed.js

πŸ”‘ Demo Accounts

After running the seed script, you can log in immediately using these credentials:

Role Email Password
Admin learn@learnhub.com changethispassword
Teacher teacher@learnhub.com teacherpassword
Student 1 student1@learnhub.com student1password
Student 2 student2@learnhub.com student2password

πŸ›  Roadmap / Not Yet Implemented

The following features are planned for future releases or currently exist as mock/partial integrations:

  • Real Payment Gateway Integration: The platform uses a mock card form that immediately enrolls the student without any real charge. Payment records (card details, status) are stored in MongoDB and accessible via a backend API route, but no React admin page reads them. Integration with Stripe or Razorpay is planned.
  • Admin Activity Log Viewer: User logins are recorded to MongoDB (ActivityLog collection) by the backend on every login, but no React frontend component reads or displays this data. The feature exists at the data layer only.
  • Cloud Video Hosting (Cloudinary): Video uploads are handled locally via Multer, stored in ./uploads/ on the server filesystem. Cloudinary env vars are present but the SDK is not integrated. Cloud hosting is planned.

πŸͺ Custom Hooks

None yet. If you build one, add it here with a short usage example:

// const { hookExports } = useCustomHook();

πŸ“œ Scripts

Backend (backend/)

Command Description
npm start Starts the backend with nodemon

Frontend (frontend/)

Command Description
npm run dev Starts the Vite dev server
npm run build Builds the production bundle
npm run preview Previews the production build locally

🌐 Deployment

Not deployed yet, and that's on purpose for now. I'd rather see how the project grows and what contributors actually need before locking in a hosting setup.

If you have thoughts on where this should live (Vercel, Render, Railway, self-hosted, or something else), open a discussion or an issue. That'll shape the decision more than me guessing upfront.

Want to help set up CI/CD once a direction is picked? Check CONTRIBUTING.md.



❄️ Open Source Programs!


ECSoC 2026

Note

⚠️ Heads up: This README describes the intended feature set (video uploads, progress tracking, etc.), but the current codebase doesn't fully match it yet β€” some described features are missing, partial, or not wired up in the UI. That gap is your opportunity: find the mismatches and raise them as issues.

⏰ Deadline: 16/07/2026. If these gaps aren't raised as issues by then, I'll manually go through and file them all myself β€” after that, you can only claim them via /assign, not report them first.


πŸ€” New to Open Source programs/events!

Here are a few articles that will help you get an idea of how to start contributing to open source projects: You can refer to the following articles on the basics of Git and Github.


πŸ§‘β€πŸ’» Project Maintainer

I'm udaycodespace, and I created and maintain LearnHub.


🀝 Contributors

Contributors who submit PRs will be added to the table below.



πŸ’» Code Β Β·Β  πŸ› Bug fix Β Β·Β  πŸ§ͺ Tests Β Β·Β  πŸ”’ Security Β Β·Β  ⚑ Performance Β Β·Β  🎨 Design Β Β·Β  πŸ“– Docs Β Β·Β  πŸš‡ Infrastructure Β Β·Β  β™Ώ Accessibility Β Β·Β  πŸ‘€ Review



πŸ“„ License

Distributed under the MIT License.

MIT License

Copyright (c) 2026 udaycodespace

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

See LICENSE for the full file.



Built as a full-stack e-learning project

If this was useful, a ⭐ helps other people find it


Tech

```

Want me to save this to a file and drop it as an artifact/download too, or is copy-paste good for you?

About

Open-source MERN e-learning platform with video courses, progress tracking & certificates. Beginner-friendly issues, active maintainer, ESoC-ready.

Topics

Resources

License

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Contributors