# wilfex81/civic-evidence architecture

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

- Interactive diagram: https://gitdiagram.com/wilfex81/civic-evidence
- Repository: https://github.com/wilfex81/civic-evidence

## Overview

Civic Evidence & Verification is a Django server-rendered civic-record and community-reporting application. Residents browse or search projects, inspect official records alongside dated observations and typed supporting-evidence notes, review a computed aligned/conflicting/stale/no-evidence verdict, then submit an observation. The README documents the verdict rules, anonymous submissions, reporter counts and next-step guidance, Kiswahili support, an admin interface, and JSON demo-data seeding. The views, forms, settings, routing, and seed command are sampled; model and template behavior is represented from the README and tree.

Main entry points: [`evidence/views.py`](https://github.com/wilfex81/civic-evidence/blob/main/evidence/views.py) (Browse, detail, submit), [`evidence/models.py`](https://github.com/wilfex81/civic-evidence/blob/main/evidence/models.py) (Community observation), [`evidence/management/commands/seed_data.py`](https://github.com/wilfex81/civic-evidence/blob/main/evidence/management/commands/seed_data.py) (Demo data loader), [`evidence/templates/evidence`](https://github.com/wilfex81/civic-evidence/tree/main/evidence/templates/evidence) (Server-rendered pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_root_urls["Project URL routing<br/>[urls.py]"]
  node_app_urls["Evidence routes<br/>[urls.py]"]
  node_views["Browse, detail, submit<br/>[views.py]"]
  node_templates["Server-rendered pages"]
  node_style["Responsive styling<br/>[style.css]"]
  node_forms["Observation form<br/>[forms.py]"]
end

subgraph group_evidence["Evidence domain"]
  node_project["Official project record<br/>[models.py]"]
  node_observation["Community observation<br/>[models.py]"]
  node_verdict["Evidence status logic<br/>[models.py]"]
  node_database[("SQLite records<br/>[settings.py]")]
end

subgraph group_operations["Operations and access"]
  node_admin["Admin inspection<br/>[admin.py]"]
  node_seed["Demo data loader<br/>[seed_data.py]"]
  node_project_json["Project seed data<br/>[projects.json]"]
  node_observation_json["Observation seed data<br/>[observations.json]"]
  node_translations["Kiswahili translations<br/>[django.po]"]
end

node_resident(("Resident / reviewer"))

node_resident -->|"requests pages"| node_root_urls
node_root_urls -->|"routes requests"| node_app_urls
node_app_urls -->|"dispatches"| node_views
node_views -->|"queries projects"| node_project
node_views -->|"loads observations"| node_observation
node_views -->|"computes verdict"| node_verdict
node_views -->|"validates submissions"| node_forms
node_forms -->|"creates report"| node_observation
node_views -->|"renders pages"| node_templates
node_templates -->|"presents evidence"| node_resident
node_templates -->|"uses styling"| node_style
node_project -->|"reads records"| node_database
node_observation -->|"reads and writes"| node_database
node_admin -->|"inspects records"| node_project
node_admin -->|"inspects reports"| node_observation
node_seed -->|"reads projects"| node_project_json
node_seed -->|"reads reports"| node_observation_json
node_seed -->|"creates or updates"| node_project
node_seed -->|"creates or updates"| node_observation
node_views -.->|"translates interface"| node_translations

click node_root_urls "https://github.com/wilfex81/civic-evidence/blob/main/civic_evidence/urls.py"
click node_app_urls "https://github.com/wilfex81/civic-evidence/blob/main/evidence/urls.py"
click node_views "https://github.com/wilfex81/civic-evidence/blob/main/evidence/views.py"
click node_templates "https://github.com/wilfex81/civic-evidence/tree/main/evidence/templates/evidence"
click node_style "https://github.com/wilfex81/civic-evidence/blob/main/evidence/static/evidence/css/style.css"
click node_forms "https://github.com/wilfex81/civic-evidence/blob/main/evidence/forms.py"
click node_project "https://github.com/wilfex81/civic-evidence/blob/main/evidence/models.py"
click node_observation "https://github.com/wilfex81/civic-evidence/blob/main/evidence/models.py"
click node_verdict "https://github.com/wilfex81/civic-evidence/blob/main/evidence/models.py"
click node_database "https://github.com/wilfex81/civic-evidence/blob/main/civic_evidence/settings.py"
click node_admin "https://github.com/wilfex81/civic-evidence/blob/main/evidence/admin.py"
click node_seed "https://github.com/wilfex81/civic-evidence/blob/main/evidence/management/commands/seed_data.py"
click node_project_json "https://github.com/wilfex81/civic-evidence/blob/main/data/projects.json"
click node_observation_json "https://github.com/wilfex81/civic-evidence/blob/main/data/observations.json"
click node_translations "https://github.com/wilfex81/civic-evidence/blob/main/locale/sw/LC_MESSAGES/django.po"

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_root_urls,node_app_urls,node_views,node_templates,node_style,node_forms,node_resident toneBlue
class node_project,node_observation,node_verdict,node_database toneAmber
class node_admin,node_seed,node_project_json,node_observation_json,node_translations toneMint
```

## Components

### Web experience

- [Project URL routing](https://github.com/wilfex81/civic-evidence/blob/main/civic_evidence/urls.py): `civic_evidence/urls.py`
- [Evidence routes](https://github.com/wilfex81/civic-evidence/blob/main/evidence/urls.py): `evidence/urls.py`
- [Browse, detail, submit](https://github.com/wilfex81/civic-evidence/blob/main/evidence/views.py): `evidence/views.py`
- [Server-rendered pages](https://github.com/wilfex81/civic-evidence/tree/main/evidence/templates/evidence): `evidence/templates/evidence`
- [Responsive styling](https://github.com/wilfex81/civic-evidence/blob/main/evidence/static/evidence/css/style.css): `evidence/static/evidence/css/style.css`
- [Observation form](https://github.com/wilfex81/civic-evidence/blob/main/evidence/forms.py): `evidence/forms.py`

### Evidence domain

- [Official project record](https://github.com/wilfex81/civic-evidence/blob/main/evidence/models.py): `evidence/models.py`
- [Community observation](https://github.com/wilfex81/civic-evidence/blob/main/evidence/models.py): `evidence/models.py`
- [Evidence status logic](https://github.com/wilfex81/civic-evidence/blob/main/evidence/models.py): `evidence/models.py`
- [SQLite records](https://github.com/wilfex81/civic-evidence/blob/main/civic_evidence/settings.py): `civic_evidence/settings.py`

### Operations and access

- [Admin inspection](https://github.com/wilfex81/civic-evidence/blob/main/evidence/admin.py): `evidence/admin.py`
- [Demo data loader](https://github.com/wilfex81/civic-evidence/blob/main/evidence/management/commands/seed_data.py): `evidence/management/commands/seed_data.py`
- [Project seed data](https://github.com/wilfex81/civic-evidence/blob/main/data/projects.json): `data/projects.json`
- [Observation seed data](https://github.com/wilfex81/civic-evidence/blob/main/data/observations.json): `data/observations.json`
- [Kiswahili translations](https://github.com/wilfex81/civic-evidence/blob/main/locale/sw/LC_MESSAGES/django.po): `locale/sw/LC_MESSAGES/django.po`

### Other components

- **Resident / reviewer**

## Connections

- Resident / reviewer → Project URL routing: requests pages
- Project URL routing → Evidence routes: routes requests
- Evidence routes → Browse, detail, submit: dispatches
- Browse, detail, submit → Official project record: queries projects
- Browse, detail, submit → Community observation: loads observations
- Browse, detail, submit → Evidence status logic: computes verdict
- Browse, detail, submit → Observation form: validates submissions
- Observation form → Community observation: creates report
- Browse, detail, submit → Server-rendered pages: renders pages
- Server-rendered pages → Resident / reviewer: presents evidence
- Server-rendered pages → Responsive styling: uses styling
- Official project record → SQLite records: reads records
- Community observation → SQLite records: reads and writes
- Admin inspection → Official project record: inspects records
- Admin inspection → Community observation: inspects reports
- Demo data loader → Project seed data: reads projects
- Demo data loader → Observation seed data: reads reports
- Demo data loader → Official project record: creates or updates
- Demo data loader → Community observation: creates or updates
- Browse, detail, submit → Kiswahili translations: translates interface
