A full-stack MERN application for generating conflict-free academic timetables for multiple classes, divisions, teachers, labs, and NEP elective groups while respecting various constraints.
- Academic Structure Management: Define working days and daily lecture slots
- Class/Division Management: Manage multiple years (FY, SY, TY) and divisions (A, B, C, etc.)
- Classroom & Lab Management: Track rooms with type and capacity
- Teacher Management: Manage teacher availability by day/time slot and max hours per week
- Subject Management: Handle theory, lab, and elective subjects with credit hours
- Elective Batch Management: Group students into multiple electives with parallel room allocation
- Constraint-Based Scheduling Engine with:
- Lab allocation (continuous 2-3 slot blocks)
- Elective scheduling (parallel room allocation)
- Core subject allocation
- Conflict resolution using backtracking
- Class-wise timetable view
- Teacher-wise timetable (TODO)
- Room occupancy chart (TODO)
- Export as PDF/Excel (TODO)
- React 18.2.0
- React Router DOM 6.20.0
- TailwindCSS 3.3.6
- Axios for API calls
- Node.js with Express.js 4.18.2
- MongoDB with Mongoose ODM 8.0.0
- CORS enabled
- dotenv for environment variables
timetableGenerator/
βββ backend/
β βββ src/
β β βββ controllers/
β β β βββ timetableController.js
β β β βββ teacherController.js
β β β βββ subjectController.js
β β β βββ classController.js
β β β βββ roomController.js
β β β βββ electiveController.js
β β βββ models/
β β β βββ Teacher.js
β β β βββ Subject.js
β β β βββ Class.js
β β β βββ Classroom.js
β β β βββ ElectiveGroup.js
β β β βββ Timetable.js
β β βββ services/
β β β βββ scheduler/
β β β βββ constraintSolver.js
β β β βββ labAllocator.js
β β β βββ electiveAllocator.js
β β β βββ conflictChecker.js
β β βββ routes/
β β β βββ timetableRoutes.js
β β β βββ teacherRoutes.js
β β β βββ classRoutes.js
β β β βββ subjectRoutes.js
β β β βββ roomRoutes.js
β β β βββ electiveRoutes.js
β β βββ config/
β β β βββ database.js
β β βββ app.js
β βββ package.json
β βββ .env.example
β
βββ frontend/
βββ src/
β βββ pages/
β β βββ Dashboard.jsx
β β βββ ManageTeachers.jsx
β β βββ ManageSubjects.jsx
β β βββ ManageClasses.jsx
β β βββ ManageRooms.jsx
β β βββ ManageElectives.jsx
β β βββ GenerateTimetable.jsx
β β βββ ViewTimetable.jsx
β βββ components/
β β βββ TimetableGrid.jsx
β β βββ FileUploader.jsx
β β βββ TeacherLoadChart.jsx
β βββ utils/
β β βββ api.js
β βββ App.js
β βββ index.js
βββ package.json
βββ tailwind.config.js
{
name: String,
department: String,
availability: Map<String, [String]>, // e.g., { Monday: ["9-10", "10-11"] }
maxHoursPerWeek: Number
}{
name: String,
type: Enum['theory', 'lab', 'elective'],
creditHours: Number,
teacherId: ObjectId (ref: Teacher)
}{
name: String,
year: Enum['FY', 'SY', 'TY', 'Final Year'],
division: String,
strength: Number
}{
name: String,
type: Enum['classroom', 'lab'],
capacity: Number
}{
groupName: String,
classIds: [ObjectId],
subjectIds: [ObjectId],
teacherIds: [ObjectId],
roomIds: [ObjectId]
}{
classId: ObjectId,
weekSchedule: {
Monday: [{ slot, subject, room, teacher }],
Tuesday: [...],
...
},
generatedAt: Date
}- Node.js (v16 or higher)
- MongoDB (local or Atlas)
- npm or yarn
- Navigate to backend directory:
cd backend- Install dependencies:
npm install- Create
.envfile:
cp .env.example .env- Update
.envwith your MongoDB URI:
PORT=8080
MONGODB_URI=mongodb://localhost:27017/timetable-generator
NODE_ENV=development
- Start the backend server:
npm run devThe backend will run on http://localhost:8080
- Navigate to frontend directory:
cd frontend- Install dependencies:
npm install- Create
.envfile:
cp .env.example .env- Update
.envwith backend API URL:
REACT_APP_API_URL=http://localhost:8080/api
- Start the development server:
npm startThe frontend will run on http://localhost:3000
GET /api/teachers- Get all teachersGET /api/teachers/:id- Get single teacherPOST /api/teachers- Create teacherPUT /api/teachers/:id- Update teacherDELETE /api/teachers/:id- Delete teacher
GET /api/subjects- Get all subjectsGET /api/subjects/:id- Get single subjectPOST /api/subjects- Create subjectPUT /api/subjects/:id- Update subjectDELETE /api/subjects/:id- Delete subject
GET /api/classes- Get all classesGET /api/classes/:id- Get single classPOST /api/classes- Create classPUT /api/classes/:id- Update classDELETE /api/classes/:id- Delete class
GET /api/rooms- Get all roomsGET /api/rooms/:id- Get single roomPOST /api/rooms- Create roomPUT /api/rooms/:id- Update roomDELETE /api/rooms/:id- Delete room
GET /api/electives- Get all elective groupsGET /api/electives/:id- Get single elective groupPOST /api/electives- Create elective groupPUT /api/electives/:id- Update elective groupDELETE /api/electives/:id- Delete elective group
POST /api/timetable/generate- Generate timetableGET /api/timetable- Get all timetablesGET /api/timetable/class/:classId- Get timetable by classDELETE /api/timetable/:id- Delete timetable
-
Setup Academic Structure
- Add all teachers with their availability
- Add all classrooms and labs
- Add all classes and divisions
- Add all subjects (theory, lab, elective)
-
Configure Elective Groups
- Create elective groups for each class
- Assign subjects, teachers, and rooms to groups
-
Generate Timetable
- Click "Generate Timetable" button
- System will allocate slots following constraints:
- Labs get continuous time blocks
- Electives run in parallel
- No teacher/room/class conflicts
-
View & Export
- View generated timetables by class
- Export to PDF or Excel (coming soon)
- Full MERN stack boilerplate
- MongoDB models with proper schemas
- Express API routes and controllers
- React pages with TailwindCSS UI
- CRUD operations for all entities
- Placeholder scheduler services
- Actual timetable generation logic in scheduler services
- Teacher availability constraint checking
- Lab continuous slot allocation algorithm
- Elective parallel scheduling logic
- Backtracking for conflict resolution
- PDF/Excel export functionality
- Teacher-wise timetable view
- Room occupancy charts
This is a project scaffold. To implement the timetable generation logic:
- Complete
constraintSolver.js- Main scheduling algorithm - Implement
labAllocator.js- Lab session scheduling - Implement
electiveAllocator.js- Elective group scheduling - Complete
conflictChecker.js- Validation logic
ISC
Built with β€οΈ for educational institutions implementing NEP guidelines.
Note: This is a boilerplate structure. The timetable generation logic (constraint solver, backtracking algorithm) needs to be implemented in the scheduler service files.