A Revolutionary AI-Powered Timetable Scheduling Platform for Educational Institutions
Features β’ Demo β’ Installation β’ Documentation β’ Tech Stack
AlmanacAI is a sophisticated full-stack timetable generation system that leverages Genetic Algorithms and advanced optimization techniques to automatically create conflict-free, optimal class schedules for educational institutions. Built with modern web technologies, it provides real-time generation tracking, intelligent conflict resolution, and comprehensive analytics.
This project implements a sophisticated timetable generation system using genetic algorithms and other optimization techniques. It provides a comprehensive solution for educational institutions to automatically generate optimal class schedules while considering multiple constraints and preferences.
- 𧬠Advanced Genetic Algorithm: Evolutionary optimization for superior timetable quality
- π€ AI-Powered Assistant: Gemini AI chatbot for instant query resolution
- οΏ½ Real-time Analytics: Comprehensive dashboards for admins, faculty, and students
- π Live Progress Tracking: Watch the generation process in real-time with WebSocket updates
- π§ Automated Notifications: Email system for timetable updates and announcements
- π± Responsive Design: Modern UI built with React and Tailwind CSS
- π Production Ready: Deployed on Vercel (frontend) and Render (backend)
- Advanced Genetic Algorithm: Sophisticated evolutionary algorithm for optimal timetable generation
- Multiple Algorithm Support: Genetic Algorithm, Backtracking, and Simulated Annealing
- Real-time Progress Tracking: Live updates during generation with WebSocket connections
- Batch Processing: Handle 100+ teachers, 200+ classrooms, 500+ courses simultaneously
- Smart Conflict Detection: Intelligent detection and automatic resolution of scheduling conflicts
- Data Validation: Comprehensive validation of input data before generation
- Export Capabilities: Export timetables in PDF, Excel, and CSV formats
- Role-Based Access Control: Separate dashboards for Admin, Faculty, and Students
- Secure Authentication: JWT-based authentication with bcrypt password hashing
- CSV Bulk Import: Import teachers and students via CSV files
- Profile Management: Update availability, preferences, and contact information
- Gemini AI Chatbot: Intelligent assistant for answering queries about timetables
- Query Resolution System: Students and faculty can ask questions and get instant answers
- Natural Language Processing: Understand and respond to complex scheduling queries
- Context-Aware Responses: AI understands user role and provides relevant information
- Resource Utilization: Track classroom and teacher usage statistics
- Workload Analysis: Monitor teacher workload distribution
- Conflict Reports: Detailed reports on scheduling conflicts and resolutions
- Performance Metrics: Generation time, success rates, and optimization scores
- Email Notifications: Automated emails for timetable updates
- SMTP Integration: Configurable email service (Gmail, Outlook, custom SMTP)
- Bulk Messaging: Send announcements to all users or specific roles
- Query Notifications: Alert users when their queries are answered
-
Teacher conflicts (no teacher in multiple classes simultaneously)
-
Classroom conflicts (no room double-booking)
-
Student group conflicts (no overlapping classes for same group)
-
Room capacity limits
-
Mandatory break enforcement
-
Soft Constraints (Optimized but not mandatory):
- Teacher availability preferences
- Workload balance among teachers
- Consecutive hours limits
- Room type matching
- Day distribution optimization
Frontend: https://timetable-frontend-psi.vercel.app
Backend API: https://timetable-backend-2h6m.onrender.com/api/health
- Admin:
admin@example.com/admin123 - Faculty:
faculty@example.com/faculty123 - Student:
student@example.com/student123
| Technology | Purpose |
|---|---|
| React 18 | UI framework with modern hooks and state management |
| Vite | Lightning-fast build tool and dev server |
| Tailwind CSS | Utility-first CSS framework for responsive design |
| Material-UI (MUI) | Pre-built React components for enterprise UI |
| React Router v6 | Client-side routing and navigation |
| Axios | Promise-based HTTP client for API calls |
| Lucide React | Beautiful icon library |
| Recharts | Charting library for analytics visualization |
| Three.js + OGL | 3D graphics for interactive landing page |
| Technology | Purpose |
|---|---|
| Node.js | JavaScript runtime for server-side logic |
| Express.js | Web framework for RESTful API |
| MongoDB | NoSQL database for flexible data storage |
| Mongoose | ODM for MongoDB with schema validation |
| Socket.io | WebSocket for real-time progress updates |
| JWT | JSON Web Tokens for secure authentication |
| Bcrypt | Password hashing and security |
| Nodemailer | Email service for notifications |
| Google Gemini AI | AI chatbot integration for query resolution |
| Winston | Logging framework for debugging |
| Helmet | Security middleware for Express |
| Tool | Purpose |
|---|---|
| Vercel | Frontend hosting with automatic deployments |
| Render | Backend hosting with health checks |
| MongoDB Atlas | Cloud-hosted MongoDB database |
| GitHub | Version control and CI/CD trigger |
| Git | Source code management |
Time_Table_Generation_AI_Tool/
β
βββ π client/ # React Frontend
β βββ π public/ # Static assets
β β βββ logo.png
β βββ π src/
β β βββ π components/ # Reusable UI components
β β β βββ AdminDashboard.jsx # Admin control panel
β β β βββ StudentDashboard.jsx # Student interface
β β β βββ TeacherDashboard.jsx # Faculty interface
β β β βββ Auth.jsx # Login/Register forms
β β β βββ ChatbotInterface.jsx # AI chatbot UI
β β β βββ Landing.jsx # Landing page with 3D graphics
β β β βββ Navbar.jsx # Navigation bar
β β β βββ Sidebar.jsx # Dashboard sidebar
β β βββ π services/ # API integration
β β β βββ api.js # Axios instance & API calls
β β βββ π assets/ # Images, fonts, etc.
β β βββ App.jsx # Main app component with routing
β β βββ index.jsx # React entry point
β β βββ index.css # Global styles
β βββ .env.example # Environment variables template
β βββ vercel.json # Vercel deployment config
β βββ package.json # Dependencies & scripts
β βββ vite.config.js # Vite configuration
β βββ tailwind.config.js # Tailwind CSS config
β βββ postcss.config.js # PostCSS config
β
βββ π server/ # Node.js Backend
β βββ π routes/ # API endpoints
β β βββ auth.js # Authentication routes
β β βββ data.js # CRUD for teachers, rooms, courses
β β βββ timetables.js # Timetable generation & management
β β βββ algorithms.js # Algorithm selection endpoints
β β βββ queries.js # Query resolution system
β β βββ chatbot.js # AI chatbot endpoints
β βββ π models/ # Mongoose schemas
β β βββ User.js # User model (admin, faculty, student)
β β βββ Teacher.js # Teacher details & availability
β β βββ Classroom.js # Classroom/room information
β β βββ Course.js # Course/subject details
β β βββ Timetable.js # Generated timetables
β β βββ Query.js # User queries
β β βββ Student.js # Student information
β βββ π algorithms/ # Optimization algorithms
β β βββ genetic.js # Genetic Algorithm implementation
β β βββ backtracking.js # Backtracking algorithm
β β βββ simulated_annealing.js # Simulated Annealing
β βββ π middleware/ # Express middleware
β β βββ auth.js # JWT verification
β β βββ errorHandler.js # Global error handling
β βββ π utils/ # Utility functions
β β βββ emailService.js # Email sending logic
β β βββ validator.js # Data validation helpers
β β βββ logger.js # Winston logger config
β βββ π scripts/ # Utility scripts
β β βββ create_admin.js # Create admin user
β β βββ setup_mailing.js # Configure email service
β β βββ populate_test_data.js # Seed database
β βββ .env.example # Environment variables template
β βββ server.js # Express server entry point
β βββ package.json # Dependencies & scripts
β βββ README.md # Backend documentation
β
βββ π DEPLOYMENT.md # Deployment guide
βββ π GEMINI_AI_INTEGRATION.md # AI chatbot setup
βββ π MAILING_SYSTEM_GUIDE.md # Email system docs
βββ π QUERY_RESOLUTION_SYSTEM.md # Query system docs
βββ π STUDENT_MANAGEMENT_GUIDE.md # Student module docs
βββ π README.md # This file
βββ π vercel.json # Root Vercel config
βββ π .gitignore # Git ignore rules
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher) - Download
- MongoDB (v6 or higher) - Download OR use MongoDB Atlas
- npm or yarn - Comes with Node.js
- Git - Download
git clone https://github.com/Harjotraith04/Time_Table_Generation_AI_Tool.git
cd Time_Table_Generation_AI_Tool# Navigate to server directory
cd server
# Install dependencies
npm install
# Create environment file
cp .env.example .env
# Edit .env with your configuration
# Required variables:
# - MONGODB_URI (MongoDB connection string)
# - JWT_SECRET (Random secret key)
# - GEMINI_API_KEY (Google Gemini AI key)
# - SMTP credentials (for email service)Sample .env file:
# Database
MONGODB_URI=mongodb://localhost:27017/timetable_generator
# OR for MongoDB Atlas:
# MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/timetable_generator
# Server
PORT=8000
NODE_ENV=development
# Authentication
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
# Client URL (for CORS)
CLIENT_URL=http://localhost:5173
# Google Gemini AI
GEMINI_API_KEY=your-gemini-api-key-here
# Email Service
EMAIL_ENABLED=true
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-specific-password
EMAIL_FROM=AlmanacAI <noreply@almanacai.com># Create admin user (optional)
npm run create-admin
# Start development server
npm run devServer will run on http://localhost:8000
# Navigate to client directory (from root)
cd client
# Install dependencies
npm install
# Create environment file
cp .env.example .env.local
# Edit .env.local
# VITE_API_URL=http://localhost:8000/apiSample .env.local file:
# Backend API URL
VITE_API_URL=http://localhost:8000/api# Start development server
npm run devFrontend will run on http://localhost:5173
Open your browser and navigate to:
- Frontend: http://localhost:5173
- Backend API: http://localhost:8000/api/health
- Push code to GitHub
- Import project in Vercel Dashboard
- Configure settings:
- Root Directory:
client - Build Command:
npm run build - Output Directory:
dist
- Root Directory:
- Add environment variable:
VITE_API_URL=https://your-backend-url.onrender.com/api
- Deploy - Vercel will auto-deploy on git push
- Create Web Service in Render Dashboard
- Connect GitHub repository
- Configure settings:
- Root Directory:
server - Build Command:
npm install - Start Command:
npm run start
- Root Directory:
- Add environment variables (all from
.env.example) - Deploy - Render will auto-deploy on git push
π Full deployment guide: DEPLOYMENT.md
- π Quick Start Guide - Get started in 5 minutes
- π Environment Setup - Detailed environment configuration
- ποΈ MongoDB Setup - Database setup and seeding
- π€ Gemini AI Integration - Set up AI chatbot
- π§ Mailing System - Configure email notifications
- β Query Resolution System - How the query system works
- π₯ Student Management - Manage students and CSV imports
- π Analytics Dashboard - Admin dashboard features
- 𧬠Algorithm Implementation - Understanding the genetic algorithm
- π Algorithm Test Results - Performance benchmarks
- π§ API Documentation - API endpoints and usage
- π Troubleshooting - Common issues and solutions
The genetic algorithm is the core of this timetable generation system. It uses evolutionary principles to find optimal solutions.
1. Initialize Population (100+ random timetables)
β
2. Evaluate Fitness (check constraints & conflicts)
β
3. Selection (tournament selection)
β
4. Crossover (combine parent solutions)
β
5. Mutation (random changes for diversity)
β
6. Elitism (preserve best solutions)
β
7. Repeat until convergence or max generations
| Parameter | Value | Description |
|---|---|---|
| Population Size | 100-200 | Number of candidate solutions |
| Generations | 500-1000 | Maximum iterations |
| Crossover Rate | 0.8 (80%) | Probability of combining parents |
| Mutation Rate | 0.1 (10%) | Probability of random changes |
| Elite Size | 10% | Best solutions preserved |
| Tournament Size | 5 | Selection pool size |
- β Handles: 100+ teachers, 200+ classrooms, 500+ courses
- β‘ Generation Time: 2-5 minutes for complex timetables
- π― Constraint Satisfaction: 95%+ hard constraints met
- π Optimization: Maximizes resource utilization and teacher preferences
Fitness = (Hard Constraint Score Γ 10) + (Soft Constraint Score Γ 1)
Hard Constraints (0 or 1):
- No teacher conflicts
- No classroom conflicts
- No student group conflicts
- Room capacity respected
- Break enforcement
Soft Constraints (0 to 1):
- Teacher availability preferences
- Workload balance
- Consecutive hours limits
- Room type matching
- Day distribution- Login with admin credentials
- Add Data:
- Upload teachers via CSV or add manually
- Add classrooms with capacity and type
- Create courses with duration and requirements
- Generate Timetable:
- Select algorithm (Genetic recommended)
- Set parameters (optional)
- Click "Generate"
- Watch real-time progress
- Review & Export:
- Check for conflicts
- Review analytics
- Export to PDF/Excel/CSV
- Manage Users:
- Add/edit students and faculty
- Assign roles and permissions
- Monitor system usage
- Login with faculty credentials
- View Schedule: See your teaching timetable
- Update Availability: Set preferred working hours
- Ask Questions: Use AI chatbot for queries
- Download: Export your personal timetable
- Login with student credentials
- View Timetable: See your class schedule
- Download: Export to PDF or add to calendar
- Ask Questions: Query the AI about class timings
- Check Conflicts: Verify no scheduling issues
POST /api/auth/register # Register new user
POST /api/auth/login # Login user
POST /api/auth/logout # Logout user
GET /api/auth/me # Get current user
POST /api/timetables/generate # Generate new timetable
GET /api/timetables # Get all timetables
GET /api/timetables/:id # Get specific timetable
PUT /api/timetables/:id # Update timetable
DELETE /api/timetables/:id # Delete timetable
GET /api/timetables/:id/conflicts # Check conflicts
POST /api/timetables/:id/export # Export timetable
GET /api/timetables/:id/progress # Get generation progress (WebSocket)
GET /api/teachers # Get all teachers
POST /api/teachers # Create teacher
PUT /api/teachers/:id # Update teacher
DELETE /api/teachers/:id # Delete teacher
POST /api/teachers/import # Import teachers from CSV
GET /api/classrooms # Get all classrooms
POST /api/classrooms # Create classroom
PUT /api/classrooms/:id # Update classroom
DELETE /api/classrooms/:id # Delete classroom
GET /api/courses # Get all courses
POST /api/courses # Create course
PUT /api/courses/:id # Update course
DELETE /api/courses/:id # Delete course
GET /api/students # Get all students
POST /api/students # Create student
POST /api/students/import # Import students from CSV
POST /api/queries # Submit new query
GET /api/queries # Get user's queries
POST /api/chatbot/message # Send message to AI chatbot
GET /api/chatbot/history # Get chat history
GET /api/analytics/dashboard # Dashboard summary
GET /api/analytics/utilization # Resource utilization
GET /api/analytics/conflicts # Conflict statistics
GET /api/analytics/teacher-workload # Teacher workload distribution
# .env.local in client/
VITE_API_URL=http://localhost:8000/api# .env in server/
# Database
MONGODB_URI=mongodb://localhost:27017/timetable_generator
# Server
PORT=8000
NODE_ENV=development
# JWT
JWT_SECRET=your-secret-key-here
JWT_EXPIRE=7d
# CORS
CLIENT_URL=http://localhost:5173
# Google Gemini AI
GEMINI_API_KEY=your-api-key-here
# Email (Gmail example)
EMAIL_ENABLED=true
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_SECURE=false
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-password
EMAIL_FROM=AlmanacAI <noreply@almanacai.com>
# Algorithm Parameters (optional)
GA_POPULATION_SIZE=100
GA_MAX_GENERATIONS=1000
GA_CROSSOVER_RATE=0.8
GA_MUTATION_RATE=0.1cd server
npm testcd client
npm test- Health Check: Visit
http://localhost:8000/api/health - API Testing: Use Postman or cURL
- Frontend: Navigate through all pages
- Generation: Create test data and generate timetable
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a branch:
git checkout -b feature/amazing-feature - Make changes and test thoroughly
- Commit:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing-feature - Open a Pull Request
- Follow existing code style
- Write clear commit messages
- Add tests for new features
- Update documentation
- Keep PRs focused on single features
This project is licensed under the MIT License - see the LICENSE file for details.
- Harjot Singh - GitHub
- Google Gemini AI for chatbot capabilities
- MongoDB for flexible data storage
- Vercel & Render for seamless deployment
- React & Vite teams for excellent developer experience
- Open source community for amazing libraries
For support, questions, or feedback:
- π§ Email: support@almanacai.com
- π Issues: GitHub Issues
- π Docs: Check the documentation files in the repository
- π¬ Discussions: GitHub Discussions