Skip to content

ShreyashDesai021/E-learning_Platform_using_MERN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

E-learning Platform using MERN Stack

A full-stack e-learning platform built with the MERN (MongoDB, Express.js, React, Node.js) stack that enables instructors to create and manage courses while allowing students to enroll, learn, and earn certificates.

🌟 Features

For Students

  • πŸ“š Browse and search available courses
  • πŸŽ“ Enroll in courses with integrated payment system (Stripe)
  • πŸ“Ή Watch video lectures with progress tracking
  • πŸ“ Take tests and quizzes
  • πŸ† Earn certificates upon course completion
  • πŸ“Š Track learning progress
  • πŸŒ™ Dark mode support

For Instructors/Admins

  • βž• Create and manage courses
  • πŸ“Ή Upload and organize lectures
  • πŸ“ Create tests and quizzes for courses
  • πŸ“Š Dashboard with analytics
  • πŸ‘₯ View enrolled students
  • ✏️ Edit course content and structure
  • πŸ“· Upload course thumbnails and media

General Features

  • πŸ” Secure authentication with JWT
  • πŸ’³ Payment integration with Stripe
  • ☁️ Media storage with Cloudinary
  • πŸ“± Responsive design with Tailwind CSS
  • 🎨 Modern UI with Radix UI components
  • πŸ“ˆ Real-time progress tracking
  • πŸ”„ State management with Redux Toolkit

πŸ› οΈ Tech Stack

Frontend

  • React 18 - UI library
  • Vite - Build tool and dev server
  • Redux Toolkit - State management
  • React Router - Navigation
  • Tailwind CSS - Styling
  • Radix UI - Component library
  • React Player - Video playback
  • React Quill - Rich text editor
  • Recharts - Data visualization
  • Axios - HTTP client
  • Lucide React - Icons

Backend

  • Node.js - Runtime environment
  • Express.js - Web framework
  • MongoDB - Database
  • Mongoose - ODM
  • JWT - Authentication
  • bcryptjs - Password hashing
  • Stripe - Payment processing
  • Cloudinary - Media storage
  • Multer - File uploads
  • PDFKit - Certificate generation

πŸ“‹ Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v18 or higher)
  • MongoDB (local or Atlas account)
  • npm or yarn package manager

πŸš€ Installation & Setup

1. Clone the repository

git clone https://github.com/ShreyashDesai021/E-learning_Platform_using_MERN.git
cd E-learning_Platform_using_MERN

2. Setup Backend (Server)

cd server
npm install

Create a .env file in the server directory:

# Database
MONGODB_URI=your_mongodb_connection_string

# Server
PORT=8080

# JWT
JWT_SECRET=your_jwt_secret

# Cloudinary (for media uploads)
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret

# Stripe (for payments)
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret

# Client URL
CLIENT_URL=http://localhost:5173

3. Setup Frontend (Client)

cd ../client
npm install

Create a .env file in the client directory:

VITE_API_URL=http://localhost:8080
VITE_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key

4. Run the Application

Terminal 1 - Start Backend:

cd server
npm run dev

Terminal 2 - Start Frontend:

cd client
npm run dev

The application will be available at:

  • Frontend: http://localhost:5173
  • Backend API: http://localhost:8080

πŸ“ Project Structure

E-learning_Platform_using_MERN/
β”œβ”€β”€ client/                 # Frontend React application
β”‚   β”œβ”€β”€ public/            # Static files
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/           # Redux store configuration
β”‚   β”‚   β”œβ”€β”€ assets/        # Images and static assets
β”‚   β”‚   β”œβ”€β”€ components/    # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ features/      # Redux slices/features
β”‚   β”‚   β”œβ”€β”€ layout/        # Layout components
β”‚   β”‚   β”œβ”€β”€ lib/           # Utility functions
β”‚   β”‚   β”œβ”€β”€ pages/         # Page components
β”‚   β”‚   β”‚   β”œβ”€β”€ admin/     # Admin/Instructor pages
β”‚   β”‚   β”‚   └── student/   # Student pages
β”‚   β”‚   β”œβ”€β”€ App.jsx        # Main App component
β”‚   β”‚   └── main.jsx       # Entry point
β”‚   β”œβ”€β”€ package.json
β”‚   └── vite.config.js
β”‚
└── server/                # Backend Node.js application
    β”œβ”€β”€ controllers/       # Request handlers
    β”œβ”€β”€ database/          # Database configuration
    β”œβ”€β”€ middlewares/       # Custom middleware
    β”œβ”€β”€ models/            # Mongoose models
    β”œβ”€β”€ routes/            # API routes
    β”œβ”€β”€ utils/             # Utility functions
    β”œβ”€β”€ index.js           # Server entry point
    └── package.json

πŸ”‘ Key Models

  • User - Student and instructor profiles
  • Course - Course information and metadata
  • Lecture - Individual video lectures
  • Test - Quizzes and assessments
  • TestAttempt - Student test submissions
  • CoursePurchase - Payment and enrollment records
  • CourseProgress - Student progress tracking

🎯 API Endpoints

Authentication

  • POST /api/v1/user/register - Register new user
  • POST /api/v1/user/login - User login
  • POST /api/v1/user/logout - User logout

Courses

  • GET /api/v1/course - Get all courses
  • POST /api/v1/course - Create course (admin)
  • PUT /api/v1/course/:id - Update course (admin)
  • DELETE /api/v1/course/:id - Delete course (admin)

Lectures

  • GET /api/v1/course/:courseId/lecture - Get course lectures
  • POST /api/v1/course/:courseId/lecture - Create lecture (admin)

Payments

  • POST /api/v1/purchase/checkout - Create checkout session
  • POST /api/v1/purchase/webhook - Stripe webhook handler

Progress

  • GET /api/v1/progress/:courseId - Get course progress
  • POST /api/v1/progress/:courseId/lecture/:lectureId - Update progress

πŸ§ͺ Testing

The platform includes test functionality for courses:

# Run client tests (if available)
cd client
npm run lint

# Run server in development mode
cd server
npm run dev

πŸ“¦ Build for Production

Build Frontend

cd client
npm run build

Run Backend in Production

cd server
npm start

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the ISC License.

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

Shreyash Desai

πŸ™ Acknowledgments

  • MERN Stack Community
  • React and Node.js documentation
  • Stripe for payment integration
  • Cloudinary for media management
  • All open-source libraries used in this project

πŸ“§ Support

For support, please open an issue in the GitHub repository.


Made with ❀️ using MERN Stack

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages