Skip to content

Latest commit

Β 

History

38 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DEMO: https://eduboard-git-main-badivanas-projects.vercel.app

πŸŽ“ EduBoard β€” Full-Stack MERN Learning Platform

MongoDB Express React Node.js Tailwind License

EduBoard is a modern, production-style e-learning platform built with the MERN stack (MongoDB, Express, React, Node.js). It started life as a static HTML site and has been rebuilt into a full application with authentication, a course catalog, enrollments, reviews, and a student dashboard.


🌐 Live Demo

URL
Web app (Vercel) https://eduboard-git-main-badivanas-projects.vercel.app
API (Render) https://eduboard-nbb0.onrender.com/api/health

⏳ The API runs on Render's free tier and sleeps after ~15 min idle, so the first request may take ~30s to wake. Subsequent requests are fast.

Try it β€” log in with a seeded demo account:

Role Email Password
Student student@eduboard.com password123
Admin admin@eduboard.com admin123

✨ Features

Frontend (React + Vite + Tailwind)

  • 🎨 Attractive, fully responsive UI with the EduBoard brand
  • 🏠 Landing page with hero, features, featured courses & CTA
  • πŸ“š Course catalog with search, category filters, sorting & pagination
  • πŸ“– Rich course detail page β€” curriculum, instructor, reviews, enroll flow
  • πŸ” Register / login with JWT (httpOnly cookie + bearer token)
  • πŸ“Š Student dashboard β€” enrolled courses, progress tracking, profile editing
  • πŸ’° Dynamic pricing page & contact form
  • πŸ”” Toast notifications, protected routes, loading states

Backend (Node + Express + MongoDB)

  • πŸ”‘ JWT authentication with student / instructor / admin roles
  • 🧱 RESTful API for courses, enrollments, reviews, plans, contact & users
  • πŸ›‘οΈ Security hardening: helmet, CORS, rate limiting, express-mongo-sanitize, bcrypt
  • βœ… Request validation with express-validator
  • πŸ—„οΈ Mongoose models with relations, virtuals, text search & auto-rating aggregation
  • ⚠️ Centralized error handling & async wrappers
  • 🌱 Seed script with demo users, courses, reviews & plans

🧱 Tech Stack

Layer Technology
Frontend React 18, Vite, React Router, Tailwind CSS, Axios, React Hot Toast
Backend Node.js, Express, Mongoose, JWT, bcryptjs, express-validator
Database MongoDB

πŸ“‚ Project Structure

Eduboard/
β”œβ”€β”€ client/                  # React + Vite frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ api/             # Axios instance
β”‚   β”‚   β”œβ”€β”€ components/      # Navbar, Footer, CourseCard, ...
β”‚   β”‚   β”œβ”€β”€ context/         # AuthContext
β”‚   β”‚   β”œβ”€β”€ pages/           # Home, Courses, CourseDetail, Dashboard, ...
β”‚   β”‚   β”œβ”€β”€ App.jsx
β”‚   β”‚   └── main.jsx
β”‚   β”œβ”€β”€ tailwind.config.js
β”‚   └── vite.config.js
β”‚
β”œβ”€β”€ server/                  # Express + MongoDB backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/          # DB connection
β”‚   β”‚   β”œβ”€β”€ controllers/     # Route handlers
β”‚   β”‚   β”œβ”€β”€ middleware/      # auth, error, validation
β”‚   β”‚   β”œβ”€β”€ models/          # User, Course, Enrollment, Review, Plan, Contact
β”‚   β”‚   β”œβ”€β”€ routes/          # API routes
β”‚   β”‚   β”œβ”€β”€ utils/           # token, seed
β”‚   β”‚   β”œβ”€β”€ app.js
β”‚   β”‚   └── server.js
β”‚   └── .env.example
β”‚
└── package.json             # Root scripts to run both apps

πŸš€ Getting Started

Prerequisites

  • Node.js β‰₯ 18
  • MongoDB running locally (mongodb://127.0.0.1:27017) or a MongoDB Atlas URI

1. Clone & install

git clone https://github.com/badivana/Eduboard.git
cd Eduboard
npm run install:all      # installs both server and client deps

2. Configure environment

# Backend
cp server/.env.example server/.env
# then edit server/.env β€” set MONGO_URI and a strong JWT_SECRET

The frontend needs no env in development (Vite proxies /api to the backend).

3. Seed the database (optional but recommended)

npm run seed

This creates demo accounts:

Role Email Password
Admin admin@eduboard.com admin123
Instructor sarah@eduboard.com password123
Student student@eduboard.com password123

4. Run the app (two terminals)

npm run dev:server      # β†’ http://localhost:5000  (API)
npm run dev:client      # β†’ http://localhost:5173  (web app)

Open http://localhost:5173.


πŸ”Œ API Overview

Base URL: http://localhost:5000/api

Method Endpoint Description Access
POST /auth/register Create account Public
POST /auth/login Log in Public
GET /auth/me Current user Auth
GET /courses List/search/filter courses Public
GET /courses/:slug Course detail + reviews Public
POST /courses Create course Instructor
POST /enrollments Enroll in a course Auth
GET /enrollments/me My enrollments Auth
PATCH /enrollments/:id/progress Update progress Auth
POST /reviews Add/update a review Enrolled
GET /plans Pricing plans Public
POST /contact Submit contact form Public

πŸ› οΈ Root Scripts

Script Action
npm run install:all Install server + client dependencies
npm run seed Seed MongoDB with demo data
npm run dev:server Start the API in watch mode
npm run dev:client Start the Vite dev server
npm run build Build the frontend for production
npm start Start the production API server

☁️ Deployment

EduBoard is deployed as three separate services:

Browser ──> Vercel (React SPA) ──HTTPS /api──> Render (Express API) ──> MongoDB Atlas
Piece Host Notes
Frontend Vercel Root dir client; needs VITE_API_URL = the Render API base URL (no trailing slash, no /api)
Backend Render Root dir server; needs MONGO_URI, CLIENT_URL, JWT_SECRET, NODE_ENV=production
Database MongoDB Atlas Network Access must allow 0.0.0.0/0 (Render uses dynamic IPs)

πŸ“– Full step-by-step guide: see DEPLOYMENT.md.

Two gotchas worth knowing

  • CORS β€” the API only answers browsers from allowed origins. app.js accepts anything in CLIENT_URL (comma-separated) plus this project's Vercel deployment URLs (*-badivanas-projects.vercel.app), so preview deploys work without reconfiguring.
  • Local DB β‰  cloud DB β€” your local MongoDB and Atlas are separate. Production starts empty. Seed Atlas once by pointing the seed script at it:
    cd server
    # PowerShell:
    $env:MONGO_URI="<your atlas uri>"; npm run seed; Remove-Item Env:MONGO_URI
    # bash:
    MONGO_URI="<your atlas uri>" npm run seed
    ⚠️ The seed wipes all collections first β€” only run it on an empty/throwaway database, never after real users sign up.

πŸ“„ License

MIT β€” feel free to use, modify, and distribute for educational purposes.

πŸ‘¨β€πŸ’» Author

Prajwal B T β€” github.com/badivana

About

EduBoard is a full-stack MERN learning platform featuring secure JWT authentication, course management, enrollments, reviews, role-based access control, and a modern responsive React interface.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages