A full-featured web-based Learning Management System where students can discover, enroll in, and complete structured courses with video lessons, while teachers/admins create and manage course content. Includes secure authentication, payment processing for paid courses, real-time progress tracking, and comprehensive course search.
- Browse and search all courses by title, description, or instructor
- Enroll in free courses instantly or paid courses with secure payment links
- Watch video lessons in proper 16:9 aspect ratio format
- Complete lessons and unlock the next lesson sequentially
- Track progress across all enrolled courses
- Reset forgotten passwords with secure email links (1-hour expiry)
- Responsive dashboard showing enrolled courses
- Password visibility toggle for secure credential entry
- Create courses with title, description, instructor name, and custom thumbnails
- Manage course pricing (free or paid with custom price)
- Create ordered lessons with video embeds (YouTube, etc.)
- Edit course details including title, description, and thumbnail URL
- Delete courses and manage lesson order
- Track enrollments and completion rates
- View all courses and search functionality on dashboard
- Edit pricing and course metadata in real-time
- Student signup with email, username, and password validation
- Email must be @gmail.com with proper format
- Password minimum 10 characters with confirmation
- Admin signup with secret code
ADMIN2026 - JWT-based stateless authentication
- Secure password reset flow with 1-hour expiring email links
- Rate-limited link generation (1 new link per hour per user)
- Logout functionality with token invalidation
- Role-based access control (student vs admin)
- Paid course support with admin-configurable pricing
- Secure payment link generation and email delivery
- Payment links expire after 1 hour for security
- Only 1 active payment link per user per course per hour
- Automatic enrollment upon successful payment
- Free course instant enrollment
- Welcome email upon signup (student and admin)
- Course enrollment confirmation for paid courses
- Password reset email with secure token
- New lesson notification to enrolled students
- Payment receipt upon successful transaction
- Real-time course search across all courses
- Filter by title, description, or instructor name
- Available on public index page and student/admin dashboards
- Case-insensitive filtering with instant results
- Backend: Python 3.10+, Flask 3.x, Flask-CORS
- Database: PostgreSQL (production), SQLite (local development)
- ORM: SQLAlchemy 2.0 with Flask-SQLAlchemy
- Authentication: JWT (PyJWT) with token expiry
- Email: SMTP with Jinja2 templating
- Frontend: HTML5, CSS3, Vanilla JavaScript (no frameworks)
- Deployment: Vercel (serverless) with automatic schema migrations
Learning_Management_System/
βββ backend/
β βββ app.py # Flask app initialization & schema migration
β βββ database.py # SQLAlchemy setup & DB URI handling
β βββ models.py # ORM models (User, Course, Lesson, etc.)
β βββ routes/
β β βββ __init__.py
β β βββ api.py # All API endpoints
β βββ services/
β βββ __init__.py
β βββ auth_service.py # JWT token generation & verification
β βββ email_service.py # Email sending & template rendering
βββ frontend/
β βββ index.html # Public course browsing
β βββ login.html # Login with password toggle
β βββ signup.html # Student signup with validation
β βββ dashboard.html # Student/Admin dashboard with search
β βββ course.html # Course details & enrollment
β βββ lesson.html # Video lesson player & completion
β βββ profile.html # User profile management
β βββ forgot_password.html # Password reset request
β βββ reset_password.html # New password entry
β βββ forgot_password_mail.html # Email template for reset
β βββ course_payment_mail.html # Email template for payment link
β βββ welcome_*_mail.html # Welcome email templates
βββ static/
β βββ css/
β β βββ style.css # Global styles with responsive design
β βββ js/
β β βββ app.js # Utility functions & shared logic
β βββ img/
β βββ lms-logo.svg
βββ database/
β βββ lms.db # SQLite database (local only)
βββ requirements.txt # Python dependencies
βββ vercel.json # Vercel serverless config
βββ README.md
git clone https://github.com/bikram73/Learning_Management_System.git
cd Learning_Management_Systempython -m venv .venv
.\.venv\Scripts\Activate.ps1pip install -r requirements.txtCopy-Item .env.example .env
# Edit .env and set:
# - SECRET_KEY (JWT signing key)
# - MAIL_HOST, MAIL_PORT, MAIL_USERNAME, MAIL_PASSWORD (SMTP)
# - MAIL_FROM, SUPPORT_EMAIL (email addresses)
# - DATABASE_URL (PostgreSQL connection in production).\.venv\Scripts\python.exe backend/app.py- Email must be @gmail.com format (validated client & server)
- Username required
- Password minimum 10 characters
- Password confirmation must match
- Endpoint: POST /api/signup/student
- Requires secret admin code:
ADMIN2026 - Same email/password requirements as students
- Endpoint: POST /api/signup/admin
- Email and password
- Returns JWT token valid for 7 days
- Endpoint: POST /api/login
- Click "Forgot Password?" on login page
- Enter @gmail.com email address
- Receive reset email with 1-hour expiring link
- Set new password and auto-redirect to login
- Reset links expire after 1 hour
- Can only request 1 new link per hour (rate limited)
POST /api/signup/student- Student registrationPOST /api/signup/admin- Admin registration (requires ADMIN2026)POST /api/login- Login & get JWT tokenPOST /api/logout- Invalidate sessionPOST /api/forgot-password- Request password reset emailGET /api/reset-password/<token>- Verify reset token & return user emailPOST /api/reset-password- Set new password
GET /api/courses- List all courses (public)GET /api/course/<id>- Get course detailsPOST /api/course- Create course (admin only)PUT /api/course/<id>- Update course (owner admin only)DELETE /api/course/<id>- Delete course (owner admin only)GET /api/my-courses- Get user's enrolled/created courses
GET /api/course/<course_id>/lessons- Get all lessons for coursePOST /api/lesson- Create lesson (owner admin only)PUT /api/lesson/<id>- Update lesson (owner admin only)DELETE /api/lesson/<id>- Delete lesson (owner admin only)
POST /api/enroll- Enroll in course (student)GET /api/payment/<token>- Get payment link detailsPOST /api/payment/<token>- Process paymentPOST /api/lesson/complete- Mark lesson as completeGET /api/course-progress/<course_id>- Get course completion progress
| Page | Route | Purpose |
|---|---|---|
| Home | /index.html |
Browse all courses with search |
| Signup | /signup.html |
Student/Admin registration |
| Login | /login.html |
Authentication with password toggle |
| Dashboard | /dashboard.html |
Student courses / Admin controls |
| Profile | /profile.html |
User profile & settings |
| Course | /course.html?id=<id> |
Course details & enrollment |
| Lesson | /lesson.html?id=<id>&course=<id> |
Video lesson player |
| Forgot Password | /forgot_password.html |
Password reset request |
| Reset Password | /reset_password.html?token=<token> |
New password entry |
- Login as admin
- Go to Dashboard > Admin Panel > Create Course
- Select "Paid" for pricing type
- Enter course price in USD
- Courses automatically get thumbnail, title, and description
- Click "Open Course" from course card
- For paid courses, "Enroll" sends payment link to email
- Click "Pay Now" button in email (valid for 1 hour)
- Process payment
- Automatic enrollment upon successful payment
- If payment link expires, can request new one (1 per hour)
- Videos are embedded in 16:9 aspect ratio containers
- Supports iframe embeds (YouTube, Vimeo, etc.)
- "Next Lesson" button appears after lesson completion
- Students must complete lesson to unlock next one
- Completion marked by clicking "Mark Complete" button
- Signup: Go to
/signup.html, select Admin, enter codeADMIN2026 - Login: Use credentials from signup
- Create Course: Dashboard > Admin Panel > Create Course
- Title: "Python Basics"
- Description: "Learn Python fundamentals"
- Instructor: "John Doe"
- Pricing: "Paid" with price "49.99"
- Thumbnail: Paste image URL
- Add Lessons: Click course, add lesson with video embed
- Test Student Path: Logout, signup as student, enroll, complete lessons
# Ensure you're using the correct Python interpreter
.\.venv\Scripts\python.exe backend/app.py# Reinstall dependencies
pip install --upgrade -r requirements.txtThe app automatically migrates schema when it starts. If you see "column X does not exist":
- Ensure
DATABASE_URLis correct - App will auto-create missing columns on next startup
- No manual migration needed
- Check
.envhas correct MAIL_HOST, MAIL_USERNAME, MAIL_PASSWORD - Gmail requires "App Passwords" for SMTP (not regular password)
- Verify MAIL_FROM address is authorized to send
- Tokens valid for 7 days
- Reset links valid for 1 hour
- Payment links valid for 1 hour
- After expiry, user must login again or request new reset link
SECRET_KEY=<random-secret>
DATABASE_URL=postgresql://user:pass@host/dbname
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your-email@gmail.com
MAIL_PASSWORD=<app-password>
MAIL_FROM=noreply@lms.com
SUPPORT_EMAIL=support@lms.com
CRON_SECRET=<random-secret>
APP_BASE_URL=https://your-vercel-domain.com
# Commit changes
git add .
git commit -m "feat: add course search functionality"
# Push to GitHub
git push -u origin main- Create features on feature branches
- Test locally before pushing
- Update README for major features
- Keep code DRY and maintainable
This project is open-source and available under the MIT License.
If you already created a remote and get an error, verify remotes with:
git remote -v- Quiz and assignments
- Certificates
- Discussion forums
- Analytics dashboard enhancements
- Better deployment pipeline (CI/CD)
Built for learning and experimentation with full-stack web development.