A comprehensive Learning Management System (LMS) and Training Management System (TMS) with AI capabilities, designed for Singapore's SkillsFuture training ecosystem.
AI-LMS-TMS is a full-stack, enterprise-grade web application that manages the complete training lifecycle - from course creation and scheduling to learner enrollment, progress tracking, assessments, and certification. Built with modern technologies and deep integration with Singapore's SkillsFuture ecosystem, it provides a seamless experience for training providers, trainers, and learners.
- AI-Powered Learning: Google Gemini chatbot for personalized learner assistance
- SSG Integration: Full SkillsFuture Singapore API support for course runs, grants, and claims
- Multi-Role System: Comprehensive role-based access for learners, trainers, admins, developers, and training providers
- Singapore-Ready: NRIC/FIN validation, UEN verification, WSQ/IBF course support
- Modern Stack: Next.js 14, TypeScript, Tailwind CSS, PostgreSQL
- Features
- Technology Stack
- Documentation
- Project Structure
- Database Schema
- Getting Started
- Environment Variables
- User Roles
- API Documentation
- SSG API Integration
- Deployment
- Course Management: Create, edit, and manage courses with learning units and subtopics
- Course Runs: Schedule multiple runs per course with trainer assignments
- Enrollment Management: Track learner enrollments, progress, and completions
- Assessment System: Create assessments, manage submissions, and grade learners
- Progress Tracking: Monitor learner progress through subtopic completions
- Certificate Generation: Issue certificates upon course completion
- AI Chatbot: Google Gemini-powered chatbot for learner assistance
- Quiz Generator: AI-generated quizzes based on course content
- Smart Recommendations: Personalized course suggestions
- SSG API Integration: Full integration with SkillsFuture Singapore APIs
- Course run management (view, add, edit, delete)
- Session management
- Enrolment synchronization
- Grant and claims tracking
- WSQ/IBF Course Support: Support for WSQ and IBF funded courses
- SkillsFuture Credit: PSEA, MCES, and UTAP eligibility tracking
- Singapore ID Validation: NRIC/FIN and UEN validation
- Multi-tenant Support: Multiple training providers on single platform
- Trainer Management: Manage trainer profiles, certifications, and assignments
- Financial Templates: Pro-forma, invoice, receipt, and certificate templates
- Automation Options: Auto-send emails, invoices, and certificates
- Calendar Integration: Google Calendar and Microsoft Calendar sync
- Multi-role Support: Learner, Trainer, Admin, Developer, Training Provider
- Profile Management: Comprehensive profile management per role
- File Uploads: CV, certificates, and profile picture uploads
| Category | Technology |
|---|---|
| Framework | Next.js 14 (TypeScript) |
| Frontend | React 18, Tailwind CSS |
| Database | PostgreSQL 17 (Supabase) |
| Authentication | JWT (jsonwebtoken) |
| AI Integration | Google Generative AI (Gemini) |
| File Uploads | Multer |
| Icons | Lucide React |
| Database Client | pg (node-postgres) |
Full documentation is available at https://alfredang.github.io/AI-LMS-TMS/
| Role | Guide |
|---|---|
| Learner | Learner User Guide |
| Trainer | Trainer User Guide |
| Developer | Developer User Guide |
| Admin | Admin User Guide |
| Training Provider | Training Provider Guide |
ai-lms-tms/
βββ components/ # React components
β βββ admin/ # Admin dashboard components
β β βββ ClassDetailView.tsx
β β βββ ClassManagementViews.tsx
β β βββ CompletedClasses.tsx
β β βββ CreateNewClassView.tsx
β β βββ EnrollLearners.tsx
β β βββ OngoingClasses.tsx
β β βββ ViewTrainers.tsx
β βββ ssg/ # SSG API integration components
β β βββ SSGCourses.tsx
β β βββ ViewCourseRun.tsx
β β βββ AddCourseRun.tsx
β β βββ EncryptionDecryption.tsx
β βββ ui/ # Reusable UI components
β βββ common/ # Shared components
β βββ AdminDashboard.tsx
β βββ AiChatbot.tsx # Gemini-powered chatbot
β βββ CalendarView.tsx
β βββ CourseDetail.tsx
β βββ CourseEditor.tsx
β βββ CourseList.tsx
β βββ GradingView.tsx
β βββ LoginScreen.tsx
β βββ ProfileView.tsx
β βββ QuizGenerator.tsx
β βββ TrainingProviderDashboard.tsx
β
βββ pages/ # Next.js pages & API routes
β βββ api/ # API endpoints
β β βββ admin/ # Admin operations
β β βββ ai/ # AI endpoints
β β βββ assessments/ # Assessment CRUD
β β βββ auth/ # Authentication
β β βββ courses/ # Course management
β β βββ enrollments/ # Enrollment operations
β β βββ grading/ # Grading system
β β βββ profile/ # User profiles
β β βββ ssg/ # SSG API proxies
β β βββ submissions/ # Assignment submissions
β β βββ upload/ # File uploads
β βββ _app.tsx
β βββ index.tsx # Main application page
β βββ profile.tsx
β
βββ lib/ # Core libraries
β βββ services/ # Business logic services
β β βββ authService.ts
β β βββ courseService.ts
β β βββ geminiService.ts # AI integration
β β βββ profileService.ts
β βββ ssg/ # SSG API utilities
β βββ config.ts # Environment configuration
β βββ db.ts # Database connection pool
β βββ urlHelpers.ts # URL construction helpers
β
βββ database/ # Database files
β βββ 01-schema.sql # Database schema
β βββ 02-data-clean-fixed.sql # Seed data
β βββ tertiarydb_supabase.sql # Full database dump
β
βββ contexts/ # React context providers
βββ hooks/ # Custom React hooks
βββ layouts/ # Page layouts
βββ types/ # TypeScript type definitions
βββ utils/ # Utility functions
βββ scripts/ # Migration & utility scripts
βββ styles/ # Global CSS styles
βββ public/ # Static assets
βββ uploads/ # User uploaded files
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β app_user ββββββΆβ user_role_map β β training_providerβ
β (Core User) β β (Roles) β β (Tenant) β
ββββββββββ¬βββββββββ βββββββββββββββββββ ββββββββββ¬βββββββββ
β β
ββββββ΄βββββ¬βββββββββββββ¬βββββββββββββ β
βΌ βΌ βΌ βΌ β
ββββββββββββββββββββββββββββββββββββββββββββββ β
βlearner ββtrainer ββ developer ββ admin β β
β_profileββ_profileββ _profile ββ _profile β β
βββββ¬ββββββββββ¬βββββββββββββββββββββββββββββββ β
β β β
β β βββββββββββββββββββ β
β βββββΆβ certification β β
β β work_experience β β
β βββββββββββββββββββ β
β β
βΌ β
βββββββββββββββββββ βββββββββββββββββββ β
β enrollment ββββββΆβ course_run ββββββββββββββ
β (UserβCourse) β β (Scheduled) β
ββββββββββ¬βββββββββ ββββββββββ¬βββββββββ
β β
β ββββββββββ΄βββββββββ
β βΌ βΌ
β βββββββββββββββ βββββββββββββββ
β β course β β assessment β
β β (Template) β β (Tests) β
β ββββββββ¬βββββββ ββββββββ¬βββββββ
β β β
β ββββββββ΄βββββββ β
β βΌ βΌ β
β ββββββββββββ ββββββββββββ β
β β learning β β subtopicβ β
β β _unit β β β β
β ββββββββββββ ββββββββββββ β
β β
βββββββββββββββββββββββββββββββββ
β
ββββββββ΄βββββββ
βΌ βΌ
βββββββββββββ βββββββββββββ
βsubmission β βassessment β
β (Files) β β _grade β
βββββββββββββ βββββββββββββ
| Table | Description |
|---|---|
app_user |
Core user accounts with email, password, and profile |
user_role_map |
Maps users to roles (Learner, Trainer, Admin, Developer, Training Provider) |
training_provider |
Training organization details, templates, and settings |
course |
Course templates with metadata, materials, and funding info |
course_run |
Scheduled instances of courses with dates and trainers |
enrollment |
Learner enrollments with progress and payment status |
assessment |
Course assessments (exams, projects, assignments) |
submission |
Learner assessment submissions |
learning_unit |
Course chapters/modules |
subtopic |
Individual learning topics within units |
| Table | Description |
|---|---|
learner_profile |
Learner demographics, employment, NRIC |
trainer_profile |
Trainer qualifications, expertise, certifications |
developer_profile |
Course developer information |
admin_profile |
Admin contact information |
| Table | Description |
|---|---|
ssg_enrolments |
SSG enrolment records synced from API |
ssg_grants |
Grant applications and approvals |
ssg_claims |
Funding claims and payment status |
- Node.js 18+
- PostgreSQL 17+ (or Supabase account)
- npm or yarn
-
Clone the repository
git clone https://github.com/alfredang/AI-LMS-TMS.git cd AI-LMS-TMS -
Install dependencies
npm install
-
Configure environment variables
cp .env.example .env.local # Edit .env.local with your configuration -
Set up the database
# Run schema migration npm run db:migrate # Seed initial data (optional) npm run db:seed
-
Start development server
npm run dev
The application will be available at
http://localhost:3000
Create a .env.local file with the following variables:
# Database Connection (Supabase Transaction Pooler recommended)
DATABASE_URL=postgresql://postgres.[project-ref]:[password]@aws-1-[region].pooler.supabase.com:6543/postgres
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=https://[project-ref].supabase.co
# Application URLs
NEXT_PUBLIC_BASE_URL=http://localhost:3000
BASE_URL=http://localhost:3000
# JWT Authentication
JWT_SECRET=your-secure-jwt-secret
# Google Gemini AI (for chatbot & quiz generation)
NEXT_PUBLIC_GOOGLE_GEMINI_API_KEY=your-gemini-api-key
# SSG API Integration
SSG_API_BASE_URL=https://api.ssg-wsg.sg
SSG_API_VERSION=v1
SSG_AUTH_TOKEN=your-ssg-bearer-token
SSG_ENCRYPTION_KEY=your-base64-aes-256-key
# File Uploads
MAX_FILE_SIZE=5MB
UPLOAD_DIR=./public/uploads| Role | Description | Key Permissions |
|---|---|---|
| Learner | Course participants | Enroll in courses, track progress, submit assessments |
| Trainer | Course instructors | View assigned classes, grade submissions, manage materials |
| Admin | System administrators | Manage users, courses, enrollments, and system settings |
| Developer | Course developers | Create and edit course content and assessments |
| Training Provider | Organization admins | Manage organization settings, trainers, and SSG integration |
POST /api/auth/login # User login
POST /api/auth/register # User registration
POST /api/auth/logout # User logout
GET /api/courses # List all courses
GET /api/courses/[id] # Get course details
POST /api/courses # Create course
PUT /api/courses/[id] # Update course
DELETE /api/courses/[id] # Delete course
GET /api/enrollments # List enrollments
POST /api/enrollments # Create enrollment
PUT /api/enrollments/[id] # Update enrollment
GET /api/assessments # List assessments
POST /api/assessments # Create assessment
POST /api/submissions # Submit assessment
PUT /api/grading/[id] # Grade submission
GET /api/profile # Get user profile
PUT /api/profile-update # Update profile
POST /api/upload/[type] # Upload files (CV, certificates, etc.)
GET /api/admin/users # List users
GET /api/admin/classes # List class runs
POST /api/admin/enroll # Enroll learners
PUT /api/admin/assign-trainer # Assign trainer to class
The application integrates with SkillsFuture Singapore APIs for:
- Course Runs: Create, view, edit, and delete course runs
- Sessions: Manage course session schedules
- Enrolments: Sync learner enrolments
- Grants & Claims: Track funding applications
For detailed SSG integration documentation, see SSG_API_INTEGRATION.md.
- Connect your GitHub repository to Vercel
- Configure environment variables in Vercel dashboard
- Deploy
# Build for production
npm run build
# Start production server
npm startFor detailed deployment instructions, see DEPLOYMENT.md.
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run type-check # Run TypeScript type checking
npm run db:migrate # Run database migrations
npm run db:seed # Seed database with initial data- 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 proprietary software developed by Tertiary Infotech Pte Ltd. All rights reserved.
For support and questions, please open an issue on GitHub.
- Next.js - The React Framework
- Supabase - Open Source Firebase Alternative
- Google Generative AI - AI/ML Platform
- Tailwind CSS - Utility-First CSS Framework
- SkillsFuture Singapore - National Skills Development
Developed by Tertiary Infotech Pte Ltd
Empowering Training Excellence in Singapore