Skip to content

Sajjad-Matin/timetable-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

📅 Timetable Generator

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.

TypeScript Next.js Node.js Express PostgreSQL Prisma Tailwind CSS


📌 Problem Statement

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.


✨ Features

  • 👩‍🏫 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

🏗️ Architecture

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

🚀 Getting Started

Prerequisites

  • Node.js 18+
  • PostgreSQL 14+
  • npm or yarn

1. Clone the repository

git clone https://github.com/Sajjad-Matin/timetable-generator.git
cd timetable-generator

2. Set up the Backend

cd backend
npm install

Create 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 dev

3. Set up the Frontend

cd ../frontend
npm install
npm run dev

The frontend will be available at http://localhost:3000 The API will be available at http://localhost:5000


🧪 Running Tests

cd backend

# Unit tests
npm run test

# End-to-end tests
npm run test:e2e

# Test coverage report
npm run test:cov

🔌 API Overview

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

🛣️ Roadmap

  • 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

👨‍💻 Author

Sajjad Matin


📄 License

This project is open source and available under the MIT License.

About

Automated school scheduling engine — generates conflict-free timetables across teachers, classes & rooms with PDF export.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages