# marianamera12/healthlocate architecture

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

- Interactive diagram: https://gitdiagram.com/marianamera12/healthlocate
- Repository: https://github.com/marianamera12/healthlocate

## Overview

HealthLocate finds a Nova Scotia address, locates its Community Environ, and presents community and Health Atlas indicators with a map. The primary workflow is the FastAPI backend and browser UI; app.py contains a separate Streamlit implementation of address lookup and spatial matching, with indicators noted as coming soon. Backend excerpts support the data-loading and search relationships shown; frontend behavior is supported by app.js. The README gives no further capability detail, and unsampled files are not used to infer connections.

Main entry points: [`backend.py`](https://github.com/marianamera12/healthlocate/blob/main/backend.py) (Search API), [`frontend/app.js`](https://github.com/marianamera12/healthlocate/blob/main/frontend/app.js) (Search interface), [`app.py`](https://github.com/marianamera12/healthlocate/blob/main/app.py) (Streamlit search), [`shapefiles/ComEnviron.shp`](https://github.com/marianamera12/healthlocate/blob/main/shapefiles/ComEnviron.shp) (Community Environs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser experience"]
  node_web["Search interface<br/>[app.js]"]
  node_result["Profile display<br/>[app.js]"]
  node_map["Location map<br/>[app.js]"]
end

subgraph group_service["Search service"]
  node_api["Search API<br/>[backend.py]"]
  node_loader["Data loader<br/>[backend.py]"]
end

subgraph group_geodata["Geospatial data"]
  node_addresses[("Address records")]
  node_community_shapes[("Community Environs<br/>[ComEnviron.shp]")]
  node_spatial_match["Spatial matching<br/>[backend.py]"]
end

subgraph group_atlas["Health Atlas indicators"]
  node_atlas_data[("Atlas records")]
  node_indicator_format["Indicator formatting<br/>[backend.py]"]
end

subgraph group_legacy["Streamlit alternative"]
  node_streamlit_app["Streamlit search<br/>[app.py]"]
  node_streamlit_map["Streamlit map<br/>[app.py]"]
end

node_user(("User"))
node_tiles["OpenStreetMap tiles"]
node_address_source["NS Open Data"]

node_user -->|"submits search"| node_web
node_web -->|"requests address"| node_api
node_api -->|"returns results"| node_web
node_web -->|"renders profile"| node_result
node_web -->|"renders location"| node_map
node_map -->|"loads tiles"| node_tiles
node_loader -->|"downloads records"| node_address_source
node_address_source -->|"provides CSV"| node_addresses
node_loader -->|"reads shapefile"| node_community_shapes
node_loader -->|"reads CSV"| node_atlas_data
node_api -->|"loads datasets"| node_loader
node_api -->|"matches address"| node_addresses
node_api -->|"locates point"| node_spatial_match
node_spatial_match -->|"joins shapes"| node_community_shapes
node_api -->|"formats indicators"| node_indicator_format
node_indicator_format -->|"reads indicators"| node_atlas_data
node_user -->|"searches address"| node_streamlit_app
node_streamlit_app -->|"downloads records"| node_address_source
node_streamlit_app -->|"reads shapefile"| node_community_shapes
node_streamlit_app -->|"shows location"| node_streamlit_map

click node_web "https://github.com/marianamera12/healthlocate/blob/main/frontend/app.js"
click node_result "https://github.com/marianamera12/healthlocate/blob/main/frontend/app.js"
click node_map "https://github.com/marianamera12/healthlocate/blob/main/frontend/app.js"
click node_api "https://github.com/marianamera12/healthlocate/blob/main/backend.py"
click node_loader "https://github.com/marianamera12/healthlocate/blob/main/backend.py"
click node_community_shapes "https://github.com/marianamera12/healthlocate/blob/main/shapefiles/ComEnviron.shp"
click node_spatial_match "https://github.com/marianamera12/healthlocate/blob/main/backend.py"
click node_atlas_data "https://github.com/marianamera12/healthlocate/blob/main/data/NSHealthAtlasDataEnvirons.csv"
click node_indicator_format "https://github.com/marianamera12/healthlocate/blob/main/backend.py"
click node_streamlit_app "https://github.com/marianamera12/healthlocate/blob/main/app.py"
click node_streamlit_map "https://github.com/marianamera12/healthlocate/blob/main/app.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,node_result,node_map,node_user toneBlue
class node_api,node_loader toneAmber
class node_addresses,node_community_shapes,node_spatial_match toneMint
class node_atlas_data,node_indicator_format toneRose
class node_streamlit_app,node_streamlit_map,node_tiles,node_address_source toneIndigo
```

## Components

### Browser experience

- [Search interface](https://github.com/marianamera12/healthlocate/blob/main/frontend/app.js): `frontend/app.js`
- [Profile display](https://github.com/marianamera12/healthlocate/blob/main/frontend/app.js): `frontend/app.js`
- [Location map](https://github.com/marianamera12/healthlocate/blob/main/frontend/app.js): `frontend/app.js`

### Search service

- [Search API](https://github.com/marianamera12/healthlocate/blob/main/backend.py): `backend.py`
- [Data loader](https://github.com/marianamera12/healthlocate/blob/main/backend.py): `backend.py`

### Geospatial data

- **Address records**
- [Community Environs](https://github.com/marianamera12/healthlocate/blob/main/shapefiles/ComEnviron.shp): `shapefiles/ComEnviron.shp`
- [Spatial matching](https://github.com/marianamera12/healthlocate/blob/main/backend.py): `backend.py`

### Health Atlas indicators

- [Atlas records](https://github.com/marianamera12/healthlocate/blob/main/data/NSHealthAtlasDataEnvirons.csv): `data/NSHealthAtlasDataEnvirons.csv`
- [Indicator formatting](https://github.com/marianamera12/healthlocate/blob/main/backend.py): `backend.py`

### Streamlit alternative

- [Streamlit search](https://github.com/marianamera12/healthlocate/blob/main/app.py): `app.py`
- [Streamlit map](https://github.com/marianamera12/healthlocate/blob/main/app.py): `app.py`

### Other components

- **User**
- **OpenStreetMap tiles**
- **NS Open Data**

## Connections

- User → Search interface: submits search (evidence: `frontend/app.js`)
- Search interface → Search API: requests address (evidence: `frontend/app.js`)
- Search API → Search interface: returns results (evidence: `backend.py`)
- Search interface → Profile display: renders profile (evidence: `frontend/app.js`)
- Search interface → Location map: renders location (evidence: `frontend/app.js`)
- Location map → OpenStreetMap tiles: loads tiles (evidence: `frontend/app.js`)
- Data loader → NS Open Data: downloads records (evidence: `backend.py`)
- NS Open Data → Address records: provides CSV
- Data loader → Community Environs: reads shapefile (evidence: `backend.py`)
- Data loader → Atlas records: reads CSV (evidence: `backend.py`)
- Search API → Data loader: loads datasets (evidence: `backend.py`)
- Search API → Address records: matches address (evidence: `backend.py`)
- Search API → Spatial matching: locates point (evidence: `backend.py`)
- Spatial matching → Community Environs: joins shapes (evidence: `backend.py`)
- Search API → Indicator formatting: formats indicators (evidence: `backend.py`)
- Indicator formatting → Atlas records: reads indicators (evidence: `backend.py`)
- User → Streamlit search: searches address (evidence: `app.py`)
- Streamlit search → NS Open Data: downloads records (evidence: `app.py`)
- Streamlit search → Community Environs: reads shapefile (evidence: `app.py`)
- Streamlit search → Streamlit map: shows location (evidence: `app.py`)
