⚡ An intelligent, conflict-free school timetable generator & interactive scheduling platform.
🌐 Live Demo: https://o2sa.github.io/school-schedule-generator/
Manually creating academic schedules that satisfy complex real-world constraints—teacher availability, class periods, maximum daily workloads, and subject quotas—is a tedious and error-prone puzzle.
School Schedule Generator automates academic scheduling using an intelligent constraint-satisfaction engine with forward checking, minimum remaining values (MRV), and least-constraining value (LCV) heuristics.
The platform is designed to be local-first and client-driven: it can run completely inside the browser using Web Workers and IndexedDB (no database setup required), while also supporting an optional full-stack Express & MongoDB backend mode.
- ⚡ Background Solver Engine: Timetables are generated inside a dedicated Web Worker using deterministic constraint backtracking, keeping the UI responsive at 60 FPS even during intensive calculations.
- 💾 Local-First & Offline Ready: All data (teachers, classes, subjects, constraints, and generated schedules) is saved locally in IndexedDB via Dexie.js. No server installation needed.
- 🌍 Full Bilingual Localization (English & Arabic RTL):
- Automatic system language detection (
navigator.language) with Arabic priority. - Native RTL/LTR layout transitions powered by Mantine's
DirectionProvider. - Modern Arabic typography with Cairo and Tajawal Google fonts.
- Interactive language switcher in the navigation bar.
- Automatic system language detection (
- 🌓 Adaptive System Dark / Light Theme:
- Automatically matches system color scheme (
prefers-color-scheme). - Refined high-contrast dark mode styling for timetable grids and teacher availability matrices.
- Instant theme toggle in the header.
- Automatically matches system color scheme (
- 📅 Interactive Timetable Editor & Multi-View:
- Responsive multi-view tabs: Class Timetable, Teacher Timetable, and All Classes Master View.
- Interactive drag/swap of lecture slots with real-time constraint validation.
- ⚙️ Customizable Academic Calendar:
- Configurable working days per week (5, 6, or 7 days).
- Flexible lecture periods per day (e.g. 6 to 8 periods).
- Fine-grained teacher availability slot matrix and weekly period capacity enforcement.
- 🚀 Automated GitHub Pages CI/CD:
- Automated deployment workflow via GitHub Actions (
.github/workflows/deploy.yml). - SPA 404 fallback routing for seamless page refreshes on GitHub Pages.
- Automated deployment workflow via GitHub Actions (
school-schedule-generator/
├── packages/
│ └── school-timetabling-engine/ # Standalone solver package (CJS, ESM, d.ts)
├── client/ # React 18 + Vite + Mantine UI v7 frontend
│ ├── src/
│ │ ├── api/ # Data context (Local IndexedDB or Server API)
│ │ ├── components/ # Reusable UI components & modals
│ │ ├── i18n/ # Bilingual translations & RTL provider
│ │ ├── layouts/ # Responsive navigation & header shell
│ │ ├── pages/ # Dashboard, Teachers, Classes, Generator, etc.
│ │ └── theme/ # Mantine theme & dark mode tokens
│ └── tests/ # Vitest + Testing Library test suite
├── server/ # Optional Node.js + Express REST API
│ ├── controllers/ # Route controllers
│ ├── models/ # Mongoose models (Teacher, Class, Subject)
│ └── populate.js # Sample database seeder
└── .github/workflows/deploy.yml # GitHub Actions deployment to GitHub Pages
-
Clone the repository:
git clone https://github.com/O2sa/school-schedule-generator.git cd school-schedule-generator -
Install dependencies:
pnpm install
-
Start the client development server:
pnpm --filter client dev
-
Open your browser: Navigate to
http://localhost:5173to use the application with local storage and Web Worker solving.
If you wish to use the centralized MongoDB backend:
- Ensure MongoDB is running locally (default
mongodb://localhost:27017/school-scheduler). - Start the server:
pnpm --filter server dev
- Run all services concurrently:
pnpm dev:all
Run the full monorepo test suite (engine + client):
pnpm testRun test suite for a specific package:
pnpm --filter client test
pnpm --filter school-timetabling-engine testCompile all packages and generate optimized static assets for deployment:
pnpm buildThe production bundle will be generated in client/dist/, complete with index.html and 404.html ready for static hosting.
The repository includes a GitHub Actions workflow in .github/workflows/deploy.yml that automatically builds and publishes the website to GitHub Pages on every push to development or main.
To enable it:
- Navigate to Settings > Pages in your GitHub repository.
- Under Build and deployment > Source, select GitHub Actions.
- Push to your repository to trigger the automated deployment.
Contributions and ideas to enhance the constraint algorithm or UI are welcome!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
