# coseat40005project11/projectcoseat_11 architecture

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

- Interactive diagram: https://gitdiagram.com/coseat40005project11/projectcoseat_11
- Repository: https://github.com/coseat40005project11/projectcoseat_11

## Overview

This is a prototype traditional-knowledge repository: source material is parsed into a pending human-review queue, reviewed for consent and access scope, and then made available for discovery. Its web interface supports browsing, search, question-style retrieval, authentication, review, and accessibility features. The graph shows evidenced ingestion and review flows; retrieval is documented as approved-only and extractive, but its connection to the API is not established by the excerpts. Several frontend and API relationships are based on the shown endpoint calls and the SOURCE INDEX; unsampled internals are not assumed.

Main entry points: [`API/app.py`](https://github.com/coseat40005project11/projectcoseat_11/blob/main/API/app.py) (API and review), [`API/auth_routes.py`](https://github.com/coseat40005project11/projectcoseat_11/blob/main/API/auth_routes.py) (Login endpoint), [`FrontEnd/JS/app.js`](https://github.com/coseat40005project11/projectcoseat_11/blob/main/FrontEnd/JS/app.js) (Repository interface), [`Models/ingest_pipeline.py`](https://github.com/coseat40005project11/projectcoseat_11/blob/main/Models/ingest_pipeline.py) (Text ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_web_app["Repository interface<br/>[app.js]"]
  node_icons["Icon rendering<br/>[icons.js]"]
end

subgraph group_ingestion["Knowledge ingestion"]
  node_source_material["Source material"]
  node_text_ingest["Text ingestion<br/>[ingest_pipeline.py]"]
  node_audio_ingest["Audio transcription<br/>[asr_ingest.py]"]
end

subgraph group_governance["Review and governance"]
  node_pending_store[("Pending queue")]
  node_api["API and review<br/>[app.py]"]
  node_governance_rules["Consent governance<br/>[governance.py]"]
  node_tagging["Tag suggestions<br/>[tagging.py]"]
  node_rejected_store[("Rejected records")]
end

subgraph group_identity["Identity and access"]
  node_auth_routes["Login endpoint<br/>[auth_routes.py]"]
  node_auth["Token and password security<br/>[auth.py]"]
  node_user_repo[("User repository<br/>[user_repo.py]")]
  node_policy["Role and access policy<br/>[policy.py]"]
end

subgraph group_discovery["Knowledge discovery"]
  node_approved_store[("Approved repository")]
  node_retrieval["Extractive retrieval<br/>[retrieval.py]"]
end

node_community_user(("Community user"))

node_community_user -->|"uses"| node_web_app
node_web_app -->|"calls endpoints"| node_api
node_web_app -->|"renders icons"| node_icons
node_source_material -.->|"provides sources"| node_text_ingest
node_audio_ingest -->|"reuses cleaning"| node_text_ingest
node_text_ingest -->|"writes records"| node_pending_store
node_audio_ingest -->|"writes transcripts"| node_pending_store
node_api -->|"reads and reviews"| node_pending_store
node_api -->|"writes approvals"| node_approved_store
node_api -->|"records rejections"| node_rejected_store
node_api -->|"checks consent"| node_governance_rules
node_api -->|"requests suggestions"| node_tagging
node_api -->|"registers routes"| node_auth_routes
node_auth_routes -->|"verifies and issues tokens"| node_auth
node_auth_routes -->|"looks up users"| node_user_repo
node_auth_routes -->|"returns access rules"| node_policy
node_auth -->|"checks permissions"| node_policy
node_api -->|"enforces access"| node_policy
node_approved_store -.->|"loads approved records"| node_retrieval

click node_web_app "https://github.com/coseat40005project11/projectcoseat_11/blob/main/FrontEnd/JS/app.js"
click node_icons "https://github.com/coseat40005project11/projectcoseat_11/blob/main/FrontEnd/JS/icons.js"
click node_source_material "https://github.com/coseat40005project11/projectcoseat_11/tree/main/Data"
click node_text_ingest "https://github.com/coseat40005project11/projectcoseat_11/blob/main/Models/ingest_pipeline.py"
click node_audio_ingest "https://github.com/coseat40005project11/projectcoseat_11/blob/main/Models/asr_ingest.py"
click node_pending_store "https://github.com/coseat40005project11/projectcoseat_11/tree/main/AIOutput/pending"
click node_api "https://github.com/coseat40005project11/projectcoseat_11/blob/main/API/app.py"
click node_governance_rules "https://github.com/coseat40005project11/projectcoseat_11/blob/main/API/governance.py"
click node_tagging "https://github.com/coseat40005project11/projectcoseat_11/blob/main/Models/tagging.py"
click node_approved_store "https://github.com/coseat40005project11/projectcoseat_11/tree/main/AIOutput/approved"
click node_rejected_store "https://github.com/coseat40005project11/projectcoseat_11/tree/main/AIOutput/rejected"
click node_retrieval "https://github.com/coseat40005project11/projectcoseat_11/blob/main/Models/retrieval.py"
click node_auth_routes "https://github.com/coseat40005project11/projectcoseat_11/blob/main/API/auth_routes.py"
click node_auth "https://github.com/coseat40005project11/projectcoseat_11/blob/main/API/auth.py"
click node_user_repo "https://github.com/coseat40005project11/projectcoseat_11/blob/main/API/user_repo.py"
click node_policy "https://github.com/coseat40005project11/projectcoseat_11/blob/main/API/policy.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_web_app,node_icons,node_community_user toneBlue
class node_source_material,node_text_ingest,node_audio_ingest toneAmber
class node_pending_store,node_api,node_governance_rules,node_tagging,node_rejected_store toneMint
class node_auth_routes,node_auth,node_user_repo,node_policy toneRose
class node_approved_store,node_retrieval toneIndigo
```

## Components

### Web experience

- [Repository interface](https://github.com/coseat40005project11/projectcoseat_11/blob/main/FrontEnd/JS/app.js): `FrontEnd/JS/app.js`
- [Icon rendering](https://github.com/coseat40005project11/projectcoseat_11/blob/main/FrontEnd/JS/icons.js): `FrontEnd/JS/icons.js`

### Knowledge ingestion

- [Source material](https://github.com/coseat40005project11/projectcoseat_11/tree/main/Data): `Data`
- [Text ingestion](https://github.com/coseat40005project11/projectcoseat_11/blob/main/Models/ingest_pipeline.py): `Models/ingest_pipeline.py`
- [Audio transcription](https://github.com/coseat40005project11/projectcoseat_11/blob/main/Models/asr_ingest.py): `Models/asr_ingest.py`

### Review and governance

- [Pending queue](https://github.com/coseat40005project11/projectcoseat_11/tree/main/AIOutput/pending): `AIOutput/pending`
- [API and review](https://github.com/coseat40005project11/projectcoseat_11/blob/main/API/app.py): `API/app.py`
- [Consent governance](https://github.com/coseat40005project11/projectcoseat_11/blob/main/API/governance.py): `API/governance.py`
- [Tag suggestions](https://github.com/coseat40005project11/projectcoseat_11/blob/main/Models/tagging.py): `Models/tagging.py`
- [Rejected records](https://github.com/coseat40005project11/projectcoseat_11/tree/main/AIOutput/rejected): `AIOutput/rejected`

### Identity and access

- [Login endpoint](https://github.com/coseat40005project11/projectcoseat_11/blob/main/API/auth_routes.py): `API/auth_routes.py`
- [Token and password security](https://github.com/coseat40005project11/projectcoseat_11/blob/main/API/auth.py): `API/auth.py`
- [User repository](https://github.com/coseat40005project11/projectcoseat_11/blob/main/API/user_repo.py): `API/user_repo.py`
- [Role and access policy](https://github.com/coseat40005project11/projectcoseat_11/blob/main/API/policy.py): `API/policy.py`

### Knowledge discovery

- [Approved repository](https://github.com/coseat40005project11/projectcoseat_11/tree/main/AIOutput/approved): `AIOutput/approved`
- [Extractive retrieval](https://github.com/coseat40005project11/projectcoseat_11/blob/main/Models/retrieval.py): `Models/retrieval.py`

### Other components

- **Community user**

## Connections

- Community user → Repository interface: uses (evidence: `README.md`)
- Repository interface → API and review: calls endpoints (evidence: `FrontEnd/JS/app.js`)
- Repository interface → Icon rendering: renders icons (evidence: `FrontEnd/JS/icons.js`)
- Source material → Text ingestion: provides sources (evidence: `Models/ingest_pipeline.py`)
- Audio transcription → Text ingestion: reuses cleaning (evidence: `Models/asr_ingest.py`)
- Text ingestion → Pending queue: writes records (evidence: `Models/ingest_pipeline.py`)
- Audio transcription → Pending queue: writes transcripts (evidence: `Models/asr_ingest.py`)
- API and review → Pending queue: reads and reviews (evidence: `API/app.py`)
- API and review → Approved repository: writes approvals (evidence: `API/app.py`)
- API and review → Rejected records: records rejections (evidence: `API/app.py`)
- API and review → Consent governance: checks consent (evidence: `API/app.py`)
- API and review → Tag suggestions: requests suggestions (evidence: `API/app.py`)
- API and review → Login endpoint: registers routes (evidence: `API/app.py`)
- Login endpoint → Token and password security: verifies and issues tokens (evidence: `API/auth_routes.py`)
- Login endpoint → User repository: looks up users (evidence: `API/auth_routes.py`)
- Login endpoint → Role and access policy: returns access rules (evidence: `API/auth_routes.py`)
- Token and password security → Role and access policy: checks permissions (evidence: `API/auth.py`)
- API and review → Role and access policy: enforces access (evidence: `API/app.py`)
- Approved repository → Extractive retrieval: loads approved records
