An intelligent timetable generation system powered by Google Gemini 2.5 Flash AI model with comprehensive teacher absence management and automated scheduling capabilities.
- GenAI Timetable Generation: Leverages Google Gemini 2.5 Flash for intelligent scheduling
- JSON-Based Output: Structured timetable data in JSON format for easy processing
- Smart Conflict Resolution: AI-powered detection and resolution of scheduling conflicts
- Teacher Choice Integration: AI considers teacher preferences and availability
- Teacher Management: Complete teacher profile and availability tracking
- Class Management: Student class organization and scheduling
- Classroom Management: Room allocation with capacity and type considerations
- Subject Management: Subject assignments and requirements
- TimeTable Generation: Generate Timetable based on the data provide by the user
- Absence Management: Real-time teacher absence tracking and automatic rescheduling
- Multi-format Export: CSV and Excel file generation
- Screenshot Capture: Automatic screenshot generation of timetables
- Edge Case Handling: Comprehensive validation and error handling
- Audit Trail: Complete logging of all scheduling decisions
- HTML5: Modern semantic markup
- CSS3: Responsive styling with custom design
- JavaScript: Interactive UI and API integration
- Templates: Jinja2 templating for dynamic content
- Flask: Python web framework for API development
- Google Gemini 2.5 Flash: AI model for intelligent scheduling
- Python: Core business logic and data processing
- MySQL: Primary relational database for structured data
- MongoDB: Document storage for flexible data and AI responses
- Dual Database Strategy: Optimized for both structured and unstructured data
gen-ai-env/ # Python virtual environment
│
├── Include/ # Header files for the interpreter
├── Lib/ # Installed Python libraries
├── Scripts/ # Executable scripts
├── share/ # Shared environment files
├── pyvenv.cfg # Environment configuration
│
├Website/ # Main web application
│
├── __pycache__/ # Compiled Python bytecode
├── static/ # Static assets
│ ├── icon.jpg # Application icon
│ ├── image.png # UI images
│ ├── script.js # Client-side JavaScript
│ └── style.css # Application styling
│
├── templates/ # HTML templates
│ ├── dashboard.html # Main dashboard interface
│ ├── Sign-in.html # User authentication
│ └── Sign-up.html # User registration
│
├── .env # Environment variables
├── app.py # Main Flask application
├── Final_test.py # Testing and validation script
└── [Additional files] # Testing and correction modules
- Python 3.8+
- MySQL 8.0+
- MongoDB 4.4+
- Google Gemini API access
-
Clone the repository
git clone https://github.com/Manavdarji2/Timetable-Genius.github.io.git cd genai-timetable-system -
Create and activate virtual environment
python -m venv gen-ai-env # Windows gen-ai-env\Scripts\activate # macOS/Linux source gen-ai-env/bin/activate
-
Install dependencies
pip install flask pip install google-generativeai pip install mysql-connector-python pip install pymongo pip install pandas pip install python-dotenv
-
Database setup: MySQL Quick Setup
# MySQL setup mysql -u root -p CREATE DATABASE time_genius_project; # MongoDB setup (ensure MongoDB is running) mongosh use timetablegenius
-
Environment configuration
# Create .env file in Website directory cp .env.example .env # Add your configuration GEMINI_API_KEY=your_gemini_api_key MYSQL_HOST=localhost MYSQL_USER=root MYSQL_PASSWORD=your_password MYSQL_DATABASE=timetable_genius_proeject MONGODB_URI=mongodb://localhost:27017/timetablegenius
-
Run the application
python website/app.py
- Sign Up: Create an admin account using Sign-up.html
- Sign In: Login to access the dashboard
- Configure System: Set up school timings and preferences
- Teacher Management: Add teachers with availability and preferences
- Class Setup: Create student classes with enrollment details
- Classroom Configuration: Set up rooms with capacity and equipment
- Subject Assignment: Define subjects and their requirements
- Generate Timetable: Click generate to invoke Gemini AI
- AI Processing: System uses Gemini 2.5 Flash to create optimal schedule
- JSON Output: Review the structured timetable data
- Export Options: Download as CSV or Excel
- Screenshot Capture: Automatic visual documentation
- Report Absence: Teachers can report unavailability
- Automatic Rescheduling: AI automatically adjusts schedules
- Conflict Resolution: Smart handling of scheduling conflicts
- Notification System: Stakeholders receive updates
POST /api/auth/signin
POST /api/auth/signup
POST /api/auth/logout
GET/POST/PUT/DELETE /api/teachers
GET/POST/PUT/DELETE /api/classes
GET/POST/PUT/DELETE /api/classrooms
GET/POST/PUT/DELETE /api/subjects
POST /api/timetable/generate # Generate using Gemini AI
GET /api/timetable/json/:id # Get JSON format timetable
POST /api/timetable/export # Export to CSV/Excel
POST /api/timetable/screenshot # Generate screenshot
POST /api/absence/report
GET /api/absence/list
POST /api/absence/resolve
The system leverages Google Gemini 2.5 Flash for:
- Intelligent Scheduling: AI considers multiple constraints simultaneously
- Conflict Resolution: Automatic detection and resolution of scheduling conflicts
- Optimization: Resource allocation optimization for maximum efficiency
- Preference Learning: AI learns from user preferences and past decisions
- Natural Language Processing: Understanding of complex scheduling requirements
AI Prompt Structure: This is the basic structure of Prompt eng for more click here
prompt = f"""
Generate an optimal timetable for:
- Teachers: {teacher_data}
- Classes: {class_data}
- Subjects: {subject_data}
- Constraints: {constraints}
- Preferences: {preferences}
Return JSON format with complete schedule and conflict resolution.
"""MySQL (Structured Data): Rest structer Here
- users: User authentication and profiles
- teachers: Teacher information and availability
- classes: Student class organization
- classrooms: Physical space management
- subjects: Subject definitions and requirements
- timetables: Generated schedule data
- ai_responses: Gemini AI responses and decisions
- generation_logs: AI generation history
- optimization_data: Performance metrics
- user_preferences: Learning data for AI improvement
The system includes comprehensive testing:
# Run This command for AI to get Ans is correct
python Final_test.py- Teacher Unavailability: Multiple teachers absent simultaneously
- Room Conflicts: Overlapping room bookings
- Subject Constraints: Theory/practical requirements
- Time Limitations: Insufficient slots for all subjects
- Equipment Requirements: Specialized classroom needs
- Student Conflicts: Class scheduling overlaps
- Caching: Redis integration for frequently accessed data
- Database Indexing: Optimized queries for large datasets
- AI Response Caching: Cached Gemini responses for similar requests
- Async Processing: Non-blocking operations for large timetables
- Load Balancing: Distributed processing for multiple schools
- API Key Protection: Secure Gemini API key management
- Input Validation: Comprehensive data validation
- SQL Injection Prevention: Parameterized queries
- Authentication: Secure user authentication system
- Rate Limiting: API request throttling
python app.py
# Access at http://localhost:5000# Using Gunicorn
gunicorn --bind 0.0.0.0:5000 app:app
# Using Docker
docker build -t genai-timetable .
docker run -p 5000:5000 genai-timetable- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to 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.
For support and questions:
- Issues: GitHub Issues
- Documentation: Wiki section
- Email: support@yourdomain.com
- Google Gemini: For providing the AI capabilities
- Flask Community: For the excellent web framework
- Open Source Contributors: For the amazing libraries used
⭐ Star this repository if you find it helpful!
An intelligent timetable generation system powered by Google Gemini 2.5 Flash AI model with comprehensive teacher absence management and automated scheduling capabilities.
- GenAI Timetable Generation: Leverages Google Gemini 2.5 Flash for intelligent scheduling
- JSON-Based Output: Structured timetable data in JSON format for easy processing
- Smart Conflict Resolution: AI-powered detection and resolution of scheduling conflicts
- Teacher Choice Integration: AI considers teacher preferences and availability
- Teacher Management: Complete teacher profile and availability tracking
- Class Management: Student class organization and scheduling
- Classroom Management: Room allocation with capacity and type considerations
- Subject Management: Subject assignments and requirements
- TimeTable Generation: Generate Timetable based on the data provide by the user
- Absence Management: Real-time teacher absence tracking and automatic rescheduling
- Multi-format Export: CSV and Excel file generation
- Screenshot Capture: Automatic screenshot generation of timetables
- Edge Case Handling: Comprehensive validation and error handling
- Audit Trail: Complete logging of all scheduling decisions
- HTML5: Modern semantic markup
- CSS3: Responsive styling with custom design
- JavaScript: Interactive UI and API integration
- Templates: Jinja2 templating for dynamic content
- Flask: Python web framework for API development
- Google Gemini 2.5 Flash: AI model for intelligent scheduling
- Python: Core business logic and data processing
- MySQL: Primary relational database for structured data
- MongoDB: Document storage for flexible data and AI responses
- Dual Database Strategy: Optimized for both structured and unstructured data
gen-ai-env/ # Python virtual environment
│
├── Include/ # Header files for the interpreter
├── Lib/ # Installed Python libraries
├── Scripts/ # Executable scripts
├── share/ # Shared environment files
├── pyvenv.cfg # Environment configuration
│
├Website/ # Main web application
│
├── __pycache__/ # Compiled Python bytecode
├── static/ # Static assets
│ ├── icon.jpg # Application icon
│ ├── image.png # UI images
│ ├── script.js # Client-side JavaScript
│ └── style.css # Application styling
│
├── templates/ # HTML templates
│ ├── dashboard.html # Main dashboard interface
│ ├── Sign-in.html # User authentication
│ └── Sign-up.html # User registration
│
├── .env # Environment variables
├── app.py # Main Flask application
├── Final_test.py # Testing and validation script
└── [Additional files] # Testing and correction modules
- Python 3.8+
- MySQL 8.0+
- MongoDB 4.4+
- Google Gemini API access
-
Clone the repository
git clone https://github.com/Manavdarji2/Timetable-Genius.github.io.git cd genai-timetable-system -
Create and activate virtual environment
python -m venv gen-ai-env # Windows gen-ai-env\Scripts\activate # macOS/Linux source gen-ai-env/bin/activate
-
Install dependencies
pip install flask pip install google-generativeai pip install mysql-connector-python pip install pymongo pip install pandas pip install python-dotenv
-
Database setup: MySQL Quick Setup
# MySQL setup mysql -u root -p CREATE DATABASE time_genius_project; # MongoDB setup (ensure MongoDB is running) mongosh use timetablegenius
-
Environment configuration
# Create .env file in Website directory cp .env.example .env # Add your configuration GEMINI_API_KEY=your_gemini_api_key MYSQL_HOST=localhost MYSQL_USER=root MYSQL_PASSWORD=your_password MYSQL_DATABASE=timetable_genius_proeject MONGODB_URI=mongodb://localhost:27017/timetablegenius
-
Run the application
python website/app.py
- Sign Up: Create an admin account using Sign-up.html
- Sign In: Login to access the dashboard
- Configure System: Set up school timings and preferences
- Teacher Management: Add teachers with availability and preferences
- Class Setup: Create student classes with enrollment details
- Classroom Configuration: Set up rooms with capacity and equipment
- Subject Assignment: Define subjects and their requirements
- Generate Timetable: Click generate to invoke Gemini AI
- AI Processing: System uses Gemini 2.5 Flash to create optimal schedule
- JSON Output: Review the structured timetable data
- Export Options: Download as CSV or Excel
- Screenshot Capture: Automatic visual documentation
- Report Absence: Teachers can report unavailability
- Automatic Rescheduling: AI automatically adjusts schedules
- Conflict Resolution: Smart handling of scheduling conflicts
- Notification System: Stakeholders receive updates
POST /api/auth/signin
POST /api/auth/signup
POST /api/auth/logout
GET/POST/PUT/DELETE /api/teachers
GET/POST/PUT/DELETE /api/classes
GET/POST/PUT/DELETE /api/classrooms
GET/POST/PUT/DELETE /api/subjects
POST /api/timetable/generate # Generate using Gemini AI
GET /api/timetable/json/:id # Get JSON format timetable
POST /api/timetable/export # Export to CSV/Excel
POST /api/timetable/screenshot # Generate screenshot
POST /api/absence/report
GET /api/absence/list
POST /api/absence/resolve
The system leverages Google Gemini 2.5 Flash for:
- Intelligent Scheduling: AI considers multiple constraints simultaneously
- Conflict Resolution: Automatic detection and resolution of scheduling conflicts
- Optimization: Resource allocation optimization for maximum efficiency
- Preference Learning: AI learns from user preferences and past decisions
- Natural Language Processing: Understanding of complex scheduling requirements
AI Prompt Structure: This is the basic structure of Prompt eng for more click here
prompt = f"""
Generate an optimal timetable for:
- Teachers: {teacher_data}
- Classes: {class_data}
- Subjects: {subject_data}
- Constraints: {constraints}
- Preferences: {preferences}
Return JSON format with complete schedule and conflict resolution.
"""MySQL (Structured Data): Rest structer Here
- users: User authentication and profiles
- teachers: Teacher information and availability
- classes: Student class organization
- classrooms: Physical space management
- subjects: Subject definitions and requirements
- timetables: Generated schedule data
- ai_responses: Gemini AI responses and decisions
- generation_logs: AI generation history
- optimization_data: Performance metrics
- user_preferences: Learning data for AI improvement
The system includes comprehensive testing:
# Run This command for AI to get Ans is correct
python Final_test.py- Teacher Unavailability: Multiple teachers absent simultaneously
- Room Conflicts: Overlapping room bookings
- Subject Constraints: Theory/practical requirements
- Time Limitations: Insufficient slots for all subjects
- Equipment Requirements: Specialized classroom needs
- Student Conflicts: Class scheduling overlaps
- Caching: Redis integration for frequently accessed data
- Database Indexing: Optimized queries for large datasets
- AI Response Caching: Cached Gemini responses for similar requests
- Async Processing: Non-blocking operations for large timetables
- Load Balancing: Distributed processing for multiple schools
- API Key Protection: Secure Gemini API key management
- Input Validation: Comprehensive data validation
- SQL Injection Prevention: Parameterized queries
- Authentication: Secure user authentication system
- Rate Limiting: API request throttling
python app.py
# Access at http://localhost:5000# Using Gunicorn
gunicorn --bind 0.0.0.0:5000 app:app
# Using Docker
docker build -t genai-timetable .
docker run -p 5000:5000 genai-timetable- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to 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.
For support and questions:
- Issues: GitHub Issues
- Documentation: Wiki section
- Email: support@yourdomain.com
- Google Gemini: For providing the AI capabilities
- Flask Community: For the excellent web framework
- Open Source Contributors: For the amazing libraries used
⭐ Star this repository if you find it helpful!