How mahmoudalmodalal/noor_alhoda works
Noor Al-Huda is an offline-first PWA for Quran-memorization center operations. Directors, teachers, and students/parents use role-specific screens to manage enrollment, attendance, memorization plans and reviews, evaluations, and progress; directors also oversee courses and reports. The frontend reads and mutates encrypted local data, then synchronizes through a Django API with PostgreSQL. README documentation establishes the main layers and sync workflow; sampled source confirms selected auth, student, review, evaluation, notification, reporting, and push-service behavior, but not every subsystem’s wiring.
Main entry points: urls.py Django API routes · runner.ts Sync runner · page.tsx Role screens · push_services.py Push service
Components 25
PWA Client
- Role screens
frontend/src/app/(dashboard)/page.tsx - Query dispatcher
frontend/src/hooks/queries.ts - Mutation dispatcher
frontend/src/hooks/mutations.ts - Encrypted local DB
frontend/src/lib/db/schema.ts - Auth context
frontend/src/contexts/AuthContext.tsx
Identity & Enrollment
- Auth services
backend/accounts/services/auth_services.py - Account records
backend/accounts/models.py - Student services
backend/students/services/student_services.py - Teacher operations
backend/teacher/services/teacher_services.py - Enrollment data
backend/students/models.py
Learning Operations
- Plans & attendance
backend/records/services/record_services.py - Review scheduling
backend/records/services/review_services.py - Memorization progress
backend/progress/services/progress_services.py - Evaluations
backend/evaluations/services/evaluation_services.py - Course catalog
backend/courses/services/course_services.py - Messages & alerts
backend/notifications/services/notification_services.py
Center Oversight
- Reports & exports
backend/reports/services/report_services.py - Bulk data import
backend/students/services/excel_import/orchestrator.py
Offline Sync
- Django API routes
backend/noor_alhuda/urls.py - Sync runner
frontend/src/lib/sync/runner.ts - Pending outbox
frontend/src/lib/sync/outbox.ts - Push service
backend/sync/services/push_services.py - Pull service
backend/sync/services/pull_services.py - PostgreSQL
Other components
- Center users
Connections 30
- Center users → Role screens: use
- Role screens → Query dispatcher: read via
- Query dispatcher → Encrypted local DB: reads
- Role screens → Mutation dispatcher: change via
- Mutation dispatcher → Encrypted local DB: writes
- Center users → Auth context: sign in
- Auth context → Django API routes: authenticates
- Django API routes → Auth services: dispatches
- Auth services → Account records: reads/writes
- Django API routes → Student services: dispatches
- Django API routes → Teacher operations: dispatches
- Student services → Enrollment data: writes
- Teacher operations → Enrollment data: assigns
- Django API routes → Plans & attendance: dispatches
- Django API routes → Review scheduling: dispatches
- Django API routes → Memorization progress: dispatches
- Django API routes → Evaluations: dispatches
- Django API routes → Course catalog: dispatches
- Django API routes → Messages & alerts: dispatches
- Django API routes → Reports & exports: dispatches
- Django API routes → Bulk data import: dispatches
- Sync runner → Pending outbox: reads pending
- Sync runner → Django API routes: requests sync
- Django API routes → Push service: dispatches
- Django API routes → Pull service: dispatches
- Push service → PostgreSQL: applies writes
- Pull service → PostgreSQL: reads changes
- Push service → Student services: calls services
- Sync runner → Encrypted local DB: applies updates
- Django API routes → PostgreSQL: persists domain data