# shagunpathak1508-create/spidernet architecture

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

- Interactive diagram: https://gitdiagram.com/shagunpathak1508-create/spidernet
- Repository: https://github.com/shagunpathak1508-create/spidernet

## Overview

SpiderNet is a Streamlit crime-intelligence dashboard for San Francisco incident data. Users load the dataset, apply year/category filters, and explore weekly anomalies, district hotspots, crime breakdowns, geographic clusters, and recommended patrol actions. The sampled source shows data preparation, weekly Z-score detection, district aggregation, clustering, and map construction; the README documents the dashboard’s other panels. The implementation is concentrated in app.py, so feature nodes share that path. The expected input data is described in the README but is not present in the tree.

Main entry points: [`app.py`](https://github.com/shagunpathak1508-create/spidernet/blob/main/app.py) (Streamlit dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Data preparation"]
  node_crime_data["Crime dataset"]
  node_load_clean["Load and clean<br/>[app.py]"]
  node_filters["Year and category filters<br/>[app.py]"]
end

subgraph group_analysis["Crime analysis"]
  node_weekly["Weekly spike detection<br/>[app.py]"]
  node_districts["District aggregation<br/>[app.py]"]
  node_breakdown["Crime breakdowns<br/>[app.py]"]
  node_clusters["Geographic clustering<br/>[app.py]"]
end

subgraph group_views["Intelligence views"]
  node_district_map["District crime map<br/>[app.py]"]
  node_explainer["Actionable explainer<br/>[app.py]"]
  node_weekly_summary["Weekly summary CSV<br/>[app.py]"]
end

node_analyst(("Analyst"))
node_dashboard["Streamlit dashboard<br/>[app.py]"]

node_analyst -->|"opens"| node_dashboard
node_dashboard -->|"reads"| node_crime_data
node_dashboard -->|"loads"| node_load_clean
node_load_clean -->|"reads"| node_crime_data
node_dashboard -->|"filters"| node_filters
node_dashboard -->|"computes"| node_weekly
node_dashboard -->|"aggregates"| node_districts
node_dashboard -->|"summarizes"| node_breakdown
node_dashboard -->|"clusters"| node_clusters
node_dashboard -->|"renders"| node_district_map
node_dashboard -->|"presents"| node_explainer
node_weekly -->|"exports"| node_weekly_summary

click node_dashboard "https://github.com/shagunpathak1508-create/spidernet/blob/main/app.py"
click node_load_clean "https://github.com/shagunpathak1508-create/spidernet/blob/main/app.py"
click node_filters "https://github.com/shagunpathak1508-create/spidernet/blob/main/app.py"
click node_weekly "https://github.com/shagunpathak1508-create/spidernet/blob/main/app.py"
click node_districts "https://github.com/shagunpathak1508-create/spidernet/blob/main/app.py"
click node_breakdown "https://github.com/shagunpathak1508-create/spidernet/blob/main/app.py"
click node_clusters "https://github.com/shagunpathak1508-create/spidernet/blob/main/app.py"
click node_district_map "https://github.com/shagunpathak1508-create/spidernet/blob/main/app.py"
click node_explainer "https://github.com/shagunpathak1508-create/spidernet/blob/main/app.py"
click node_weekly_summary "https://github.com/shagunpathak1508-create/spidernet/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_crime_data,node_load_clean,node_filters toneBlue
class node_weekly,node_districts,node_breakdown,node_clusters toneAmber
class node_district_map,node_explainer,node_weekly_summary toneMint
class node_analyst toneIndigo
class node_dashboard toneTeal
```

## Components

### Data preparation

- **Crime dataset**
- [Load and clean](https://github.com/shagunpathak1508-create/spidernet/blob/main/app.py): `app.py`
- [Year and category filters](https://github.com/shagunpathak1508-create/spidernet/blob/main/app.py): `app.py`

### Crime analysis

- [Weekly spike detection](https://github.com/shagunpathak1508-create/spidernet/blob/main/app.py): `app.py`
- [District aggregation](https://github.com/shagunpathak1508-create/spidernet/blob/main/app.py): `app.py`
- [Crime breakdowns](https://github.com/shagunpathak1508-create/spidernet/blob/main/app.py): `app.py`
- [Geographic clustering](https://github.com/shagunpathak1508-create/spidernet/blob/main/app.py): `app.py`

### Intelligence views

- [District crime map](https://github.com/shagunpathak1508-create/spidernet/blob/main/app.py): `app.py`
- [Actionable explainer](https://github.com/shagunpathak1508-create/spidernet/blob/main/app.py): `app.py`
- [Weekly summary CSV](https://github.com/shagunpathak1508-create/spidernet/blob/main/app.py): `app.py`

### Other components

- **Analyst**
- [Streamlit dashboard](https://github.com/shagunpathak1508-create/spidernet/blob/main/app.py): `app.py`

## Connections

- Analyst → Streamlit dashboard: opens
- Streamlit dashboard → Crime dataset: reads
- Streamlit dashboard → Load and clean: loads
- Load and clean → Crime dataset: reads
- Streamlit dashboard → Year and category filters: filters
- Streamlit dashboard → Weekly spike detection: computes
- Streamlit dashboard → District aggregation: aggregates
- Streamlit dashboard → Crime breakdowns: summarizes
- Streamlit dashboard → Geographic clustering: clusters
- Streamlit dashboard → District crime map: renders
- Streamlit dashboard → Actionable explainer: presents
- Weekly spike detection → Weekly summary CSV: exports
