# dbsrhks85/voice-complaint-ai architecture

> Architecture diagram of the GitHub repository dbsrhks85/voice-complaint-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dbsrhks85/voice-complaint-ai
- Repository: https://github.com/dbsrhks85/voice-complaint-ai

## Overview

Smart Minwon 24 is a voice-first civic complaint service: residents authenticate, record a complaint, review its transcription and AI classification, add location or attachments, and submit it; officials manage cases in a web dashboard. The backend coordinates speech recognition, classification, persistence, status updates, statistics, and notifications. The README documents mobile capabilities whose Flutter implementation files are not present in this tree, so those mobile subsystems are represented at the enclosing app path; backend integration details are limited to the sampled sources and documented endpoints.

Main entry points: [`admin-web/src/App.jsx`](https://github.com/dbsrhks85/voice-complaint-ai/blob/main/admin-web/src/App.jsx) (Admin dashboard), [`mobile-app`](https://github.com/dbsrhks85/voice-complaint-ai/tree/main/mobile-app) (Mobile app), [`backend-server/main.py`](https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/main.py) (Complaint API), [`backend-server/database.py`](https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/database.py) (Database client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_citizen["Citizen app"]
  node_mobile_app["Mobile app"]
  node_voice_capture["Voice capture"]
  node_case_review["Review and submit"]
  node_location_files["Location and files"]
  node_push_receive["Push alerts"]
end

subgraph group_backend["Backend services"]
  node_api["Complaint API<br/>[main.py]"]
  node_stt["Speech recognition<br/>[stt_engine.py]"]
  node_classification["AI classification<br/>[nlp_engine.py]"]
  node_kakao_login["Kakao login<br/>[auth.py]"]
  node_user_accounts["User accounts<br/>[user_service.py]"]
  node_admin_login["Admin authentication<br/>[admin_auth.py]"]
  node_admin_security["Token security<br/>[security.py]"]
  node_admin_guard["Admin access control<br/>[admin_auth.py]"]
  node_case_service["Case workflow<br/>[main.py]"]
  node_push_service["Status notifications<br/>[main.py]"]
  node_kakao["Kakao services<br/>[kakao_service.py]"]
  node_firebase["Firebase FCM"]
  node_live_events["Live case events<br/>[main.py]"]
end

subgraph group_data_ai["AI and data"]
  node_database_client["Database client<br/>[database.py]"]
  node_complaint_store[("Supabase records")]
  node_openai["OpenAI APIs"]
end

subgraph group_admin["Administration"]
  node_dashboard["Admin dashboard<br/>[App.jsx]"]
  node_case_views["Case management<br/>[App.jsx]"]
  node_analytics["Statistics and map<br/>[App.jsx]"]
end

node_resident(("Resident"))
node_official(("Public official"))

node_resident -->|"uses"| node_mobile_app
node_mobile_app -->|"records audio"| node_voice_capture
node_mobile_app -->|"reviews results"| node_case_review
node_mobile_app -->|"adds context"| node_location_files
node_mobile_app -->|"submits requests"| node_api
node_api -->|"transcribes audio"| node_stt
node_api -->|"classifies text"| node_classification
node_api -->|"handles submissions"| node_case_service
node_stt -->|"calls Whisper"| node_openai
node_classification -->|"calls GPT"| node_openai
node_classification -->|"reads departments"| node_database_client
node_case_service -->|"stores cases"| node_database_client
node_database_client -.->|"accesses records"| node_complaint_store
node_resident -->|"authenticates"| node_kakao_login
node_kakao_login -->|"fetches profile"| node_kakao
node_kakao_login -->|"resolves account"| node_user_accounts
node_user_accounts -->|"reads and writes"| node_database_client
node_official -->|"uses"| node_dashboard
node_dashboard -->|"signs in"| node_admin_login
node_admin_login -->|"issues tokens"| node_admin_security
node_admin_login -->|"checks identity"| node_admin_guard
node_dashboard -->|"manages cases"| node_case_views
node_case_views -->|"updates status"| node_api
node_dashboard -->|"views statistics"| node_analytics
node_dashboard -->|"subscribes events"| node_live_events
node_live_events -->|"refreshes cases"| node_dashboard
node_case_service -->|"sends status alerts"| node_push_service
node_push_service -->|"delivers push"| node_firebase
node_firebase -->|"delivers alerts"| node_push_receive
node_push_receive -->|"notifies"| node_resident

click node_mobile_app "https://github.com/dbsrhks85/voice-complaint-ai/tree/main/mobile-app"
click node_voice_capture "https://github.com/dbsrhks85/voice-complaint-ai/tree/main/mobile-app"
click node_case_review "https://github.com/dbsrhks85/voice-complaint-ai/tree/main/mobile-app"
click node_location_files "https://github.com/dbsrhks85/voice-complaint-ai/tree/main/mobile-app"
click node_push_receive "https://github.com/dbsrhks85/voice-complaint-ai/tree/main/mobile-app"
click node_api "https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/main.py"
click node_stt "https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/stt_engine.py"
click node_classification "https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/nlp_engine.py"
click node_kakao_login "https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/routers/auth.py"
click node_user_accounts "https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/services/user_service.py"
click node_admin_login "https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/routers/admin_auth.py"
click node_admin_security "https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/core/security.py"
click node_admin_guard "https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/core/admin_auth.py"
click node_case_service "https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/main.py"
click node_push_service "https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/main.py"
click node_database_client "https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/database.py"
click node_kakao "https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/services/kakao_service.py"
click node_dashboard "https://github.com/dbsrhks85/voice-complaint-ai/blob/main/admin-web/src/App.jsx"
click node_case_views "https://github.com/dbsrhks85/voice-complaint-ai/blob/main/admin-web/src/App.jsx"
click node_analytics "https://github.com/dbsrhks85/voice-complaint-ai/blob/main/admin-web/src/App.jsx"
click node_live_events "https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/main.py"

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_mobile_app,node_voice_capture,node_case_review,node_location_files,node_push_receive toneBlue
class node_api,node_stt,node_classification,node_kakao_login,node_user_accounts,node_admin_login,node_admin_security,node_admin_guard,node_case_service,node_push_service,node_kakao,node_firebase,node_live_events toneAmber
class node_database_client,node_complaint_store,node_openai toneMint
class node_dashboard,node_case_views,node_analytics toneRose
class node_resident,node_official toneIndigo
```

## Components

### Citizen app

- [Mobile app](https://github.com/dbsrhks85/voice-complaint-ai/tree/main/mobile-app): `mobile-app`
- [Voice capture](https://github.com/dbsrhks85/voice-complaint-ai/tree/main/mobile-app): `mobile-app`
- [Review and submit](https://github.com/dbsrhks85/voice-complaint-ai/tree/main/mobile-app): `mobile-app`
- [Location and files](https://github.com/dbsrhks85/voice-complaint-ai/tree/main/mobile-app): `mobile-app`
- [Push alerts](https://github.com/dbsrhks85/voice-complaint-ai/tree/main/mobile-app): `mobile-app`

### Backend services

- [Complaint API](https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/main.py): `backend-server/main.py`
- [Speech recognition](https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/stt_engine.py): `backend-server/stt_engine.py`
- [AI classification](https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/nlp_engine.py): `backend-server/nlp_engine.py`
- [Kakao login](https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/routers/auth.py): `backend-server/routers/auth.py`
- [User accounts](https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/services/user_service.py): `backend-server/services/user_service.py`
- [Admin authentication](https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/routers/admin_auth.py): `backend-server/routers/admin_auth.py`
- [Token security](https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/core/security.py): `backend-server/core/security.py`
- [Admin access control](https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/core/admin_auth.py): `backend-server/core/admin_auth.py`
- [Case workflow](https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/main.py): `backend-server/main.py`
- [Status notifications](https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/main.py): `backend-server/main.py`
- [Kakao services](https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/services/kakao_service.py): `backend-server/services/kakao_service.py`
- **Firebase FCM**
- [Live case events](https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/main.py): `backend-server/main.py`

### AI and data

- [Database client](https://github.com/dbsrhks85/voice-complaint-ai/blob/main/backend-server/database.py): `backend-server/database.py`
- **Supabase records**
- **OpenAI APIs**

### Administration

- [Admin dashboard](https://github.com/dbsrhks85/voice-complaint-ai/blob/main/admin-web/src/App.jsx): `admin-web/src/App.jsx`
- [Case management](https://github.com/dbsrhks85/voice-complaint-ai/blob/main/admin-web/src/App.jsx): `admin-web/src/App.jsx`
- [Statistics and map](https://github.com/dbsrhks85/voice-complaint-ai/blob/main/admin-web/src/App.jsx): `admin-web/src/App.jsx`

### Other components

- **Resident**
- **Public official**

## Connections

- Resident → Mobile app: uses
- Mobile app → Voice capture: records audio
- Mobile app → Review and submit: reviews results
- Mobile app → Location and files: adds context
- Mobile app → Complaint API: submits requests
- Complaint API → Speech recognition: transcribes audio (evidence: `backend-server/main.py`)
- Complaint API → AI classification: classifies text (evidence: `backend-server/main.py`)
- Complaint API → Case workflow: handles submissions (evidence: `backend-server/main.py`)
- Speech recognition → OpenAI APIs: calls Whisper (evidence: `backend-server/stt_engine.py`)
- AI classification → OpenAI APIs: calls GPT (evidence: `backend-server/nlp_engine.py`)
- AI classification → Database client: reads departments (evidence: `backend-server/nlp_engine.py`)
- Case workflow → Database client: stores cases (evidence: `backend-server/main.py`)
- Database client → Supabase records: accesses records
- Resident → Kakao login: authenticates
- Kakao login → Kakao services: fetches profile (evidence: `backend-server/routers/auth.py`)
- Kakao login → User accounts: resolves account (evidence: `backend-server/routers/auth.py`)
- User accounts → Database client: reads and writes (evidence: `backend-server/services/user_service.py`)
- Public official → Admin dashboard: uses
- Admin dashboard → Admin authentication: signs in
- Admin authentication → Token security: issues tokens (evidence: `backend-server/routers/admin_auth.py`)
- Admin authentication → Admin access control: checks identity (evidence: `backend-server/routers/admin_auth.py`)
- Admin dashboard → Case management: manages cases (evidence: `admin-web/src/App.jsx`)
- Case management → Complaint API: updates status
- Admin dashboard → Statistics and map: views statistics (evidence: `admin-web/src/App.jsx`)
- Admin dashboard → Live case events: subscribes events (evidence: `admin-web/src/App.jsx`)
- Live case events → Admin dashboard: refreshes cases (evidence: `admin-web/src/App.jsx`)
- Case workflow → Status notifications: sends status alerts (evidence: `backend-server/main.py`)
- Status notifications → Firebase FCM: delivers push
- Firebase FCM → Push alerts: delivers alerts
- Push alerts → Resident: notifies
