A modern, full-stack Learning Management System (LMS) built with Next.js 15 and NestJS
Learnify is a production-ready Learning Management System that enables course creators to build, manage, and sell online courses with integrated video streaming, payment processing, and certificate generation.
Feature
Description
π Course Management
Create courses with chapters, lessons, and rich content using a TipTap-based editor
π¬ Video Streaming
HLS video delivery via Mux with playback tracking and resume functionality
π³ Payment Integration
Razorpay payment gateway with refund support
π Certificates
Auto-generated PDF certificates upon course completion
π₯ Multi-Role System
Admin, Instructor, Student, and Support roles with granular permissions
π Analytics Dashboard
Track enrollments, revenue, and student progress
π Notifications
In-app notification system for course updates
β Reviews & Ratings
Student review system with moderation
learnify/
βββ api/ # NestJS Backend API
β βββ src/
β β βββ core/ # Core utilities, guards, decorators
β β βββ features/ # Feature modules
β β β βββ admin/ # Admin operations
β β β βββ assets/ # File/media asset management
β β β βββ auth/ # Authentication (Better Auth)
β β β βββ course-management/ # Courses, chapters, lessons
β β β βββ mux/ # Video processing & streaming
β β β βββ payment/ # Razorpay integration
β β β βββ review/ # Course reviews
β β β βββ notification/ # In-app notifications
β β β βββ support/ # Contact & feedback
β β βββ infrastructure/ # Database, email, storage
β βββ prisma/ # Database schema & migrations
β
βββ app/ # Next.js Frontend
βββ src/
βββ app/
β βββ (admin)/ # Admin dashboard
β βββ (auth)/ # Login, signup, password reset
β βββ (landing)/ # Public pages (home, courses, about)
β βββ (student)/ # Student portal
β βββ course/ # Course player & consumption
βββ components/ # Reusable UI components
βββ hooks/ # Custom React hooks
βββ services/ # API client services
βββ lib/ # Utilities & configurations
Technology
Purpose
NestJS
Node.js framework with modular architecture
Prisma
Type-safe ORM with PostgreSQL
Better Auth
Authentication library with session management
Mux
Video encoding, hosting & HLS streaming
Razorpay
Payment processing (India-focused)
Cloudflare R2
Object storage for assets
Resend
Transactional email service
Pino
Structured logging
Swagger/Scalar
API documentation
Node.js 18+
pnpm (recommended) or npm
PostgreSQL database (or Neon serverless)
Cloudflare R2 bucket
Mux account
Razorpay account
git clone https://github.com/yourusername/learnify.git
cd learnify
# Install API dependencies
cd api && pnpm install
# Install App dependencies
cd ../app && pnpm install
# API configuration
cp api/.env.example api/.env
# App configuration
cp app/.env.example app/.env
Edit both .env files with your credentials:
API Environment Variables
Variable
Description
DATABASE_URL
PostgreSQL connection string
CLOUDFLARE_ACCOUNT_ID
Cloudflare account ID
R2_ACCESS_KEY_ID / R2_SECRET_ACCESS_KEY
R2 storage credentials
MUX_TOKEN_ID / MUX_TOKEN_SECRET
Mux API credentials
RAZORPAY_KEY_ID / RAZORPAY_KEY_SECRET
Razorpay API keys
RESEND_API_KEY
Email service API key
BETTER_AUTH_SECRET
Auth session secret
App Environment Variables
Variable
Description
NEXT_PUBLIC_APP_URL
Frontend URL (e.g., http://localhost:3002)
NEXT_PUBLIC_BACKEND_URL
API URL (e.g., http://localhost:3001)
NEXT_PUBLIC_RAZORPAY_KEY_ID
Public Razorpay key
SENTRY_DSN
Sentry error tracking
NEXT_PUBLIC_POSTHOG_KEY
PostHog analytics key
cd api
# Generate Prisma client
pnpm prisma:generate
# Push schema to database
pnpm prisma:push
# (Optional) Seed with sample data
pnpm prisma:seed
4. Run Development Servers
# Terminal 1: API (runs on port 3001)
cd api && pnpm dev
# Terminal 2: App (runs on port 3002)
cd app && pnpm dev
Visit:
The Prisma schema defines these core models:
Model
Description
User
Users with roles (Admin, Instructor, Student, Support)
Course
Courses with pricing, categories, and metadata
CourseChapter
Ordered chapters within a course
Lesson
Video or document lessons with content
Enrollment
Student enrollments with progress tracking
Payment
Payment records with Razorpay integration
Certificate
Generated certificates with PDF storage
CourseReview
Student reviews and ratings
Asset
Media files stored in R2 with Mux integration
Notification
In-app notifications
Script
Command
Description
Dev
pnpm dev
Start in watch mode
Build
pnpm build
Compile for production
Start
pnpm start
Run production build
Lint
pnpm check:fix
Lint & fix with Biome
Test
pnpm test
Run unit tests
DB Studio
pnpm prisma:studio
Open Prisma Studio
Migrate
pnpm migrate
Create new migration
Script
Command
Description
Dev
pnpm dev
Start Next.js dev server
Build
pnpm build
Build for production
Analyze
pnpm analyze
Analyze bundle size
Lint
pnpm check:fix
Lint & fix with Biome
Both services include production-ready Dockerfiles:
# Build API
cd api && docker build -t learnify-api .
# Build App
cd app && docker build -t learnify-app .
π User Roles & Permissions
Role
Capabilities
Admin
Full access: manage users, courses, payments, analytics
Instructor
Create/edit courses, view enrollments, manage content
Student
Browse courses, enroll, track progress, get certificates
Support
Handle contact messages and feedback
The API is documented with Swagger/OpenAPI and rendered using Scalar:
This project is unlicensed and intended for private use.
Built with β€οΈ using modern web technologies