# chiefchula/resource-center architecture

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

- Interactive diagram: https://gitdiagram.com/chiefchula/resource-center
- Repository: https://github.com/chiefchula/resource-center

## Overview

Rescue Center Management System is a Flask app for managing donated and purchased inventory across assigned rescue centers. Users register, edit, and decommission items; transfers move through source request, administrator approval, and destination receipt; administrators manage users and reference data. Blueprints handle web requests and use shared forms and SQLAlchemy models for validation and persistence, while the dashboard summarizes inventory and transfer activity. The transfer blueprint and model details were not sampled, so their internal wiring is shown only at the documented workflow and persistence level.

Main entry points: [`app/blueprints/transfers.py`](https://github.com/chiefchula/resource-center/blob/main/app/blueprints/transfers.py) (Transfer approvals), [`app/blueprints/admin.py`](https://github.com/chiefchula/resource-center/blob/main/app/blueprints/admin.py) (Admin management), [`app/blueprints/items.py`](https://github.com/chiefchula/resource-center/blob/main/app/blueprints/items.py) (Item workflows), [`app/models.py`](https://github.com/chiefchula/resource-center/blob/main/app/models.py) (Domain models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web workflows"]
  node_auth["Authentication<br/>[auth.py]"]
  node_dashboard["Dashboard<br/>[main.py]"]
  node_templates["Web templates"]
end

subgraph group_domain["Inventory domain"]
  node_items["Item workflows<br/>[items.py]"]
  node_transfers["Transfer approvals<br/>[transfers.py]"]
  node_models["Domain models<br/>[models.py]"]
  node_database[("Application database")]
end

subgraph group_admin["Administration"]
  node_admin_ops["Admin management<br/>[admin.py]"]
  node_wards["Ward reference data<br/>[subcounties.py]"]
end

subgraph group_shared["Shared services"]
  node_app["Flask app<br/>[__init__.py]"]
  node_forms["Request forms<br/>[forms.py]"]
  node_access["Access checks<br/>[decorators.py]"]
end

node_center_user(("Center user"))
node_admin_user(("Administrator"))

node_center_user -->|"signs in"| node_auth
node_admin_user -->|"signs in"| node_auth
node_center_user -->|"manages items"| node_items
node_center_user -->|"requests transfer"| node_transfers
node_admin_user -->|"reviews transfer"| node_transfers
node_center_user -->|"confirms receipt"| node_transfers
node_admin_user -->|"manages records"| node_admin_ops
node_app -->|"registers routes"| node_auth
node_app -->|"registers routes"| node_dashboard
node_app -->|"registers routes"| node_items
node_app -->|"registers routes"| node_transfers
node_app -->|"registers routes"| node_admin_ops
node_auth -->|"queries users"| node_models
node_auth -->|"renders pages"| node_templates
node_dashboard -->|"queries summaries"| node_models
node_dashboard -->|"renders dashboard"| node_templates
node_items -->|"validates input"| node_forms
node_items -->|"checks center access"| node_access
node_items -->|"reads and updates"| node_models
node_items -->|"renders pages"| node_templates
node_transfers -->|"validates input"| node_forms
node_transfers -->|"checks access"| node_access
node_transfers -->|"records transfer stages"| node_models
node_transfers -->|"renders pages"| node_templates
node_admin_ops -->|"validates input"| node_forms
node_admin_ops -->|"checks admin access"| node_access
node_admin_ops -->|"manages records"| node_models
node_admin_ops -->|"loads ward choices"| node_wards
node_admin_ops -->|"renders pages"| node_templates
node_models -->|"reads and writes"| node_database

click node_app "https://github.com/chiefchula/resource-center/blob/main/app/__init__.py"
click node_auth "https://github.com/chiefchula/resource-center/blob/main/app/blueprints/auth.py"
click node_dashboard "https://github.com/chiefchula/resource-center/blob/main/app/blueprints/main.py"
click node_items "https://github.com/chiefchula/resource-center/blob/main/app/blueprints/items.py"
click node_transfers "https://github.com/chiefchula/resource-center/blob/main/app/blueprints/transfers.py"
click node_admin_ops "https://github.com/chiefchula/resource-center/blob/main/app/blueprints/admin.py"
click node_forms "https://github.com/chiefchula/resource-center/blob/main/app/forms.py"
click node_access "https://github.com/chiefchula/resource-center/blob/main/app/decorators.py"
click node_models "https://github.com/chiefchula/resource-center/blob/main/app/models.py"
click node_templates "https://github.com/chiefchula/resource-center/tree/main/app/templates"
click node_wards "https://github.com/chiefchula/resource-center/blob/main/app/data/subcounties.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_auth,node_dashboard,node_templates,node_center_user toneBlue
class node_items,node_transfers,node_models,node_database toneAmber
class node_admin_ops,node_wards toneMint
class node_app,node_forms,node_access toneRose
class node_admin_user toneIndigo
```

## Components

### Web workflows

- [Authentication](https://github.com/chiefchula/resource-center/blob/main/app/blueprints/auth.py): `app/blueprints/auth.py`
- [Dashboard](https://github.com/chiefchula/resource-center/blob/main/app/blueprints/main.py): `app/blueprints/main.py`
- [Web templates](https://github.com/chiefchula/resource-center/tree/main/app/templates): `app/templates`

### Inventory domain

- [Item workflows](https://github.com/chiefchula/resource-center/blob/main/app/blueprints/items.py): `app/blueprints/items.py`
- [Transfer approvals](https://github.com/chiefchula/resource-center/blob/main/app/blueprints/transfers.py): `app/blueprints/transfers.py`
- [Domain models](https://github.com/chiefchula/resource-center/blob/main/app/models.py): `app/models.py`
- **Application database**

### Administration

- [Admin management](https://github.com/chiefchula/resource-center/blob/main/app/blueprints/admin.py): `app/blueprints/admin.py`
- [Ward reference data](https://github.com/chiefchula/resource-center/blob/main/app/data/subcounties.py): `app/data/subcounties.py`

### Shared services

- [Flask app](https://github.com/chiefchula/resource-center/blob/main/app/__init__.py): `app/__init__.py`
- [Request forms](https://github.com/chiefchula/resource-center/blob/main/app/forms.py): `app/forms.py`
- [Access checks](https://github.com/chiefchula/resource-center/blob/main/app/decorators.py): `app/decorators.py`

### Other components

- **Center user**
- **Administrator**

## Connections

- Center user → Authentication: signs in
- Administrator → Authentication: signs in
- Center user → Item workflows: manages items
- Center user → Transfer approvals: requests transfer
- Administrator → Transfer approvals: reviews transfer
- Center user → Transfer approvals: confirms receipt
- Administrator → Admin management: manages records
- Flask app → Authentication: registers routes
- Flask app → Dashboard: registers routes
- Flask app → Item workflows: registers routes
- Flask app → Transfer approvals: registers routes
- Flask app → Admin management: registers routes
- Authentication → Domain models: queries users
- Authentication → Web templates: renders pages
- Dashboard → Domain models: queries summaries
- Dashboard → Web templates: renders dashboard
- Item workflows → Request forms: validates input
- Item workflows → Access checks: checks center access
- Item workflows → Domain models: reads and updates
- Item workflows → Web templates: renders pages
- Transfer approvals → Request forms: validates input
- Transfer approvals → Access checks: checks access
- Transfer approvals → Domain models: records transfer stages
- Transfer approvals → Web templates: renders pages
- Admin management → Request forms: validates input
- Admin management → Access checks: checks admin access
- Admin management → Domain models: manages records
- Admin management → Ward reference data: loads ward choices
- Admin management → Web templates: renders pages
- Domain models → Application database: reads and writes
