DU English Dept Routine Management

Multi-role academic timetable platform and companion Flutter mobile client

Context & Problem

University department timetables look simple only on paper. Across multiple undergraduate and graduate batches in the Department of English, University of Dhaka, a recurring Sunday–Thursday weekly routine constantly collides with real life: cancelled classes, room swaps, extra make-up sessions, faculty availability windows, and peer-tutor slots.

Maintaining that state in static PDFs or chat threads creates conflicting bookings and leaves students unsure whether a room is actually free or a class was moved that morning.

System Architecture

Over 100 commits, the project evolved into a shared backend serving two clients—a server-rendered interactive web application and a native-feeling Flutter mobile app—with strict domain boundaries around conflict detection and schedule projection.

1. Framework-Free Domain Core

Rather than burying scheduling rules inside Django views or serializers, the core logic lives in pure Python domain modules (schedule_conflicts, schedule_projection, and identity):

  • Conflict Detection: Evaluates overlapping time windows across rooms, teachers, and student batches before any recurring slot or dated modification is persisted.
  • Dated Schedule Projection: Merges recurring Sunday–Thursday entries with dated exceptions (cancelled, rescheduled, extra) for any requested date range.
  • Batched Occupancy Loader: Queries day-level room and faculty occupancy in batches rather than N+1 loops, paired with a versioned signal-driven cache that invalidates automatically when routines change.

2. Multi-Role Approval Workflow & CSV Onboarding

Five roles govern who can propose versus confirm changes: admin, class_rep, peer_tutor, teacher, and student. Class representatives and peer tutors can submit modifications or room requests subject to approval rules, while administrators can bulk-import and export semester timetables via validated CSV pipelines.

3. Web Calendar & Companion Flutter Client

  • Web App: Django templates paired with modular ES JavaScript, FullCalendar, and Tailwind CSS / DaisyUI for master timetable views, room booking, and administrative management.
  • Mobile App (Flutter): Built with flutter_riverpod, go_router, and dio with JWT refresh interceptors (djangorestframework-simplejwt). Supports guest browsing, weekly personal schedules, live available-slot lookup, offline schedule caching via shared_preferences, and local class reminder notifications (flutter_local_notifications + timezone awareness).

4. Production Reliability

Deployed on Render and Heroku backed by Neon Postgres, with GitHub Actions CI running ruff, JavaScript syntax checks, Django migration drift verification, and regression test suites covering conflict edge cases, projection math, peer-tutor flows, and CSV imports. A scheduled keep-warm workflow pings the service during Dhaka academic hours so morning schedule checks stay responsive.

Trade-offs & Lessons Learned

  • Django templates + modular JS over a separate SPA: An early Vite + React scaffold was intentionally left unused in favor of Django templates + FullCalendar, avoiding duplicate auth/routing overhead on the web while dedicating client-side state engineering to the Flutter mobile app.
  • Pure domain modules pay for themselves quickly: Isolating projection and conflict rules from ORM models made writing exhaustive unit tests fast and kept web views and mobile REST endpoints strictly consistent.