How raj-ai-ml/adroit_scheduler_timetable_generator works
1. Repository shape
- This is a single Django monolith with one project package, M1, and one main app, mm1.
- The architecture is centered on a timetable-generation workflow exposed through Django views and rendered with HTML templates.
2. Runtime and framework
- The app runs on Python 3.6+ and Django 2+.
- manage.py is the entry point, M1/settings.py configures the project, M1/urls.py wires top-level routing, and M1/wsgi.py is the deployment entry point.
3. Core functional subsystem: timetable generation
- The main business capability is an intelligent university timetable generator using a Genetic Algorithm.
- The README identifies both hard constraints and soft constraints, so the scheduler is not just a CRUD app; it is an optimization engine that must satisfy room capacity, teacher uniqueness, no room clashes, and weekly distribution rules.
4. Domain/data model boundary
- The app’s persistent domain is likely represented by the models in mm1/models.py, with migrations showing at least a section-related change and a class_in_week-type attribute.
- Based on the template names, the core entities are:
- departments
- instructors/teachers
- courses
- rooms
- sections
- These are the inputs to the scheduling engine and the source of truth for generated timetables.
5. CRUD and configuration UI
- mm1/forms.py and mm1/admin.py indicate two management paths:
- custom forms/pages for app users
- Django admin for internal data maintenance
- The templates addep.html, addmt.html, adcrs.html, addsec.html, adins.html, and addrm.html support creating and editing the master data used by the scheduler.
6. Scheduling orchestration layer
- mm1/views.py is the likely orchestration boundary where user actions trigger data loading, timetable generation, and result rendering.
- mm1/urls.py maps the app’s routes, including the timetable generation entry point referenced in the README (/timetable_generation/).
7. Presentation layer
- The UI is template-driven, not a client-side SPA.
- templates/base.html provides shared layout, while pages like index.html, crslist.html, deptlist.html, instlist.html, mtlist.html, rmlist.html, and seclist.html present the domain lists.
- templates/timetable.html and templates/timetable(1).html are the output views for generated schedules.
8. Persistence layer
- Data is stored in SQLite (db.sqlite3) through Django’s ORM.
- This makes the architecture self-contained: no separate database service is present in the repo tree.
9. Static and styling boundary
- Front-end assets are minimal and server-rendered.
- static/CSS/style.css appears to be the app-specific stylesheet, while assets/admin/... is Django’s bundled admin static assets.
- There is no evidence of a separate front-end build pipeline; styling is handled directly from static files.
10. Data flow through the system
- Typical flow is:
- user enters or edits master scheduling data
- Django persists that data in SQLite
- the genetic algorithm consumes the saved entities and constraints
- a timetable is produced
- results are rendered back to HTML templates for viewing
- This is a classic input-data → optimization engine → rendered schedule pipeline.
11. Important architectural boundary
- The repository does not show external services, message queues, or background workers.
- That suggests the timetable optimization is executed inside the Django request/response application boundary, rather than in a separate service.
12. What to show in an architecture diagram
- Draw four main blocks:
- Browser/UI templates
- Django app layer (mm1)
- Genetic algorithm scheduling logic
- SQLite persistence
- Connect the CRUD pages and admin interface to the ORM, then connect the scheduling views to the domain data and the timetable output pages.
Main entry points: views.py Views · settings.py Settings · models.py Models · admin.py Admin
Components 17
Django project
Framework entry and configuration
Timetable app
Domain models, forms, views, and routing
- Models · Departments, instructors, courses, rooms, sections
mm1/models.py - Forms · Custom data entry and editing forms
mm1/forms.py - Admin · Django admin registrations
mm1/admin.py - App URLs · App-level route mapping
mm1/urls.py - Views · Orchestrates CRUD and timetable generation
mm1/views.py - Scheduler · Optimization engine for timetable generation
Templates
Server-rendered UI pages
- Base layout · Shared page shell
templates/base.html - Master data pages · Department, instructor, course, room, and section pages
- Timetable views · Generated schedule output pages
- Index · Landing page
templates/index.html
Static assets
Styles and bundled admin assets
- Style CSS · App-specific styling
static/CSS/style.css - Admin assets · Bundled Django admin CSS/JS/fonts
assets/admin
Connections 19
- manage.py → Settings: loads config · Manage commands use project settings
- Settings → Root URLs: wires routes · Settings include the project URL configuration
- Settings → Admin: enables admin · Admin is registered through Django settings and app config
- Root URLs → App URLs: includes · Top-level routing delegates to app routes
- App URLs → Views: dispatches · App routes map requests to handlers
- Views → Models: reads/writes · Views persist and query master data
- Forms → Views: submits data · Forms feed request handlers for create/edit flows
- Admin → Models: administers · Django admin manages the same domain entities
- Views → Scheduler: invokes · Timetable generation is triggered from request handling
- Scheduler → Models: consumes · Optimization uses courses, rooms, instructors, sections, and departments
- Scheduler → SQLite DB: reads/writes · Generated schedules and source data are stored in SQLite
- Models → SQLite DB: persists to · ORM-backed domain storage
- Views → Base layout: renders · Views compose pages through the shared layout
- Views → Master data pages: renders · CRUD screens display master data lists and editors
- Views → Timetable views: renders · Views return the generated timetable pages
- Index → Base layout: extends · Home page uses the shared base template
- Base layout → Style CSS: styles with · Shared UI styling comes from the app stylesheet
- Admin → Admin assets: uses · Admin UI depends on bundled static assets
- WSGI → Settings: starts app · WSGI boots Django with project settings