A lightweight, browser-based solution for creating optimized academic or work schedules with an intuitive step-by-step wizard interface.
- Interactive 4-Step Wizard - Streamlined user experience with logical progression
- Smart Scheduling Algorithm - Optimized course placement with collision avoidance
- Responsive Design - Works on desktop, tablet, and mobile devices
- No Server Required - Pure client-side processing with zero dependencies
- Print-Ready Output - Professional, clean timetable layout ready for printing
- Form Validation - Prevents common user errors and duplicate entries
- Custom Time Slots - Different timeslots for weekdays vs. weekends
- HTML5 - Semantic markup structure
- CSS3 - Modern styling with animations and transitions
- Vanilla JavaScript - No frameworks or libraries
- Modular Architecture - Separate JS files for specific functionality
- Responsive Grid Layout - CSS grid for the timetable display
- Modern Web Fonts - Google Fonts (Roboto) for typography
The timetable generation uses a randomized greedy assignment algorithm with the following approach:
- Grid Initialization - Creates a 2D matrix of all possible time slots across days
- Course Assignment - For each course:
- Attempts to schedule required sessions across different days when possible
- Respects course duration (consecutive time slots)
- Ensures no overlap with already scheduled courses
- Uses a "tries" limit to prevent infinite loops
The isFree() function validates availability by:
- Checking if a sequence of consecutive slots is available
- Confirming the course duration fits within the day's schedule
- Verifying no other course is already assigned to these slots
- Prioritizes scheduling sessions on different days when possible
- Maintains a set of "used" days to track where a course has been placed
- Falls back to same-day scheduling if necessary to fulfill requirements
- Any modern web browser (Chrome, Firefox, Safari, Edge)
- Clone this repository or download the ZIP file
- Extract files to your desired location
- Open
index.htmlin your browser
No build process, server, or installation required!
- Input course details including:
- Course code (unique identifier)
- Duration (how many consecutive hours each session takes)
- Sessions per week (how many times the course meets weekly)
- Add as many courses as needed with the "+ Add Course" button
- Each entry is validated in real-time
- Review all entered course information in a tabular format
- Make any necessary modifications
- Remove courses if needed
- Confirm the data is correct before proceeding
- Briefly displays a loading animation while the scheduling algorithm works
- Processes all course requirements and constraints
- Creates an optimized schedule that attempts to:
- Distribute sessions across different days
- Avoid time conflicts
- Respect course durations
- Display the final generated timetable in a grid layout
- Days of the week are shown across columns
- Time slots are shown in rows
- Each cell displays the assigned course code (if any)
- Export options:
- Print directly from the browser
- Start over with the "New" button
timetable-generator/
├── index.html # Main wizard interface
├── timetable.html # Direct timetable view
├── css/
│ └── style.css # Styling and animations
├── js/
│ ├── app.js # Step navigation logic
│ ├── form.js # Form handling and validation
│ └── timetable.js # Schedule generation algorithm
└── assets/
└── favicon.ico # Favicon
The timetable generator can be easily customized by modifying:
- Time slots - Edit the
weekdaySlotsandsaturdaySlotsarrays intimetable.js - Days - Modify the
daysarray intimetable.js - Styling - Customize appearance in
style.css - Validation rules - Adjust form validation in
form.js
- Currently limited to predefined time slots
- No persistence (refreshing page clears all data)
- Does'nt considers lunch breaks
- Future plans:
- Local storage for saving timetables
- Export to calendar formats (iCal, Google Calendar)
- Additional constraints (teacher availability, room assignments)
- Drag-and-drop interface for manual adjustments
Feel free to fork this project and submit pull requests! Areas for improvement include:
- More sophisticated scheduling algorithms
- Additional export options
- Enhanced UI/UX
- Mobile app wrapper
This project is licensed under the MIT License - see the LICENSE file for details.
