# ryuga/university-hub architecture

> Architecture diagram of the GitHub repository ryuga/university-hub, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ryuga/university-hub
- Repository: https://github.com/ryuga/university-hub

## Overview

#### Purpose and Entry Points
A Django website for Christ College’s Computer Science department, combining a public departmental site with an authenticated student/administrator dashboard. Runtime entry points are `manage.py` for management/development, `core/wsgi.py` for Gunicorn, and `core/asgi.py` for ASGI deployments. Root request routing begins at `core/urls.py`.

#### Django Composition and Routing
Project configuration, host/subdomain handling, and process integration are centralized in `core/settings.py`, `core/hosts.py`, and `core/celery.py`. Requests are separated into two app boundaries:
- Public content and visitor authentication: `core/apps/web/urls.py`, `core/apps/web/views.py`.
- Dashboard, registrations, schedules, profiles, and payments: `core/apps/dashboard/urls.py`, `core/apps/dashboard/views.py`.

#### Public Website Domain
The `web` app owns department-facing content such as courses, events, faculty, gallery, alumni, policies, and login/registration pages. Its persistent content models live in `core/apps/web/models.py`; HTML is server-rendered from `core/apps/web/templates/web/`, including its base layout at `core/apps/web/templates/web/layouts/base.html`. Markdown rendering is a localized template-tag extension in `core/apps/web/templatetags/markdown_extras.py`.

#### Dashboard and Student Lifecycle
The `dashboard` app is the operational domain for student data and registration workflows. Models and schema evolution are represented by `core/apps/dashboard/models.py` and `core/apps/dashboard/migrations/`. Views render dashboard pages including programs, registration details, schedules, user profile, and payment status from `core/apps/dashboard/templates/dashboard/`. Django admin is customized through `core/apps/dashboard/admin.py`, including administrative registration-data templates.

#### Payments, Authentication, and Protected Data
Payment interactions are encapsulated outside views in `utils/payment_handler.py` and Paytm checksum support in `utils/paytm_checksum.py`; dashboard payment templates form the browser-facing status/transaction boundary. Google OAuth client integration is isolated in `utils/google_oauth2.py`. Environment-provided credentials cover Paytm and Google OAuth, while encryption helpers (`utils/hashing.py`) support protected identifiers/data. These integrations should remain behind utility/service boundaries rather than being duplicated in request handlers.

#### Background Processing and Data Layer
Celery is configured at the project level in `core/celery.py`, with dashboard-specific asynchronous work in `core/apps/dashboard/tasks.py`. Django ORM models in both apps are the application-to-database boundary; the database connection is supplied through `DATABASE_URL`. Migrations under each app establish the deployable schema history.

#### Delivery and Infrastructure
The application targets Python 3.8+ with Poetry dependency management (`pyproject.toml`, `poetry.toml`). It can run under Gunicorn behind NGINX via `core/wsgi.py`, or deploy to Dokku using `Procfile`, `MicroProcfile`, and `dokku-setup.yml`. GitHub Actions production and microservice pipelines are defined in `.github/workflows/production.yml` and `.github/workflows/microservice.yml`. Static assets are collected/served from `assets/`, while source static content is in `static/`.

Main entry points: [`core/apps/dashboard/views.py`](https://github.com/ryuga/university-hub/blob/master/core/apps/dashboard/views.py) (Dashboard views), [`core/apps/dashboard/models.py`](https://github.com/ryuga/university-hub/blob/master/core/apps/dashboard/models.py) (Student lifecycle models), [`core/urls.py`](https://github.com/ryuga/university-hub/blob/master/core/urls.py) (Root routing), [`core/apps/web/views.py`](https://github.com/ryuga/university-hub/blob/master/core/apps/web/views.py) (Public content views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_project["Django project"]
  node_entrypoints{{"Runtime entry points<br/>Python entrypoints<br/>[manage.py]"}}
  node_routing["Root routing<br/>Django URLs<br/>[urls.py]"]
  node_settings["Project settings<br/>Django settings<br/>[settings.py]"]
  node_hosts["Host routing<br/>django-hosts<br/>[hosts.py]"]
end

subgraph group_public["Public website"]
  node_web_urls["Public routes<br/>Django URLs<br/>[urls.py]"]
  node_web_views["Public content views<br/>Django views<br/>[views.py]"]
  node_web_models[("Public content models<br/>Django ORM<br/>[models.py]")]
  node_web_templates["Public templates<br/>Django templates"]
  node_markdown["Markdown tags<br/>template tags<br/>[markdown_extras.py]"]
end

subgraph group_dashboard["Student dashboard"]
  node_dashboard_urls["Dashboard routes<br/>Django URLs<br/>[urls.py]"]
  node_dashboard_views["Dashboard views<br/>Django views<br/>[views.py]"]
  node_dashboard_models[("Student lifecycle models<br/>Django ORM<br/>[models.py]")]
  node_dashboard_templates["Dashboard templates<br/>Django templates"]
  node_admin["Registration admin<br/>Django admin<br/>[admin.py]"]
  node_migrations["Schema migrations<br/>Django migrations"]
end

subgraph group_services["Integrations &amp; workers"]
  node_payments["Payment service<br/>payment utilities<br/>[payment_handler.py]"]
  node_oauth["Google OAuth client<br/>OAuth utility<br/>[google_oauth2.py]"]
  node_celery["Celery worker<br/>background processing<br/>[celery.py]"]
  node_database[("Application database<br/>DATABASE_URL")]
end

subgraph group_delivery["Delivery"]
  node_deployment{{"Deployment pipeline<br/>Gunicorn, NGINX &amp; Dokku"}}
end

node_entrypoints -->|"loads"| node_settings
node_entrypoints -->|"serves requests via"| node_routing
node_settings -->|"configures"| node_hosts
node_hosts -->|"selects host routes"| node_routing
node_routing -->|"public requests"| node_web_urls
node_routing -->|"authenticated requests"| node_dashboard_urls
node_web_urls -->|"dispatches"| node_web_views
node_web_views -->|"reads and writes"| node_web_models
node_web_views -->|"renders"| node_web_templates
node_markdown -->|"extends rendering"| node_web_templates
node_dashboard_urls -->|"dispatches"| node_dashboard_views
node_dashboard_views -->|"reads and writes"| node_dashboard_models
node_dashboard_views -->|"renders"| node_dashboard_templates
node_dashboard_views -->|"initiates payments"| node_payments
node_dashboard_views -->|"uses sign-in client"| node_oauth
node_admin -->|"manages"| node_dashboard_models
node_migrations -->|"evolves schema"| node_dashboard_models
node_web_models -->|"persists via ORM"| node_database
node_dashboard_models -->|"persists via ORM"| node_database
node_celery -->|"runs async work for"| node_dashboard_models
node_deployment -->|"runs WSGI process"| node_entrypoints

click node_entrypoints "https://github.com/ryuga/university-hub/blob/master/manage.py"
click node_routing "https://github.com/ryuga/university-hub/blob/master/core/urls.py"
click node_settings "https://github.com/ryuga/university-hub/blob/master/core/settings.py"
click node_hosts "https://github.com/ryuga/university-hub/blob/master/core/hosts.py"
click node_web_urls "https://github.com/ryuga/university-hub/blob/master/core/apps/web/urls.py"
click node_web_views "https://github.com/ryuga/university-hub/blob/master/core/apps/web/views.py"
click node_web_models "https://github.com/ryuga/university-hub/blob/master/core/apps/web/models.py"
click node_web_templates "https://github.com/ryuga/university-hub/tree/master/core/apps/web/templates/web"
click node_markdown "https://github.com/ryuga/university-hub/blob/master/core/apps/web/templatetags/markdown_extras.py"
click node_dashboard_urls "https://github.com/ryuga/university-hub/blob/master/core/apps/dashboard/urls.py"
click node_dashboard_views "https://github.com/ryuga/university-hub/blob/master/core/apps/dashboard/views.py"
click node_dashboard_models "https://github.com/ryuga/university-hub/blob/master/core/apps/dashboard/models.py"
click node_dashboard_templates "https://github.com/ryuga/university-hub/tree/master/core/apps/dashboard/templates/dashboard"
click node_admin "https://github.com/ryuga/university-hub/blob/master/core/apps/dashboard/admin.py"
click node_migrations "https://github.com/ryuga/university-hub/tree/master/core/apps/dashboard/migrations"
click node_payments "https://github.com/ryuga/university-hub/blob/master/utils/payment_handler.py"
click node_oauth "https://github.com/ryuga/university-hub/blob/master/utils/google_oauth2.py"
click node_celery "https://github.com/ryuga/university-hub/blob/master/core/celery.py"
click node_deployment "https://github.com/ryuga/university-hub/blob/master/Procfile"

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_entrypoints,node_routing,node_settings,node_hosts toneBlue
class node_web_urls,node_web_views,node_web_models,node_web_templates,node_markdown toneAmber
class node_dashboard_urls,node_dashboard_views,node_dashboard_models,node_dashboard_templates,node_admin,node_migrations toneMint
class node_payments,node_oauth,node_celery,node_database toneRose
class node_deployment toneIndigo
```

## Components

### Django project

- [Runtime entry points](https://github.com/ryuga/university-hub/blob/master/manage.py): Python entrypoints · Management, WSGI, and ASGI process entry points. · `manage.py`
- [Root routing](https://github.com/ryuga/university-hub/blob/master/core/urls.py): Django URLs · `core/urls.py`
- [Project settings](https://github.com/ryuga/university-hub/blob/master/core/settings.py): Django settings · Configures hosts, credentials, database, and installed services. · `core/settings.py`
- [Host routing](https://github.com/ryuga/university-hub/blob/master/core/hosts.py): django-hosts · `core/hosts.py`

### Public website

- [Public routes](https://github.com/ryuga/university-hub/blob/master/core/apps/web/urls.py): Django URLs · `core/apps/web/urls.py`
- [Public content views](https://github.com/ryuga/university-hub/blob/master/core/apps/web/views.py): Django views · Department content and visitor authentication pages. · `core/apps/web/views.py`
- [Public content models](https://github.com/ryuga/university-hub/blob/master/core/apps/web/models.py): Django ORM · `core/apps/web/models.py`
- [Public templates](https://github.com/ryuga/university-hub/tree/master/core/apps/web/templates/web): Django templates · Server-rendered public pages and base layout. · `core/apps/web/templates/web`
- [Markdown tags](https://github.com/ryuga/university-hub/blob/master/core/apps/web/templatetags/markdown_extras.py): template tags · `core/apps/web/templatetags/markdown_extras.py`

### Student dashboard

- [Dashboard routes](https://github.com/ryuga/university-hub/blob/master/core/apps/dashboard/urls.py): Django URLs · `core/apps/dashboard/urls.py`
- [Dashboard views](https://github.com/ryuga/university-hub/blob/master/core/apps/dashboard/views.py): Django views · Registration, schedules, profiles, and payment status. · `core/apps/dashboard/views.py`
- [Student lifecycle models](https://github.com/ryuga/university-hub/blob/master/core/apps/dashboard/models.py): Django ORM · `core/apps/dashboard/models.py`
- [Dashboard templates](https://github.com/ryuga/university-hub/tree/master/core/apps/dashboard/templates/dashboard): Django templates · `core/apps/dashboard/templates/dashboard`
- [Registration admin](https://github.com/ryuga/university-hub/blob/master/core/apps/dashboard/admin.py): Django admin · `core/apps/dashboard/admin.py`
- [Schema migrations](https://github.com/ryuga/university-hub/tree/master/core/apps/dashboard/migrations): Django migrations · Deployable dashboard schema history. · `core/apps/dashboard/migrations`

### Integrations & workers

- [Payment service](https://github.com/ryuga/university-hub/blob/master/utils/payment_handler.py): payment utilities · Encapsulates Paytm transactions and checksum support. · `utils/payment_handler.py`
- [Google OAuth client](https://github.com/ryuga/university-hub/blob/master/utils/google_oauth2.py): OAuth utility · `utils/google_oauth2.py`
- [Celery worker](https://github.com/ryuga/university-hub/blob/master/core/celery.py): background processing · Project Celery configuration and dashboard asynchronous work. · `core/celery.py`
- **Application database**: DATABASE_URL · Django ORM persistence boundary.

### Delivery

- [Deployment pipeline](https://github.com/ryuga/university-hub/blob/master/Procfile): Gunicorn, NGINX & Dokku · WSGI serving and Dokku/GitHub Actions deployment. · `Procfile`

## Connections

- Runtime entry points → Project settings: loads
- Runtime entry points → Root routing: serves requests via
- Project settings → Host routing: configures
- Host routing → Root routing: selects host routes
- Root routing → Public routes: public requests
- Root routing → Dashboard routes: authenticated requests
- Public routes → Public content views: dispatches
- Public content views → Public content models: reads and writes
- Public content views → Public templates: renders
- Markdown tags → Public templates: extends rendering
- Dashboard routes → Dashboard views: dispatches
- Dashboard views → Student lifecycle models: reads and writes
- Dashboard views → Dashboard templates: renders
- Dashboard views → Payment service: initiates payments
- Dashboard views → Google OAuth client: uses sign-in client
- Registration admin → Student lifecycle models: manages
- Schema migrations → Student lifecycle models: evolves schema
- Public content models → Application database: persists via ORM
- Student lifecycle models → Application database: persists via ORM
- Celery worker → Student lifecycle models: runs async work for
- Deployment pipeline → Runtime entry points: runs WSGI process
