# darshitn04-blip/market-size-in architecture

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

- Interactive diagram: https://gitdiagram.com/darshitn04-blip/market-size-in
- Repository: https://github.com/darshitn04-blip/market-size-in

## Overview

MarketSize.in is a Streamlit decision-support dashboard for ranking Indian Tier-2 cities for quick-commerce expansion. Users adjust market assumptions and may upload verified competitor counts; the app runs a model that estimates bottom-up and top-down TAM, scores and ranks cities, and clusters opportunity profiles. Results appear as recommendations, sizing views, and a map, and are exported to CSV and a regenerated SQLite warehouse. The README documents these capabilities; the shown source supports the app-to-model and model-to-output links.

Main entry points: [`app.py`](https://github.com/darshitn04-blip/market-size-in/blob/main/app.py) (Streamlit App), [`analytics.py`](https://github.com/darshitn04-blip/market-size-in/blob/main/analytics.py) (Model Engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Dashboard"]
  node_app["Streamlit App<br/>[app.py]"]
end

subgraph group_engine["Market Model"]
  node_citydata["City Baseline<br/>[analytics.py]"]
  node_model["Model Engine<br/>[analytics.py]"]
  node_tam["TAM Estimates<br/>[analytics.py]"]
  node_ranking["Attractiveness Ranking<br/>[analytics.py]"]
  node_clusters["City Clusters<br/>[analytics.py]"]
end

subgraph group_outputs["Decision Outputs"]
  node_recommendation["City Recommendation<br/>[app.py]"]
  node_sizing["Market Sizing Views<br/>[app.py]"]
  node_map["Candidate Map<br/>[app.py]"]
  node_csv["Scores CSV<br/>[app.py]"]
  node_writer["Warehouse Writer<br/>[analytics.py]"]
  node_warehouse[("SQLite Warehouse")]
end

node_user(("Decision Maker"))

node_user -->|"sets assumptions"| node_app
node_user -->|"uploads counts"| node_app
node_app -->|"loads cities"| node_citydata
node_app -->|"runs model"| node_model
node_model -->|"calculates TAM"| node_tam
node_model -->|"scores cities"| node_ranking
node_model -->|"clusters profiles"| node_clusters
node_app -->|"renders results"| node_recommendation
node_app -->|"renders results"| node_sizing
node_app -->|"renders scores"| node_map
node_app -->|"exports scores"| node_csv
node_app -->|"saves model"| node_writer
node_writer -->|"writes tables"| node_warehouse

click node_app "https://github.com/darshitn04-blip/market-size-in/blob/main/app.py"
click node_citydata "https://github.com/darshitn04-blip/market-size-in/blob/main/analytics.py"
click node_model "https://github.com/darshitn04-blip/market-size-in/blob/main/analytics.py"
click node_tam "https://github.com/darshitn04-blip/market-size-in/blob/main/analytics.py"
click node_ranking "https://github.com/darshitn04-blip/market-size-in/blob/main/analytics.py"
click node_clusters "https://github.com/darshitn04-blip/market-size-in/blob/main/analytics.py"
click node_recommendation "https://github.com/darshitn04-blip/market-size-in/blob/main/app.py"
click node_sizing "https://github.com/darshitn04-blip/market-size-in/blob/main/app.py"
click node_map "https://github.com/darshitn04-blip/market-size-in/blob/main/app.py"
click node_csv "https://github.com/darshitn04-blip/market-size-in/blob/main/app.py"
click node_writer "https://github.com/darshitn04-blip/market-size-in/blob/main/analytics.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_app toneBlue
class node_citydata,node_model,node_tam,node_ranking,node_clusters toneAmber
class node_recommendation,node_sizing,node_map,node_csv,node_writer,node_warehouse toneMint
class node_user toneIndigo
```

## Components

### Dashboard

- [Streamlit App](https://github.com/darshitn04-blip/market-size-in/blob/main/app.py): `app.py`

### Market Model

- [City Baseline](https://github.com/darshitn04-blip/market-size-in/blob/main/analytics.py): `analytics.py`
- [Model Engine](https://github.com/darshitn04-blip/market-size-in/blob/main/analytics.py): `analytics.py`
- [TAM Estimates](https://github.com/darshitn04-blip/market-size-in/blob/main/analytics.py): `analytics.py`
- [Attractiveness Ranking](https://github.com/darshitn04-blip/market-size-in/blob/main/analytics.py): `analytics.py`
- [City Clusters](https://github.com/darshitn04-blip/market-size-in/blob/main/analytics.py): `analytics.py`

### Decision Outputs

- [City Recommendation](https://github.com/darshitn04-blip/market-size-in/blob/main/app.py): `app.py`
- [Market Sizing Views](https://github.com/darshitn04-blip/market-size-in/blob/main/app.py): `app.py`
- [Candidate Map](https://github.com/darshitn04-blip/market-size-in/blob/main/app.py): `app.py`
- [Scores CSV](https://github.com/darshitn04-blip/market-size-in/blob/main/app.py): `app.py`
- [Warehouse Writer](https://github.com/darshitn04-blip/market-size-in/blob/main/analytics.py): `analytics.py`
- **SQLite Warehouse**

### Other components

- **Decision Maker**

## Connections

- Decision Maker → Streamlit App: sets assumptions (evidence: `app.py`)
- Decision Maker → Streamlit App: uploads counts (evidence: `app.py`)
- Streamlit App → City Baseline: loads cities (evidence: `app.py`)
- Streamlit App → Model Engine: runs model (evidence: `app.py`)
- Model Engine → TAM Estimates: calculates TAM (evidence: `analytics.py`)
- Model Engine → Attractiveness Ranking: scores cities (evidence: `analytics.py`)
- Model Engine → City Clusters: clusters profiles (evidence: `analytics.py`)
- Streamlit App → City Recommendation: renders results (evidence: `app.py`)
- Streamlit App → Market Sizing Views: renders results (evidence: `app.py`)
- Streamlit App → Candidate Map: renders scores (evidence: `app.py`)
- Streamlit App → Scores CSV: exports scores (evidence: `app.py`)
- Streamlit App → Warehouse Writer: saves model (evidence: `app.py`)
- Warehouse Writer → SQLite Warehouse: writes tables (evidence: `analytics.py`)
