A comprehensive, scalable timetable management system with multi-tenant support, genetic algorithm optimization, and modern React frontend.
- Multi-Tenant Architecture: Master admin can manage multiple colleges, each with their own dashboard
- Genetic Algorithm: Optimized timetable generation with constraint handling
- Role-Based Access Control: Master Admin, College Admin, HOD, Faculty, and Student roles
- Modern Frontend: React with TypeScript, Tailwind CSS, and responsive design
- RESTful API: Django REST Framework with JWT authentication
- Scalable Design: PostgreSQL database, Celery for async tasks, Redis for caching
Time-Table/
├── backend/ # Django backend
│ ├── algorithm/ # Genetic algorithm implementation
│ ├── api/ # Authentication endpoints
│ ├── core/ # Core models, views, serializers
│ └── timetable_backend/ # Django settings
├── frontend/ # React frontend
│ └── src/
│ ├── pages/ # Page components
│ ├── components/ # Reusable components
│ ├── stores/ # State management
│ └── lib/ # Utilities
└── README.md
-
Navigate to backend directory:
cd backend -
Create virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
cp .env.example .env # Edit .env with your database credentials -
Set up database:
python manage.py makemigrations core python manage.py migrate
-
Create superuser (Master Admin):
python manage.py createsuperuser
-
Run server:
python manage.py runserver
-
Navigate to frontend directory:
cd frontend -
Install dependencies:
npm install
-
Run development server:
npm run dev
- Login with master admin credentials
- Navigate to Colleges section to add/manage colleges
- Each college gets a unique subdomain and dashboard
- Manage users across all colleges
- Login with college admin credentials
- Set up departments, teachers, subjects, sections, and classrooms
- Generate timetables using the genetic algorithm
- View and manage generated timetables
POST /api/auth/register/- Register new userPOST /api/auth/login/- LoginGET /api/auth/me/- Get current userPOST /api/auth/logout/- Logout
GET /api/colleges/- List collegesPOST /api/colleges/- Create collegeGET /api/colleges/{id}/- Get college detailsPATCH /api/colleges/{id}/- Update collegeDELETE /api/colleges/{id}/- Delete college
GET /api/timetables/- List timetablesPOST /api/timetables/- Create timetableGET /api/timetables/{id}/- Get timetable detailsPOST /api/generate-timetable/generate/- Generate timetable using GA
The genetic algorithm optimizes timetable generation by:
- Initialization: Creates random timetable populations
- Fitness Evaluation: Scores timetables based on constraint violations
- Selection: Selects best timetables for reproduction
- Crossover: Combines features from parent timetables
- Mutation: Introduces random changes for diversity
- Iteration: Repeats for specified generations
-
Hard Constraints: Must be satisfied
- No teacher double-booking
- No classroom double-booking
- Room capacity limits
- Teacher availability
-
Soft Constraints: Preferences
- Teacher time preferences
- Balanced workload distribution
- Minimize gaps between classes
To add sample data for testing:
-
Use Django admin or API to create:
- Colleges
- Departments
- Teachers
- Subjects
- Sections
- Classrooms
- Subject-Teacher mappings
-
Or use the management command (to be added):
python manage.py load_sample_data
- Use Gunicorn or uWSGI for production
- Set up PostgreSQL database
- Configure Redis for Celery
- Set environment variables securely
- Build for production:
npm run build - Serve static files with Nginx or similar
- Configure API proxy
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License