A modern Learning Management System with hierarchical course structure, YouTube video integration, and comprehensive progress tracking for both authenticated and anonymous users.
- π― Hierarchical structure: Course β Chapter β Lesson
- πΉ YouTube video integration with embedded player
- π Rich text content with TipTap editor
- πΌοΈ Image and code example support
- β Interactive questions and assignments
- π Individual progress tracking per user session
- π€ Anonymous user support with session continuity
- π File upload and materials management system
- π¦ Course export to ZIP archives
- π JWT-based authentication with secure HTTP-only cookies
- π₯ Role-based access control (Teachers/Instructors, Students)
- π Public course preview without registration
- π± Responsive mobile-first design
- π Course completion celebrations
- Frontend: React 18, TypeScript, Tailwind CSS, Shadcn/ui components
- Backend: Node.js, Express, TypeScript
- Database: PostgreSQL with Drizzle ORM
- Authentication: JWT tokens with HTTP-only cookies
- State Management: TanStack Query (React Query)
- Rich Text: TipTap editor
- Build Tools: Vite
- Containerization: Docker with multi-stage builds
- Clone the repository
- Install dependencies:
npm install
- Create a
.env
file with environment variables (see "Environment Variables" section) - Start the application:
npm run dev
- Create a
.env
file with environment variables - Start with Docker Compose:
docker-compose up -d
The application will be available on port 80.
Create a .env
file in the project root with the following variables:
# PostgreSQL database password (REQUIRED)
POSTGRES_PASSWORD=your_secure_password_here
# JWT session secret (REQUIRED for production)
SESSION_SECRET=your_jwt_secret_key_here
# Additional variables for development (optional)
DATABASE_URL=postgresql://username:password@localhost:5432/vibelms
PGHOST=localhost
PGPORT=5432
PGUSER=username
PGPASSWORD=password
PGDATABASE=vibelms
POSTGRES_PASSWORD
- PostgreSQL database password. Use a strong password for security.SESSION_SECRET
- Secret key for JWT token signing. Generate a random string (32+ characters).
If you're using a local database for development, add:
DATABASE_URL
- Full PostgreSQL connection stringPGHOST
- Database host (usually localhost)PGPORT
- Database port (usually 5432)PGUSER
- Database usernamePGPASSWORD
- Database user passwordPGDATABASE
- Database name
βββ client/ # Frontend application
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Application pages
β β βββ hooks/ # Custom hooks
β β βββ lib/ # Utilities and configurations
βββ server/ # Backend application
β βββ index.ts # Server entry point
β βββ routes.ts # API routes
β βββ storage.ts # Data access layer
β βββ db.ts # Database configuration
βββ shared/ # Shared types and schemas
β βββ schema.ts # Database schemas
βββ uploads/ # Uploaded files
βββ Dockerfile # Docker configuration
βββ docker-compose.yml # Docker Compose configuration
βββ init-db.sql # Database initialization script
The application uses PostgreSQL with automatic migrations through Drizzle ORM. When running in Docker, the database structure is created automatically.
# Apply schema changes to the database
npm run db:push
# Open Drizzle Studio for data viewing
npm run db:studio
GET /api/public/courses
- List public coursesGET /api/public/courses/:id
- Get public course detailsGET /api/public/lessons/:id/details
- Get lesson content for previewGET /api/settings/allow_student_registration
- Check registration settings
POST /api/auth/login
- User loginPOST /api/auth/register
- User registrationPOST /api/auth/logout
- User logoutGET /api/auth/user
- Get current user info
GET /api/courses
- User's coursesGET /api/courses/:id
- Course detailsGET /api/courses/:id/progress
- User's progress in coursePOST /api/progress
- Update lesson progressGET /api/enrollments
- User's enrollmentsPOST /api/enrollments
- Enroll in courseGET /api/materials
- Course materialsPOST /api/materials
- Upload material
GET /api/users
- Manage usersDELETE /api/users/bulk
- Delete multiple usersGET /api/dashboard/stats
- System statistics
- Instructor/Teacher - Full course management, user administration, analytics access
- Student - Course enrollment, progress tracking, material access
- Anonymous - Public course preview, automatic session-based progress tracking
- JWT-based authentication with HTTP-only cookies
- Automatic CSRF protection through SameSite cookie policy
- File path validation prevents directory traversal attacks
- Filename sanitization on upload
- Role-based access control for API endpoints
- Secure password hashing with bcrypt
- Session-based anonymous user tracking
-
Clone the repository and create your
.env
file:cp .env.example .env # Edit .env with your secure passwords and secrets
-
Generate secure secrets:
# Generate a secure PostgreSQL password openssl rand -base64 32 # Generate a secure JWT session secret openssl rand -base64 64
-
Start the application:
docker-compose up -d
-
Check application status:
docker-compose logs -f app docker-compose ps
The application will be available at http://localhost
(port 80).
The application includes built-in health checks:
- Docker health check endpoint:
GET /api/health
- Automatic container restart on failure
- Database connection monitoring
For production environments:
- Use a reverse proxy (nginx) for SSL termination
- Configure PostgreSQL with appropriate connection pooling
- Monitor JWT session token expiration (7 days default)
- Scale horizontally using Docker Swarm or Kubernetes
For support, please create an issue in the project repository.
MIT License