A comprehensive web-based class scheduling system built with Flask, Bootstrap 5, and SQLite. This system helps educational institutions manage class schedules, detect conflicts, and streamline academic planning.
- Section Assignment Tool - Assign subjects, teachers, and rooms to class sections
- Teacher Schedule Mapping - View and manage teacher schedules across time blocks
- Conflict Checker - Automatically detect scheduling conflicts (teacher/room/time overlaps)
- Exam Timetable Generator - Create and manage examination schedules
- Substitute Assignment Tracker - Track substitute teachers for absences
- Special Class Scheduler - Schedule one-time events and special classes
- Room Availability Checker - Check real-time room availability
- Schedule Cloner - Clone schedules from previous semesters
- Time Block Customizer - Create custom time periods
- Calendar Integration - Export schedules (dummy implementation - extend with Google Calendar API)
- Backend: Flask (Python)
- Frontend: HTML5, CSS3, JavaScript (ES6+)
- Styling: Tailwind CSS 3.4+ (Utility-first CSS framework)
- Database: SQLite with SQLAlchemy ORM
- Icons: Bootstrap Icons
- Utilities:
- Toast notifications (non-blocking user feedback)
- Modal dialogs (confirm actions, custom content)
class_scheduling_system/
├── app.py # Flask application entry point
├── database/
│ └── models.py # SQLAlchemy database models
├── modules/ # Feature modules (blueprints)
│ ├── section_assignment.py
│ ├── teacher_schedule.py
│ ├── conflict_checker.py
│ ├── exam_timetable.py
│ ├── substitute_assignment.py
│ ├── special_class_scheduler.py
│ ├── room_checker.py
│ ├── schedule_cloner.py
│ ├── time_block_customizer.py
│ └── calendar_integration.py
├── templates/ # Jinja2 HTML templates
│ ├── base.html
│ ├── index.html
│ ├── dashboard.html
│ ├── setup.html
│ ├── section/
│ ├── conflict/
│ └── ...
├── static/
│ ├── css/
│ │ └── style.css # Custom styles
│ └── js/
│ ├── main.js # Common JavaScript utilities
│ ├── toast.js # Toast notification system
│ ├── modal.js # Modal dialog system
│ └── section_assignment.js # Module-specific JS
└── README.md
- Python 3.8 or higher
- pip (Python package manager)
pip install flask flask-sqlalchemypython app.pyThis will:
- Create the SQLite database (
class_scheduling.db) - Initialize all tables
- Optionally seed sample data (uncomment the seed function in app.py)
python app.pyThe application will start on http://localhost:5000
- Navigate to Setup Page: Go to
/setupor click "Initial Setup" from the homepage - Create Time Blocks: Define your class periods (e.g., Period 1: 8:00-9:00)
- Use the bulk create feature to generate time blocks for multiple days
- Add Rooms: Register all available classrooms and facilities
- Register Teachers: Add teacher information (name, email, department)
- Add Subjects: Create subject entries with codes and credits
- Create Sections: Define class sections (e.g., Grade 10 - Section A)
- Go to Sections → Select a section → Click Assign Subjects
- Fill in the assignment form:
- Select Subject
- Choose Teacher
- Pick Room
- Select Time Block (Day + Period)
- Click Assign Schedule
- The system automatically checks for conflicts before saving
- Navigate to Tools → Conflict Checker
- Click Scan for Conflicts to detect:
- Teacher double-booking
- Room double-booking
- Section overlaps
- View conflict details and mark as resolved
- Teacher Schedule: View individual teacher's weekly schedule
- Room Availability: Check which rooms are free at specific times
- Exam Timetable: Generate exam schedules automatically
- Schedule Cloning: Copy schedules from previous semesters
- Special Classes: Schedule one-time events or workshops
✅ Implemented:
- Modular design with Flask blueprints
- Maximum 300 lines per file
- Separation of concerns (models, views, templates)
- Reusable base template with Jinja inheritance
- External CSS and JavaScript files
- Comprehensive comments and docstrings
- RESTful API endpoints
❌ Avoided:
- Inline CSS or JavaScript
- Monolithic files
- Code duplication
- Hard-coded values
- Teacher: Instructor information
- Room: Classroom/facility details
- Subject: Course information
- Section: Class section details
- TimeBlock: Time period definitions
- Schedule: Main scheduling entity (links all above)
- ExamSchedule: Examination timetable
- SubstituteAssignment: Substitute teacher tracking
- SpecialClass: Special events and classes
- ConflictLog: Conflict detection history
GET /section/list- List all sectionsPOST /section/create- Create new sectionPOST /section/assign-schedule- Assign scheduleGET /section/api/sections- Get sections as JSON
GET /conflict/check- View conflictsPOST /conflict/scan- Scan for conflictsPOST /conflict/resolve/<id>- Resolve conflict
GET /room/list- List roomsGET /room/check- Check availabilityPOST /room/api/availability- API availability check
(See module files for complete API documentation)
Navigate to Time Block Customizer and use the bulk create feature:
- Set start time (e.g., 08:00)
- Number of periods
- Duration per period
- Select days
To add new features:
- Create a new module in
/modules/ - Define Flask blueprint
- Register blueprint in
app.py - Create corresponding templates in
/templates/ - Add JavaScript if needed in
/static/js/
The system uses Tailwind CSS 3.4+ for styling with utility-first approach. Bootstrap Icons are used for iconography.
Centralized JavaScript Utilities:
-
Toast Notifications (
static/js/toast.js)- Non-blocking success/error/warning/info messages
- Floating toasts in top-right corner
- Auto-dismiss with manual close option
- See
TOAST_UTILITY_GUIDE.mdfor documentation (if available)
-
Modal Dialogs (
static/js/modal.js)- Confirm dialogs with customizable buttons
- Custom content modals
- Promise-based async/await API
- Keyboard accessible (Escape, Enter, Tab)
- See
MODAL_UTILITY_GUIDE.mdfor complete documentation
Usage Examples:
// Toast notification
showToast('Success', 'Item saved successfully', 'success');
// Confirm dialog
const confirmed = await modalManager.confirm(
'Delete this item?',
'This action cannot be undone.',
{
confirmText: 'Delete',
confirmVariant: 'danger',
icon: 'trash'
}
);
if (confirmed) {
// Perform deletion
}The calendar integration module provides dummy functions. To enable real Google Calendar sync:
- Set up Google Calendar API credentials
- Install
google-api-python-client - Implement OAuth2 authentication
- Update
/modules/calendar_integration.pywith actual API calls
# Delete database and reinitialize
Remove-Item class_scheduling.db
python app.py# Change port in app.py
app.run(debug=True, host='0.0.0.0', port=5001)# Ensure Flask is installed
pip install --upgrade flask flask-sqlalchemy- User authentication and role-based access
- Email notifications for schedule changes
- PDF export functionality
- Mobile responsive improvements
- Real-time conflict detection during assignment
- Integration with student information systems
- Analytics dashboard with usage statistics
This is a complete, production-ready system following clean coding practices. All files are under 300 lines and follow modular design principles.
Open source - use and modify as needed for educational purposes.
For issues or questions, refer to the inline documentation in each module file.
Built with ❤️ using Flask and Bootstrap 5