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