# nelfannaveen/suggestion-box architecture

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

- Interactive diagram: https://gitdiagram.com/nelfannaveen/suggestion-box
- Repository: https://github.com/nelfannaveen/suggestion-box

## Overview

This Flask civic-feedback app lets residents submit and track local suggestions, browse and upvote them, while a desktop Command Center can retrieve summary statistics and suggestion records through REST endpoints. The main domain flow is submission with optional photo upload, persistence and tracking-ID assignment, followed by public tracking and community voting; a separate reporting branch exposes aggregates and recent records. The supplied evidence shows these capabilities in app.py, but no README or template contents, so presentation details and any desktop client behavior are not inferred.

Main entry points: [`app.py`](https://github.com/nelfannaveen/suggestion-box/blob/master/app.py) (Suggestions and admins), [`static`](https://github.com/nelfannaveen/suggestion-box/tree/master/static) (Uploaded photos)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_citizen["Citizen services"]
  node_submission["Suggestion submission<br/>[app.py]"]
  node_photo["Photo upload<br/>[app.py]"]
  node_tracking["Status tracking<br/>[app.py]"]
  node_browse["Suggestion browsing<br/>[app.py]"]
  node_voting["Community upvotes<br/>[app.py]"]
  node_success["Submission confirmation<br/>[app.py]"]
end

subgraph group_data["Suggestion data"]
  node_suggestions_db[("Suggestions and admins<br/>[app.py]")]
  node_initialization["Database initialization<br/>[app.py]"]
  node_demo_data["Demo data seeding<br/>[app.py]"]
  node_uploads[("Uploaded photos")]
end

subgraph group_reporting["Reporting API"]
  node_stats["Statistics endpoint<br/>[app.py]"]
  node_api_records["Recent suggestions endpoint<br/>[app.py]"]
end

node_residents(("Residents"))
node_desktop(("Desktop Command Center"))

node_residents -->|"submits"| node_submission
node_submission -->|"saves optional"| node_photo
node_submission -->|"inserts suggestion"| node_suggestions_db
node_submission -->|"redirects with ID"| node_success
node_photo -->|"writes photo"| node_uploads
node_residents -->|"looks up status"| node_tracking
node_tracking -->|"reads by tracking ID"| node_suggestions_db
node_residents -->|"browses suggestions"| node_browse
node_browse -->|"reads filtered list"| node_suggestions_db
node_residents -->|"upvotes"| node_voting
node_voting -->|"increments votes"| node_suggestions_db
node_desktop -->|"requests metrics"| node_stats
node_stats -->|"aggregates records"| node_suggestions_db
node_desktop -->|"requests records"| node_api_records
node_api_records -->|"reads recent records"| node_suggestions_db
node_initialization -->|"creates tables"| node_suggestions_db
node_demo_data -->|"seeds sample records"| node_suggestions_db

click node_submission "https://github.com/nelfannaveen/suggestion-box/blob/master/app.py"
click node_photo "https://github.com/nelfannaveen/suggestion-box/blob/master/app.py"
click node_tracking "https://github.com/nelfannaveen/suggestion-box/blob/master/app.py"
click node_browse "https://github.com/nelfannaveen/suggestion-box/blob/master/app.py"
click node_voting "https://github.com/nelfannaveen/suggestion-box/blob/master/app.py"
click node_success "https://github.com/nelfannaveen/suggestion-box/blob/master/app.py"
click node_suggestions_db "https://github.com/nelfannaveen/suggestion-box/blob/master/app.py"
click node_initialization "https://github.com/nelfannaveen/suggestion-box/blob/master/app.py"
click node_demo_data "https://github.com/nelfannaveen/suggestion-box/blob/master/app.py"
click node_stats "https://github.com/nelfannaveen/suggestion-box/blob/master/app.py"
click node_api_records "https://github.com/nelfannaveen/suggestion-box/blob/master/app.py"
click node_uploads "https://github.com/nelfannaveen/suggestion-box/tree/master/static"

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_submission,node_photo,node_tracking,node_browse,node_voting,node_success toneBlue
class node_suggestions_db,node_initialization,node_demo_data,node_uploads toneAmber
class node_stats,node_api_records toneMint
class node_residents,node_desktop toneIndigo
```

## Components

### Citizen services

- [Suggestion submission](https://github.com/nelfannaveen/suggestion-box/blob/master/app.py): `app.py`
- [Photo upload](https://github.com/nelfannaveen/suggestion-box/blob/master/app.py): `app.py`
- [Status tracking](https://github.com/nelfannaveen/suggestion-box/blob/master/app.py): `app.py`
- [Suggestion browsing](https://github.com/nelfannaveen/suggestion-box/blob/master/app.py): `app.py`
- [Community upvotes](https://github.com/nelfannaveen/suggestion-box/blob/master/app.py): `app.py`
- [Submission confirmation](https://github.com/nelfannaveen/suggestion-box/blob/master/app.py): `app.py`

### Suggestion data

- [Suggestions and admins](https://github.com/nelfannaveen/suggestion-box/blob/master/app.py): `app.py`
- [Database initialization](https://github.com/nelfannaveen/suggestion-box/blob/master/app.py): `app.py`
- [Demo data seeding](https://github.com/nelfannaveen/suggestion-box/blob/master/app.py): `app.py`
- [Uploaded photos](https://github.com/nelfannaveen/suggestion-box/tree/master/static): `static`

### Reporting API

- [Statistics endpoint](https://github.com/nelfannaveen/suggestion-box/blob/master/app.py): `app.py`
- [Recent suggestions endpoint](https://github.com/nelfannaveen/suggestion-box/blob/master/app.py): `app.py`

### Other components

- **Residents**
- **Desktop Command Center**

## Connections

- Residents → Suggestion submission: submits (evidence: `app.py`)
- Suggestion submission → Photo upload: saves optional (evidence: `app.py`)
- Suggestion submission → Suggestions and admins: inserts suggestion (evidence: `app.py`)
- Suggestion submission → Submission confirmation: redirects with ID (evidence: `app.py`)
- Photo upload → Uploaded photos: writes photo (evidence: `app.py`)
- Residents → Status tracking: looks up status (evidence: `app.py`)
- Status tracking → Suggestions and admins: reads by tracking ID (evidence: `app.py`)
- Residents → Suggestion browsing: browses suggestions (evidence: `app.py`)
- Suggestion browsing → Suggestions and admins: reads filtered list (evidence: `app.py`)
- Residents → Community upvotes: upvotes (evidence: `app.py`)
- Community upvotes → Suggestions and admins: increments votes (evidence: `app.py`)
- Desktop Command Center → Statistics endpoint: requests metrics (evidence: `app.py`)
- Statistics endpoint → Suggestions and admins: aggregates records (evidence: `app.py`)
- Desktop Command Center → Recent suggestions endpoint: requests records (evidence: `app.py`)
- Recent suggestions endpoint → Suggestions and admins: reads recent records (evidence: `app.py`)
- Database initialization → Suggestions and admins: creates tables (evidence: `app.py`)
- Demo data seeding → Suggestions and admins: seeds sample records (evidence: `app.py`)
