An automated school scheduling engine that eliminates the manual headache of timetable planning — generating conflict-free schedules across all classes, teachers, and rooms in seconds.
Creating school timetables manually is a time-consuming, error-prone process — teachers get double-booked, rooms get double-assigned, and the whole thing has to be redone whenever anything changes. This system automates the entire scheduling process: input your teachers, subjects, classes, and rooms, and get a conflict-free timetable instantly.
- 👩🏫 Teacher Availability Management — define when each teacher is available and let the system respect those constraints automatically
⚠️ Conflict Detection — prevents double-booking of teachers, rooms, and classes at the same time slot- 🏫 Multi-Room Support — schedule across multiple classrooms simultaneously
- 🖨️ PDF Export — export any generated timetable as a print-ready PDF for instant distribution
- 🗂️ Class & Subject Management — manage all classes, subjects, and their relationships from one place
- 📊 Admin Dashboard — full visibility over the schedule with the ability to make manual adjustments
timetable-generator/
├── backend/ # Node.js + Express REST API
│ ├── src/
│ │ ├── teachers/ # Teacher & availability management
│ │ ├── rooms/ # Room management
│ │ ├── classes/ # Class & subject management
│ │ ├── schedule/ # Core scheduling engine & conflict detection
│ │ ├── export/ # PDF generation logic
│ │ └── common/ # Shared utilities & middleware
│ ├── prisma/
│ │ └── schema.prisma
│ └── test/
└── frontend/ # Next.js + Tailwind CSS
├── src/
│ ├── app/
│ ├── components/
│ ├── hooks/
│ └── services/ # API client layer
- Node.js 18+
- PostgreSQL 14+
- npm or yarn
git clone https://github.com/Sajjad-Matin/timetable-generator.git
cd timetable-generatorcd backend
npm installCreate a .env file in the backend/ directory:
PORT=5000
DATABASE_URL="postgresql://postgres:password@localhost:5432/timetable?schema=public"Run Prisma migrations and start the server:
npx prisma migrate dev
npm run devcd ../frontend
npm install
npm run devThe frontend will be available at http://localhost:3000
The API will be available at http://localhost:5000
cd backend
# Unit tests
npm run test
# End-to-end tests
npm run test:e2e
# Test coverage report
npm run test:cov| Method | Endpoint | Description |
|---|---|---|
| GET | /teachers |
List all teachers |
| POST | /teachers |
Add a new teacher |
| PUT | /teachers/:id/availability |
Update teacher availability |
| GET | /rooms |
List all rooms |
| POST | /rooms |
Add a new room |
| GET | /classes |
List all classes & subjects |
| POST | /classes |
Add a new class |
| POST | /schedule/generate |
Generate a conflict-free timetable |
| GET | /schedule/:id |
Get a generated timetable |
| GET | /schedule/:id/export/pdf |
Export timetable as PDF |
- Docker & Docker Compose setup
- Drag-and-drop manual schedule adjustments
- Excel export in addition to PDF
- Multi-school / multi-branch support
- Email timetable distribution to teachers
Sajjad Matin
- Portfolio: my-portfolio-vert-seven.vercel.app
- LinkedIn: sajjad-matin-mahmodi
- Email: [email protected]
This project is open source and available under the MIT License.