# mbnarayn/communise architecture

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

- Interactive diagram: https://gitdiagram.com/mbnarayn/communise
- Repository: https://github.com/mbnarayn/communise

## Overview

This is a Flask local directory for discovering and submitting shop and amenity listings. The main user flow is browsing/searching listings or submitting a listing with contact details and an optional logo. Listings can use local JSON storage or Azure Cosmos DB; logos can be stored locally or in Azure Blob Storage. The sampled source shows the homepage route coordinating listing loading, filtering, pagination, and rendering, and part of the submission and admin logic. Other route relationships are based on README statements or are omitted where implementation was not sampled.

Main entry points: [`app.py`](https://github.com/mbnarayn/communise/blob/main/app.py) (Flask app), [`data/listings.json`](https://github.com/mbnarayn/communise/blob/main/data/listings.json) (Listing data), [`templates/index.html`](https://github.com/mbnarayn/communise/blob/main/templates/index.html) (Directory page), [`templates/add_listing.html`](https://github.com/mbnarayn/communise/blob/main/templates/add_listing.html) (Listing form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Directory web app"]
  node_app["Flask app<br/>[app.py]"]
  node_homepage["Directory page<br/>[index.html]"]
  node_addform["Listing form<br/>[add_listing.html]"]
  node_community["Community pages<br/>[community.html]"]
  node_about["About page<br/>[about.html]"]
end

subgraph group_listing["Listing features"]
  node_browse["Browse and search<br/>[app.py]"]
  node_submit["Add listing<br/>[app.py]"]
  node_admin["Listing admin<br/>[app.py]"]
end

subgraph group_storage["Listing storage"]
  node_listingdata[("Listing data<br/>[listings.json]")]
  node_cosmos[("Azure Cosmos DB")]
end

subgraph group_logos["Logo storage"]
  node_logo_upload["Logo upload<br/>[app.py]"]
  node_local_logos[("Local logo files")]
  node_blob[("Azure Blob Storage")]
end

node_visitor(("Directory visitor"))

node_visitor -->|"browses or submits"| node_app
node_app -->|"routes homepage"| node_browse
node_browse -.->|"loads listings"| node_listingdata
node_browse -->|"renders page"| node_homepage
node_app -.->|"routes submission"| node_submit
node_submit -.->|"shows form"| node_addform
node_submit -.->|"saves listing"| node_listingdata
node_submit -.->|"handles logo"| node_logo_upload
node_app -.->|"manages listings"| node_admin
node_app -.->|"serves community pages"| node_community
node_app -.->|"serves about page"| node_about
node_listingdata -.->|"selects instead"| node_cosmos
node_logo_upload -.->|"stores locally"| node_local_logos
node_logo_upload -.->|"uploads optionally"| node_blob

click node_app "https://github.com/mbnarayn/communise/blob/main/app.py"
click node_browse "https://github.com/mbnarayn/communise/blob/main/app.py"
click node_homepage "https://github.com/mbnarayn/communise/blob/main/templates/index.html"
click node_submit "https://github.com/mbnarayn/communise/blob/main/app.py"
click node_addform "https://github.com/mbnarayn/communise/blob/main/templates/add_listing.html"
click node_admin "https://github.com/mbnarayn/communise/blob/main/app.py"
click node_community "https://github.com/mbnarayn/communise/blob/main/templates/community.html"
click node_about "https://github.com/mbnarayn/communise/blob/main/templates/about.html"
click node_listingdata "https://github.com/mbnarayn/communise/blob/main/data/listings.json"
click node_logo_upload "https://github.com/mbnarayn/communise/blob/main/app.py"
click node_local_logos "https://github.com/mbnarayn/communise/tree/main/static/uploads/logos"

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_app,node_homepage,node_addform,node_community,node_about toneBlue
class node_browse,node_submit,node_admin toneAmber
class node_listingdata,node_cosmos toneMint
class node_logo_upload,node_local_logos,node_blob toneRose
class node_visitor toneIndigo
```

## Components

### Directory web app

- [Flask app](https://github.com/mbnarayn/communise/blob/main/app.py): `app.py`
- [Directory page](https://github.com/mbnarayn/communise/blob/main/templates/index.html): `templates/index.html`
- [Listing form](https://github.com/mbnarayn/communise/blob/main/templates/add_listing.html): `templates/add_listing.html`
- [Community pages](https://github.com/mbnarayn/communise/blob/main/templates/community.html): `templates/community.html`
- [About page](https://github.com/mbnarayn/communise/blob/main/templates/about.html): `templates/about.html`

### Listing features

- [Browse and search](https://github.com/mbnarayn/communise/blob/main/app.py): `app.py`
- [Add listing](https://github.com/mbnarayn/communise/blob/main/app.py): `app.py`
- [Listing admin](https://github.com/mbnarayn/communise/blob/main/app.py): `app.py`

### Listing storage

- [Listing data](https://github.com/mbnarayn/communise/blob/main/data/listings.json): `data/listings.json`
- **Azure Cosmos DB**

### Logo storage

- [Logo upload](https://github.com/mbnarayn/communise/blob/main/app.py): `app.py`
- [Local logo files](https://github.com/mbnarayn/communise/tree/main/static/uploads/logos): `static/uploads/logos`
- **Azure Blob Storage**

### Other components

- **Directory visitor**

## Connections

- Directory visitor → Flask app: browses or submits (evidence: `README.md`)
- Flask app → Browse and search: routes homepage (evidence: `app.py`)
- Browse and search → Listing data: loads listings
- Browse and search → Directory page: renders page (evidence: `app.py`)
- Flask app → Add listing: routes submission (evidence: `app.py`)
- Add listing → Listing form: shows form (evidence: `README.md`)
- Add listing → Listing data: saves listing (evidence: `README.md`)
- Add listing → Logo upload: handles logo (evidence: `README.md`)
- Flask app → Listing admin: manages listings (evidence: `app.py`)
- Flask app → Community pages: serves community pages
- Flask app → About page: serves about page
- Listing data → Azure Cosmos DB: selects instead (evidence: `README.md`)
- Logo upload → Local logo files: stores locally (evidence: `README.md`)
- Logo upload → Azure Blob Storage: uploads optionally (evidence: `README.md`)
