# abhi-dr/angaarxw3grads-portal architecture

> Architecture diagram of the GitHub repository abhi-dr/angaarxw3grads-portal, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abhi-dr/angaarxw3grads-portal
- Repository: https://github.com/abhi-dr/angaarxw3grads-portal

## Overview

1. **What this repository is**
   - A single Django monolith for an education/training platform. It serves multiple user roles—public visitor, student, instructor, and administrator—from the same codebase and database.

2. **Core application shell**
   - The `angaar_hai` package is the platform layer: `settings.py`, `urls.py`, `wsgi.py`, `asgi.py`, plus `middleware.py`, `custom_decorators.py`, `mail_utility.py`, `tasks.py`, and `celery.py`.
   - This is where request routing, auth/session setup, async task wiring, and process entrypoints are centralized.

3. **Identity and authentication boundary**
   - `accounts` owns the custom user/auth stack: custom user model migration rewiring, login/registration views, OAuth integration, auth backend/adapters, middleware, signals, and validation/management commands.
   - It is the system boundary for sign-in, account lifecycle, and Google OAuth configuration.

4. **Public/home-facing layer**
   - `home` contains the public site, landing pages, campaign/event pages, and registration flows such as Flames/Flare.
   - It also holds campaign-specific models, resources, and view logic, so this app acts as the public entry point before a user becomes a student or participant.

5. **Student portal**
   - `student` is the largest role app and acts as the learner-facing workspace.
   - It covers dashboards, profiles, certificates, payments, batch/course participation, hackathons, JOVAC learning pages, MCQ interaction, doubt solving, notifications, and related APIs.
   - It includes its own serializers, permissions, and API routes, so a lot of the student UI is server-rendered but backed by JSON endpoints for dynamic pages.

6. **Instructor portal**
   - `instructor` mirrors a subset of the student/administrator capability set, focused on managing batches, sheets, events, and JOVAC content from the instructor side.
   - It also exposes APIs with serializers and permission checks, implying a separate role boundary rather than one shared admin UI.

7. **Administrator console**
   - `administration` is the operational back office for staff. It includes batch management, alumni, articles, events, JOVAC management, MCQ/problem tooling, sheet APIs, WhatsApp-related views, and email/helper functions.
   - The presence of `consumers.py` and `routing.py` suggests real-time/channel-based features in addition to standard HTTP views.

8. **Practice/execution subsystem**
   - `practice` is the coding-practice engine: problem sheets, MCQ questions, submissions, test cases, execution-related views, and async utilities.
   - This is the part of the system that likely interacts with background execution or sandboxing workflows rather than simple CRUD screens.

9. **JOVAC content flow**
   - JOVAC content is a cross-cutting subsystem spanning `student`, `instructor`, `administration`, and `practice`.
   - The README shows it uses ordered `CourseSheet` items and mixed item types such as tutorials, assignments, MCQs, and coding tasks.
   - Navigation, submission, and page rendering all depend on preserving sheet context through query parameters and API responses, so the learning path is treated as a deterministic sequence rather than independent pages.

10. **API structure**
   - Each major role has its own API namespace under `student/api`, `instructor/api`, and `administration/api`.
   - These APIs are organized with serializers, permission classes, and view modules, which cleanly separate JSON/data concerns from the HTML template layer.
   - There is also an older `student/api.py`, which looks like legacy API surface kept alongside the newer package layout.

11. **Data model and schema evolution**
   - The repository relies heavily on migrations across apps, including custom-user rewiring and later cleanup migrations.
   - That indicates the database schema has evolved over time around a shared core identity model, plus app-specific entities for courses, sheets, registrations, certificates, batches, and campaign objects.

12. **Async, realtime, and integration points**
   - Celery is present for background jobs, and ASGI is configured, so the runtime supports async processing beyond standard request/response.
   - Integrations visible in the tree include email delivery, Google OAuth, WhatsApp-related flows, payment utilities, image uploads, and certificate generation.
   - These are not isolated services in this repo, but external dependencies that materially affect the system’s architecture.

13. **Presentation layer**
   - The app is predominantly server-rendered with Django templates under `templates/`, organized by role and feature.
   - `demo_static/` contains the bundled frontend assets: Bootstrap, jQuery, ApexCharts, TinyMCE, media files, and feature-specific CSS/JS.
   - This points to a traditional Django template architecture with some richer client-side behavior on top, not a separate SPA frontend.

14. **How requests typically flow**
   - A request enters Django through the root URL config, is routed to the relevant app, authenticated/authorized by the role-specific logic, and then either rendered as HTML or served as JSON.
   - Content-heavy paths such as JOVAC, sheets, MCQs, and submissions often combine server-rendered pages with API calls and background work, while admin/instructor/student views remain tightly coupled to the shared database.

Main entry points: [`angaar_hai/urls.py`](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/angaar_hai/urls.py) (Root URLs), [`student/views.py`](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/student/views.py) (Student), [`accounts/models.py`](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/accounts/models.py) (Accounts), [`angaar_hai/settings.py`](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/angaar_hai/settings.py) (Settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["Platform"]
  node_manage["manage.py<br/>entrypoint<br/>[manage.py]"]
  node_settings["Settings<br/>config<br/>[settings.py]"]
  node_urls["Root URLs<br/>routing<br/>[urls.py]"]
  node_runtime["ASGI/WSGI<br/>entrypoints<br/>[asgi.py]"]
  node_celery["Celery<br/>async jobs<br/>[celery.py]"]
end

subgraph group_identity["Identity"]
  node_accounts[("Accounts<br/>auth app<br/>[models.py]")]
  node_accounts_views["Auth views<br/>[views.py]"]
  node_accounts_oauth["OAuth stack"]
end

subgraph group_roles["Role apps"]
  node_home["Home<br/>public app<br/>[views.py]"]
  node_student["Student<br/>learner app<br/>[views.py]"]
  node_student_api["Student API<br/>json api<br/>[dashboard_api.py]"]
  node_instructor["Instructor<br/>teaching app<br/>[views.py]"]
  node_instructor_api["Instructor API<br/>json api<br/>[batch_api.py]"]
  node_administration["Admin<br/>back office<br/>[views.py]"]
  node_admin_api["Admin API<br/>json api<br/>[batch_api.py]"]
end

subgraph group_learning["Learning engine"]
  node_practice["Practice<br/>execution engine<br/>[views.py]"]
  node_jovac_student["JOVAC learner<br/>course flow<br/>[jovac_views.py]"]
  node_jovac_admin["JOVAC admin<br/>course mgmt<br/>[jovac_views.py]"]
  node_sheet_flow["Sheet flow<br/>content flow<br/>[batch_views.py]"]
end

subgraph group_presentation["Presentation"]
  node_templates["Templates<br/>server UI<br/>[base.html]"]
  node_static_assets["Static assets<br/>frontend assets<br/>[bootstrap.js]"]
end

node_manage -->|"loads"| node_settings
node_settings -->|"routes"| node_urls
node_urls -->|"auth"| node_accounts_views
node_urls -->|"public"| node_home
node_urls -->|"student"| node_student
node_urls -->|"instructor"| node_instructor
node_urls -->|"admin"| node_administration
node_urls -->|"practice"| node_practice
node_settings -->|"user model"| node_accounts
node_accounts -->|"oauth"| node_accounts_oauth
node_student -->|"api"| node_student_api
node_instructor -->|"api"| node_instructor_api
node_administration -->|"api"| node_admin_api
node_student -->|"study"| node_sheet_flow
node_instructor -->|"manage"| node_sheet_flow
node_administration -->|"author"| node_jovac_admin
node_student -->|"learn"| node_jovac_student
node_practice -->|"submit"| node_jovac_student
node_practice -->|"curate"| node_jovac_admin
node_home -->|"render"| node_templates
node_student -->|"render"| node_templates
node_instructor -->|"render"| node_templates
node_administration -->|"render"| node_templates
node_practice -->|"ui assets"| node_static_assets
node_settings -->|"tasks"| node_celery
node_settings -->|"serve"| node_runtime
node_student -->|"authz"| node_accounts
node_instructor -->|"authz"| node_accounts
node_administration -->|"authz"| node_accounts
node_home -->|"register"| node_accounts

click node_manage "https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/manage.py"
click node_settings "https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/angaar_hai/settings.py"
click node_urls "https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/angaar_hai/urls.py"
click node_runtime "https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/angaar_hai/asgi.py"
click node_celery "https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/angaar_hai/celery.py"
click node_accounts "https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/accounts/models.py"
click node_accounts_views "https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/accounts/views.py"
click node_accounts_oauth "https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/accounts/google_oauth_settings.py"
click node_home "https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/home/views.py"
click node_student "https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/student/views.py"
click node_student_api "https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/student/api/views/dashboard_api.py"
click node_instructor "https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/instructor/views.py"
click node_instructor_api "https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/instructor/api/views/batch_api.py"
click node_administration "https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/administration/views.py"
click node_admin_api "https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/administration/api/views/batch_api.py"
click node_practice "https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/practice/views.py"
click node_jovac_student "https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/student/jovac_views.py"
click node_jovac_admin "https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/administration/jovac_views.py"
click node_sheet_flow "https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/student/batch_views.py"
click node_templates "https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/templates/student/base.html"
click node_static_assets "https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/demo_static/js/dashboard/libs/bootstrap/dist/js/bootstrap.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_manage,node_settings,node_urls,node_runtime,node_celery toneBlue
class node_accounts,node_accounts_views,node_accounts_oauth toneAmber
class node_home,node_student,node_student_api,node_instructor,node_instructor_api,node_administration,node_admin_api toneMint
class node_practice,node_jovac_student,node_jovac_admin,node_sheet_flow toneRose
class node_templates,node_static_assets toneIndigo
```

## Components

### Platform

Project shell, routing, and runtime wiring

- [manage.py](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/manage.py): entrypoint · Django command entrypoint · `manage.py`
- [Settings](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/angaar_hai/settings.py): config · Project configuration and app wiring · `angaar_hai/settings.py`
- [Root URLs](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/angaar_hai/urls.py): routing · Top-level request routing · `angaar_hai/urls.py`
- [ASGI/WSGI](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/angaar_hai/asgi.py): entrypoints · Process interfaces for web and async runtime · `angaar_hai/asgi.py`
- [Celery](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/angaar_hai/celery.py): async jobs · Background task integration · `angaar_hai/celery.py`

### Identity

Authentication and account lifecycle

- [Accounts](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/accounts/models.py): auth app · Custom user model, login, OAuth, and account lifecycle · `accounts/models.py`
- [Auth views](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/accounts/views.py): views · Registration, login, and account flows · `accounts/views.py`
- [OAuth stack](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/accounts/google_oauth_settings.py): oauth · Adapters, backend, and Google OAuth settings · `accounts/google_oauth_settings.py`

### Role apps

Public, student, instructor, and admin application boundaries

- [Home](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/home/views.py): public app · Landing pages and public registrations · `home/views.py`
- [Student](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/student/views.py): learner app · Learner portal for dashboards, batches, certificates, payments, and submissions · `student/views.py`
- [Student API](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/student/api/views/dashboard_api.py): json api · Student-facing serializers, permissions, and endpoints · `student/api/views/dashboard_api.py`
- [Instructor](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/instructor/views.py): teaching app · Instructor workspace for batches, sheets, events, and JOVAC · `instructor/views.py`
- [Instructor API](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/instructor/api/views/batch_api.py): json api · Instructor endpoints with role permissions · `instructor/api/views/batch_api.py`
- [Admin](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/administration/views.py): back office · Operational console for staff workflows and real-time features · `administration/views.py`
- [Admin API](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/administration/api/views/batch_api.py): json api · Administrative batch, event, JOVAC, and sheet endpoints · `administration/api/views/batch_api.py`

### Learning engine

Shared practice, sheets, and JOVAC content flows

- [Practice](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/practice/views.py): execution engine · Problem sheets, MCQ submissions, and execution utilities · `practice/views.py`
- [JOVAC learner](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/student/jovac_views.py): course flow · Student-side ordered learning path and submissions · `student/jovac_views.py`
- [JOVAC admin](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/administration/jovac_views.py): course mgmt · Instructor and admin content authoring for JOVAC · `administration/jovac_views.py`
- [Sheet flow](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/student/batch_views.py): content flow · Shared sheet, batch, and MCQ navigation logic · `student/batch_views.py`

### Presentation

Server-rendered templates and bundled frontend assets

- [Templates](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/templates/student/base.html): server UI · Role-based Django templates for rendered pages · `templates/student/base.html`
- [Static assets](https://github.com/abhi-dr/angaarxw3grads-portal/blob/main/demo_static/js/dashboard/libs/bootstrap/dist/js/bootstrap.js): frontend assets · Bundled CSS, JS, media, and editor/chart dependencies · `demo_static/js/dashboard/libs/bootstrap/dist/js/bootstrap.js`

## Connections

- manage.py → Settings: loads · Command entrypoint uses project settings
- Settings → Root URLs: routes · Settings connect the root URL configuration
- Root URLs → Auth views: auth · Root routing sends sign-in and account requests to accounts
- Root URLs → Home: public · Public site routes land in home
- Root URLs → Student: student · Learner routes enter the student app
- Root URLs → Instructor: instructor · Instructor routes enter the instructor app
- Root URLs → Admin: admin · Staff routes enter the administrative console
- Root URLs → Practice: practice · Practice routes reach the execution subsystem
- Settings → Accounts: user model · Platform settings depend on the custom account model
- Accounts → OAuth stack: oauth · Account boundary includes Google OAuth and backend adapters
- Student → Student API: api · Student UI is backed by JSON endpoints
- Instructor → Instructor API: api · Instructor UI is backed by JSON endpoints
- Admin → Admin API: api · Staff console exposes structured APIs
- Student → Sheet flow: study · Learner batch and sheet pages share the course flow
- Instructor → Sheet flow: manage · Instructor tools manage the same sheet and batch structures
- Admin → JOVAC admin: author · Admin console manages JOVAC content
- Student → JOVAC learner: learn · Student portal renders the ordered learning path
- Practice → JOVAC learner: submit · Coding and MCQ practice feed JOVAC submissions
- Practice → JOVAC admin: curate · Practice content is curated from instructor/admin tooling
- Home → Templates: render · Public pages are server-rendered from templates
- Student → Templates: render · Student views render role-specific templates
- Instructor → Templates: render · Instructor views render role-specific templates
- Admin → Templates: render · Admin console renders from templates
- Practice → Static assets: ui assets · Practice pages rely on bundled frontend assets
- Settings → Celery: tasks · Project settings wire async job processing
- Settings → ASGI/WSGI: serve · Project settings configure web and async entrypoints
- Student → Accounts: authz · Student portal depends on shared account identity
- Instructor → Accounts: authz · Instructor portal depends on shared account identity
- Admin → Accounts: authz · Admin console depends on shared account identity
- Home → Accounts: register · Public registration flows hand off into account creation
