Gobarau Academy Backend is a Django REST Framework application organised into a single Django project (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/muhammadbugaje/gobarau_backend/llms.txt
Use this file to discover all available pages before exploring further.
gobarau/) containing eleven installed apps — one shared core library and ten domain-specific apps under the apps/ namespace. Every domain exposes its resources through a versioned REST API mounted under /api/<domain>/. Shared behaviour — UUID primary keys, soft-delete, audit trails, role choices, and permission enforcement — lives in core/ so that each domain app stays focused on its own business logic. The custom user model (accounts.User) extends Django’s AbstractUser and is declared as AUTH_USER_MODEL, giving every part of the system a single, consistent identity root.
Application Layout
The repository is divided into three top-level layers:| Path | Purpose |
|---|---|
gobarau/ | Django project configuration — settings.py, urls.py, wsgi.py |
core/ | Shared abstractions — base models, managers, choices, permission classes |
apps/ | Ten domain apps, each with its own models, serializers, views, and URLs |
gobarau/ — Project Configuration
The project root holds global settings (installed apps, database, JWT config, Cloudinary storage, CORS headers) and the master URL dispatcher that includes each app’s router.
core/ — Shared Abstractions
The core package is not a domain app — it ships no API endpoints of its own. It provides the building blocks every domain app inherits:
core/models.py— Four abstract base models (BaseModel,TimeStampedModel,SoftDeleteModel,AuditMixin)core/managers.py— Three custom queryset managers (ActiveManager,ArchivedManager,SoftDeleteManager)core/choices.py— AllTextChoicesenumerations: roles, wings, gender, terms, enrollment statuses, payment statuses, and morecore/permissions.py— Four DRF permission classes (IsAdminLevel,IsStaffOrAdmin,IsOwnStudent,IsOwnWard)
apps/ — Domain Apps
accounts
Authentication, the custom
User model, Person identity records, and JWT token endpoints.administration
Campus management, Wing configuration, Academic Sessions, Terms, and school-wide settings.
people
Role profiles for students, teachers, parents, and alumni. Class enrollments and ward relationships.
academics
Classes, subjects, timetables, scores, report cards, attendance, exams, and Tahfeez (Juz) progress.
admissions
Admission applications, application status tracking, and applicant onboarding workflows.
finance
Fee structures, invoices, payment records, and bursar-level financial reporting.
communication
Announcements, internal messaging, and push notifications across all user roles.
content
Learning materials, library book borrowing, and digital content distribution.
welfare
Health records, counselling sessions, disciplinary tracking, and student merit/demerit logs.
services
Transport routes, service requests, and other operational school services.
API Routing
All domain apps are mounted under the/api/ prefix in gobarau/urls.py. Each app’s own urls.py registers its ViewSets with a DRF DefaultRouter, so every resource automatically gets list, detail, create, update, and destroy endpoints.
The Django admin panel is available at
/admin/ and is powered by django-unfold for an enhanced UI experience.Core Base Models
All domain models inherit from one or more of the four abstract base models defined incore/models.py. This ensures every record in the system has a consistent set of fields and behaviours.
BaseModel
The root abstract model. Every concrete model that needs an external-facing identifier and timestamps should extend BaseModel.
| Field | Type | Description |
|---|---|---|
public_id | UUIDField | Auto-generated UUID used as the external-facing identifier in all API responses |
created_at | DateTimeField | Set automatically when the record is first saved |
updated_at | DateTimeField | Updated automatically on every save |
TimeStampedModel
A lightweight variant that provides timestamps only — no UUID. Use this for join or through-table models that don’t need an external identifier.
SoftDeleteModel
Extends BaseModel with archive (soft-delete) capability. Records are never hard-deleted — they are flagged is_archived=True and filtered out of the default queryset.
| Field / Method | Description |
|---|---|
is_archived | Boolean flag; True means the record is soft-deleted |
archived_at | Timestamp of when .archive() was called |
archived_by | FK to the User who triggered the archive |
.archive(user) | Marks the record as archived, recording who did it |
.restore() | Clears the archive flag and nullifies archive metadata |
.objects | Default manager — returns active records only |
.all_objects | Returns all records regardless of archive state |
.archived | Returns archived records only |
AuditMixin
Extends BaseModel with created_by and updated_by foreign keys to track which user created or last modified a record.
Multi-Wing Model
Gobarau Academy operates three distinct educational wings, each with its own curriculum, class structure, and teaching staff. The wing a student belongs to determines which classes they can be assigned to, which subjects appear in their timetable, and which records are tracked in the Tahfeez module.| Wing | Value | Description |
|---|---|---|
| Regular | regular | Standard national curriculum classes |
| Islamiyyah | islamiyyah | Islamic studies integrated curriculum |
| Tahfeez | tahfeez | Quran memorisation (Hifz) programme |
User.wing— set at the user account level, acts as the primary wing affiliationStudentProfile.wing— a FK toadministration.Wing, refining the student’s specific wing record within their campusStudentProfile.campus— a FK toadministration.Campus, enabling multi-campus deployments where wings may differ by location
JuzProgress and RecitationSession models in the academics app, which track each student’s memorisation progress through the 30 Juz of the Quran.
Tech Stack
| Technology | Role |
|---|---|
| Python / Django 6 | Web framework and ORM |
| Django REST Framework | API serialization, ViewSets, routers, authentication |
| djangorestframework-simplejwt | JWT-based authentication (/api/accounts/token/) |
| django-unfold | Enhanced Django admin UI with filters, forms, and import/export integration |
| django-import-export | Bulk data import and export from the admin panel |
| Cloudinary / cloudinary-storage | Cloud media storage for profile photos and uploaded content |
| django-cors-headers | CORS policy management for frontend clients |
| SQLite | Default development database (switchable to PostgreSQL for production) |