A modern, full-stack learning management system built with Next.js, NestJS, and Prisma. This platform enables users to create, manage, and consume educational content through an intuitive web interface.
- Course Discovery: Browse and search through available courses
- Video Learning: Watch video lessons with progress tracking
- Progress Tracking: Monitor your learning progress across courses
- Dashboard: Personal dashboard showing enrolled courses and statistics
- User Profile: Manage your personal information and learning history
- Course Creation: Create and manage educational courses
- Lesson Management: Add video lessons with descriptions and ordering
- Content Organization: Structure courses with multiple lessons
- Student Analytics: View enrollment statistics for your courses
- User Management: Create, update, and delete user accounts
- Course Management: Full CRUD operations for courses
- Lesson Management: Complete lesson lifecycle management
- Analytics Dashboard: View system-wide statistics and metrics
- Role-based Access: Control access based on user roles (student, instructor, admin)
- Authentication: JWT-based authentication with NextAuth.js
- Video Progress: Track watch time and completion status
- Responsive Design: Mobile-friendly interface with Tailwind CSS
- Real-time Updates: Dynamic content updates and progress tracking
- API Documentation: Swagger/OpenAPI documentation for the REST API
- Database Migrations: Prisma-based database management
- Framework: Next.js 15 with App Router
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: Radix UI primitives
- Authentication: NextAuth.js
- State Management: React hooks and context
- HTTP Client: Axios
- Framework: NestJS
- Language: TypeScript
- Database: SQLite (with Prisma ORM)
- Authentication: JWT with Passport.js
- API Documentation: Swagger/OpenAPI
- Validation: Class-validator and class-transformer
- ORM: Prisma
- Database: SQLite (development)
- Migrations: Prisma Migrate
lets-learn/
βββ backend/ # NestJS backend application
β βββ src/
β β βββ admin/ # Admin management module
β β βββ auth/ # Authentication module
β β βββ courses/ # Course management module
β β βββ enrollments/ # Enrollment management module
β β βββ lessons/ # Lesson management module
β β βββ progress/ # Progress tracking module
β β βββ users/ # User management module
β β βββ prisma/ # Prisma service
β βββ prisma/ # Database schema and migrations
β βββ package.json
βββ frontend/ # Next.js frontend application
β βββ app/ # App router pages
β β βββ admin/ # Admin panel pages
β β βββ auth/ # Authentication pages
β β βββ courses/ # Course pages
β β βββ dashboard/ # User dashboard
β β βββ profile/ # User profile
β βββ components/ # Reusable UI components
β β βββ admin/ # Admin-specific components
β β βββ auth/ # Authentication components
β β βββ courses/ # Course-related components
β β βββ home/ # Homepage components
β β βββ layout/ # Layout components
β β βββ ui/ # Base UI components
β βββ lib/ # Utility functions and API client
β βββ package.json
βββ README.md
- Node.js 18 or higher
- npm or yarn or pnpm
-
Clone the repository
git clone <repository-url> cd lets-learn
-
Install backend dependencies
cd backend npm install -
Install frontend dependencies
cd ../frontend npm install -
Set up the database
cd ../backend npx prisma generate npx prisma migrate deploy -
Environment Variables
Create
.envfiles in both backend and frontend directories:Backend (.env):
DATABASE_URL="file:./dev.db" JWT_SECRET=your-jwt-secret-here
Frontend (.env.local):
NEXT_PUBLIC_API_URL=http://localhost:3001 NEXTAUTH_URL=http://localhost:3000 NEXTAUTH_SECRET=your-nextauth-secret-here
-
Start the backend server
cd backend npm run start:devThe backend will run on http://localhost:3001
-
Start the frontend development server
cd frontend npm run devThe frontend will run on http://localhost:3000
-
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
- API Documentation: http://localhost:3001/api
The application uses the following main entities:
- User: Stores user information and authentication data
- Course: Contains course information and metadata
- Lesson: Individual lessons within courses
- Enrollment: Links users to courses they're enrolled in
- VideoProgress: Tracks video watch progress for each user and lesson
- JWT Authentication: Secure token-based authentication
- Role-based Access: Three user roles supported:
student: Default role for learnersinstructor: Can create and manage coursesadmin: Full system access
- Protected Routes: API endpoints and frontend pages are protected based on user roles
POST /auth/register- User registrationPOST /auth/login- User login
GET /courses- Get all coursesGET /courses/:id- Get course by IDPOST /courses- Create new course (auth required)PUT /courses/:id- Update course (auth required)DELETE /courses/:id- Delete course (auth required)
GET /lessons- Get lessons (filtered by course)POST /lessons- Create new lesson (auth required)PUT /lessons/:id- Update lesson (auth required)DELETE /lessons/:id- Delete lesson (auth required)
POST /enrollments- Enroll in course (auth required)GET /enrollments/my-courses- Get user's enrolled courses (auth required)PUT /enrollments/progress- Update course progress (auth required)
GET /admin/dashboard- Get admin dashboard stats (admin only)GET /admin/users- Get all users (admin only)POST /admin/users- Create user (admin only)GET /admin/courses- Get all courses (admin only)GET /admin/lessons- Get all lessons (admin only)
The frontend uses a comprehensive design system built with:
- Radix UI: Accessible, unstyled UI primitives
- Tailwind CSS: Utility-first CSS framework
- Lucide Icons: Beautiful, customizable icons
- Responsive Design: Mobile-first approach
- Home: Landing page with featured courses
- Courses: Browse all available courses
- Auth: Sign in and sign up pages
- Dashboard: Personal learning dashboard
- Profile: User profile management
- Course Detail: Individual course page with lessons
- Video Player: Video lesson player with progress tracking
- Admin Dashboard: System overview and statistics
- User Management: CRUD operations for users
- Course Management: CRUD operations for courses
- Lesson Management: CRUD operations for lessons
npm run start:dev # Start development server
npm run build # Build for production
npm run start:prod # Start production server
npm run test # Run tests
npm run lint # Run ESLintnpm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLintnpx prisma generate # Generate Prisma client
npx prisma migrate dev # Create and apply migration
npx prisma studio # Open Prisma Studio- Build the application:
npm run build - Set production environment variables
- Deploy to your preferred hosting service
- Run database migrations:
npx prisma migrate deploy
- Build the application:
npm run build - Set production environment variables
- Deploy to Vercel, Netlify, or your preferred hosting service
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js for the amazing React framework
- NestJS for the powerful Node.js framework
- Prisma for the excellent ORM
- Tailwind CSS for the utility-first CSS framework
- Radix UI for the accessible UI components
For questions or support, please open an issue in the GitHub repository.