# apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense architecture

> Architecture diagram of the GitHub repository apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense
- Repository: https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense

## Overview

CitiSense is a bilingual feedback-analysis web application: users authenticate or enter a guest dashboard, explore sentiment visualizations and feedback records, and analysts can manage model versions and retraining. The documented product also includes English/Tagalog sentiment classification and AI-generated summaries/themes. The graph combines visible frontend/API calls with README-documented capabilities; unsampled pages and optional AI integrations are shown only where the tree or README supports them.

Main entry points: [`frontend/src/main.tsx`](https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/main.tsx) (App routing), [`mysite/api/views.py`](https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/mysite/api/views.py) (Feedback API), [`frontend/src/pages/Dashboard/GuestDashboard.tsx`](https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/pages/Dashboard/GuestDashboard.tsx) (Guest dashboard), [`mysite/drf/models.py`](https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/mysite/drf/models.py) (Feedback records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_webapp["App routing<br/>[main.tsx]"]
end

subgraph group_auth["Identity"]
  node_authui["Auth forms<br/>[login-form.tsx]"]
  node_authstate["Auth context"]
  node_authapi["Auth endpoints<br/>[views.py]"]
end

subgraph group_analysis["Feedback analysis"]
  node_guestdash["Guest dashboard<br/>[GuestDashboard.tsx]"]
  node_chartdata["Chart data hook"]
  node_visuals["Sentiment charts"]
  node_servicechart["Service chart<br/>[service.tsx]"]
  node_feedbacktable["Feedback table<br/>[DataTablePage.tsx]"]
  node_summarization["Summaries and themes"]
  node_llm{{"Llama summarizer"}}
end

subgraph group_models["Model management"]
  node_modelpages["Model selection<br/>[ModelSelection.tsx]"]
  node_retrainui["Retraining UI<br/>[AIRetrain.tsx]"]
  node_modelapi["Model version API<br/>[views.py]"]
  node_nlpmodel{{"Bilingual NLP model"}}
end

subgraph group_backend["API and persistence"]
  node_api["Feedback API<br/>[views.py]"]
  node_serializers["API serializers<br/>[serializers.py]"]
  node_feedbackmodels[("Feedback records<br/>[models.py]")]
  node_sentiment["Sentiment inference<br/>[utils.py]"]
end

node_user(("IRAD stakeholder"))

node_user -->|"opens"| node_webapp
node_webapp -->|"routes to"| node_authui
node_webapp -->|"routes to"| node_guestdash
node_webapp -->|"routes to"| node_feedbacktable
node_webapp -->|"routes to"| node_modelpages
node_webapp -->|"routes to"| node_retrainui
node_authui -->|"uses"| node_authstate
node_authstate -->|"requests"| node_authapi
node_guestdash -->|"fetches filters"| node_api
node_guestdash -.->|"uses"| node_chartdata
node_chartdata -->|"fetches chart data"| node_api
node_guestdash -->|"renders"| node_visuals
node_guestdash -->|"renders"| node_servicechart
node_feedbacktable -.->|"requests records"| node_api
node_api -->|"serializes"| node_serializers
node_api -->|"queries"| node_feedbackmodels
node_feedbackmodels -->|"calls"| node_sentiment
node_feedbackmodels -.->|"classifies feedback"| node_nlpmodel
node_modelpages -.->|"manages versions"| node_modelapi
node_retrainui -.->|"requests retraining"| node_modelapi
node_modelapi -->|"loads versions"| node_feedbackmodels
node_modelapi -.->|"trains model"| node_nlpmodel
node_api -.->|"provides analysis data"| node_summarization
node_summarization -.->|"generates themes"| node_llm

click node_webapp "https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/main.tsx"
click node_authui "https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/components/auth/AuthenticationForms/login-form.tsx"
click node_authstate "https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/context/AuthenticationContext.tsx"
click node_authapi "https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/mysite/authentication/views.py"
click node_guestdash "https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/pages/Dashboard/GuestDashboard.tsx"
click node_chartdata "https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/hooks/useDashboardCharts.ts"
click node_visuals "https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/components/dashboard/charts/sentimenttrends.tsx"
click node_servicechart "https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/components/dashboard/charts/service.tsx"
click node_feedbacktable "https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/pages/DataTable/DataTablePage.tsx"
click node_api "https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/mysite/api/views.py"
click node_serializers "https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/mysite/api/serializers.py"
click node_feedbackmodels "https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/mysite/drf/models.py"
click node_sentiment "https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/mysite/drf/utils.py"
click node_modelpages "https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/pages/ModelSelection/ModelSelection.tsx"
click node_retrainui "https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/pages/AIRetrain/AIRetrain.tsx"
click node_modelapi "https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/mysite/api/views.py"
click node_summarization "https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/components/dashboard/charts/ThematicAnalysis.tsx"

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_webapp toneBlue
class node_authui,node_authstate,node_authapi toneAmber
class node_guestdash,node_chartdata,node_visuals,node_servicechart,node_feedbacktable,node_summarization,node_llm toneMint
class node_modelpages,node_retrainui,node_modelapi,node_nlpmodel toneRose
class node_api,node_serializers,node_feedbackmodels,node_sentiment,node_user toneIndigo
```

## Components

### Web application

- [App routing](https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/main.tsx): `frontend/src/main.tsx`

### Identity

- [Auth forms](https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/components/auth/AuthenticationForms/login-form.tsx): `frontend/src/components/auth/AuthenticationForms/login-form.tsx`
- [Auth context](https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/context/AuthenticationContext.tsx): `frontend/src/context/AuthenticationContext.tsx`
- [Auth endpoints](https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/mysite/authentication/views.py): `mysite/authentication/views.py`

### Feedback analysis

- [Guest dashboard](https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/pages/Dashboard/GuestDashboard.tsx): `frontend/src/pages/Dashboard/GuestDashboard.tsx`
- [Chart data hook](https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/hooks/useDashboardCharts.ts): `frontend/src/hooks/useDashboardCharts.ts`
- [Sentiment charts](https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/components/dashboard/charts/sentimenttrends.tsx): `frontend/src/components/dashboard/charts/sentimenttrends.tsx`
- [Service chart](https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/components/dashboard/charts/service.tsx): `frontend/src/components/dashboard/charts/service.tsx`
- [Feedback table](https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/pages/DataTable/DataTablePage.tsx): `frontend/src/pages/DataTable/DataTablePage.tsx`
- [Summaries and themes](https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/components/dashboard/charts/ThematicAnalysis.tsx): `frontend/src/components/dashboard/charts/ThematicAnalysis.tsx`
- **Llama summarizer**

### Model management

- [Model selection](https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/pages/ModelSelection/ModelSelection.tsx): `frontend/src/pages/ModelSelection/ModelSelection.tsx`
- [Retraining UI](https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/frontend/src/pages/AIRetrain/AIRetrain.tsx): `frontend/src/pages/AIRetrain/AIRetrain.tsx`
- [Model version API](https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/mysite/api/views.py): `mysite/api/views.py`
- **Bilingual NLP model**

### API and persistence

- [Feedback API](https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/mysite/api/views.py): `mysite/api/views.py`
- [API serializers](https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/mysite/api/serializers.py): `mysite/api/serializers.py`
- [Feedback records](https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/mysite/drf/models.py): `mysite/drf/models.py`
- [Sentiment inference](https://github.com/apc-socit/apc_2025_2026_t1_mi232_g07-dost-citisense/blob/main/mysite/drf/utils.py): `mysite/drf/utils.py`

### Other components

- **IRAD stakeholder**

## Connections

- IRAD stakeholder → App routing: opens (evidence: `frontend/src/main.tsx`)
- App routing → Auth forms: routes to (evidence: `frontend/src/main.tsx`)
- App routing → Guest dashboard: routes to (evidence: `frontend/src/main.tsx`)
- App routing → Feedback table: routes to (evidence: `frontend/src/main.tsx`)
- App routing → Model selection: routes to (evidence: `frontend/src/main.tsx`)
- App routing → Retraining UI: routes to (evidence: `frontend/src/main.tsx`)
- Auth forms → Auth context: uses (evidence: `frontend/src/components/auth/AuthenticationForms/login-form.tsx`)
- Auth context → Auth endpoints: requests (evidence: `frontend/src/context/AuthenticationContext.tsx`)
- Guest dashboard → Feedback API: fetches filters (evidence: `frontend/src/pages/Dashboard/GuestDashboard.tsx`)
- Guest dashboard → Chart data hook: uses
- Chart data hook → Feedback API: fetches chart data (evidence: `frontend/src/hooks/useDashboardCharts.ts`)
- Guest dashboard → Sentiment charts: renders (evidence: `frontend/src/pages/Dashboard/GuestDashboard.tsx`)
- Guest dashboard → Service chart: renders (evidence: `frontend/src/pages/Dashboard/GuestDashboard.tsx`)
- Feedback table → Feedback API: requests records
- Feedback API → API serializers: serializes (evidence: `mysite/api/views.py`)
- Feedback API → Feedback records: queries (evidence: `mysite/api/views.py`)
- Feedback records → Sentiment inference: calls (evidence: `mysite/drf/models.py`)
- Feedback records → Bilingual NLP model: classifies feedback (evidence: `README.md`)
- Model selection → Model version API: manages versions
- Retraining UI → Model version API: requests retraining
- Model version API → Feedback records: loads versions (evidence: `mysite/api/views.py`)
- Model version API → Bilingual NLP model: trains model (evidence: `README.md`)
- Feedback API → Summaries and themes: provides analysis data
- Summaries and themes → Llama summarizer: generates themes (evidence: `README.md`)
