# namayjindal/corner-app architecture

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

- Interactive diagram: https://gitdiagram.com/namayjindal/corner-app
- Repository: https://github.com/namayjindal/corner-app

## Overview

Corner is a Flask-based NYC place-search application. A user enters a keyword or natural-language query; the browser requests search results, the server delegates semantic/location-aware retrieval to the embedding generator, and returns place cards. Users can open place details and view locations on a Google map. The README also documents embedding preparation and Google Place ID import. Source excerpts show the server-to-search delegation and browser map behavior; relationships for the template and unsampled search internals are limited to documented or indexed evidence.

Main entry points: [`app.py`](https://github.com/namayjindal/corner-app/blob/main/app.py) (Flask routes), [`static/js/app.js`](https://github.com/namayjindal/corner-app/blob/main/static/js/app.js) (Search interface), [`generate_embeddings.py`](https://github.com/namayjindal/corner-app/blob/main/generate_embeddings.py) (Semantic retrieval), [`import-google-ids.py`](https://github.com/namayjindal/corner-app/blob/main/import-google-ids.py) (Google ID importer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_browser["Search interface<br/>[app.js]"]
  node_page["Search page<br/>[index.html]"]
end

subgraph group_search["Search runtime"]
  node_flask["Flask routes<br/>[app.py]"]
  node_semantic["Semantic retrieval"]
  node_locations["Location extraction"]
end

subgraph group_data["Place data"]
  node_postgres[("Place database")]
  node_embedprep["Embedding preparation"]
  node_placefiles["Place source data<br/>[combined_data.json]"]
  node_idmap["Google ID mapping<br/>[places.csv]"]
  node_idimport["Google ID importer"]
  node_querylog["Recent query log"]
end

node_visitor(("Search visitor"))
node_googlemaps["Google Maps"]

node_visitor -->|"enters query"| node_browser
node_browser -->|"requests search"| node_flask
node_flask -->|"delegates search"| node_semantic
node_semantic -->|"extracts location"| node_locations
node_semantic -->|"queries vectors"| node_postgres
node_flask -->|"reads details"| node_postgres
node_flask -->|"records queries"| node_querylog
node_flask -->|"returns results"| node_browser
node_browser -->|"requests details"| node_flask
node_browser -->|"renders maps"| node_googlemaps
node_embedprep -->|"processes place data"| node_placefiles
node_embedprep -->|"stores embeddings"| node_postgres
node_idimport -->|"reads mappings"| node_idmap
node_idimport -->|"updates Google IDs"| node_postgres
node_flask -->|"imports mappings"| node_idmap

click node_browser "https://github.com/namayjindal/corner-app/blob/main/static/js/app.js"
click node_page "https://github.com/namayjindal/corner-app/blob/main/templates/index.html"
click node_flask "https://github.com/namayjindal/corner-app/blob/main/app.py"
click node_semantic "https://github.com/namayjindal/corner-app/blob/main/generate_embeddings.py"
click node_locations "https://github.com/namayjindal/corner-app/blob/main/location_extraction.py"
click node_embedprep "https://github.com/namayjindal/corner-app/blob/main/generate_embeddings.py"
click node_placefiles "https://github.com/namayjindal/corner-app/blob/main/combined_data.json"
click node_idmap "https://github.com/namayjindal/corner-app/blob/main/places.csv"
click node_idimport "https://github.com/namayjindal/corner-app/blob/main/import-google-ids.py"
click node_querylog "https://github.com/namayjindal/corner-app/blob/main/corner_recent_queries.csv"

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_browser,node_page toneBlue
class node_flask,node_semantic,node_locations toneAmber
class node_postgres,node_embedprep,node_placefiles,node_idmap,node_idimport,node_querylog toneMint
class node_visitor,node_googlemaps toneIndigo
```

## Components

### Web experience

- [Search interface](https://github.com/namayjindal/corner-app/blob/main/static/js/app.js): `static/js/app.js`
- [Search page](https://github.com/namayjindal/corner-app/blob/main/templates/index.html): `templates/index.html`

### Search runtime

- [Flask routes](https://github.com/namayjindal/corner-app/blob/main/app.py): `app.py`
- [Semantic retrieval](https://github.com/namayjindal/corner-app/blob/main/generate_embeddings.py): `generate_embeddings.py`
- [Location extraction](https://github.com/namayjindal/corner-app/blob/main/location_extraction.py): `location_extraction.py`

### Place data

- **Place database**
- [Embedding preparation](https://github.com/namayjindal/corner-app/blob/main/generate_embeddings.py): `generate_embeddings.py`
- [Place source data](https://github.com/namayjindal/corner-app/blob/main/combined_data.json): `combined_data.json`
- [Google ID mapping](https://github.com/namayjindal/corner-app/blob/main/places.csv): `places.csv`
- [Google ID importer](https://github.com/namayjindal/corner-app/blob/main/import-google-ids.py): `import-google-ids.py`
- [Recent query log](https://github.com/namayjindal/corner-app/blob/main/corner_recent_queries.csv): `corner_recent_queries.csv`

### Other components

- **Search visitor**
- **Google Maps**

## Connections

- Search visitor → Search interface: enters query (evidence: `static/js/app.js`)
- Search interface → Flask routes: requests search (evidence: `app.py`)
- Flask routes → Semantic retrieval: delegates search (evidence: `app.py`)
- Semantic retrieval → Location extraction: extracts location (evidence: `generate_embeddings.py`)
- Semantic retrieval → Place database: queries vectors (evidence: `README.md`)
- Flask routes → Place database: reads details (evidence: `app.py`)
- Flask routes → Recent query log: records queries (evidence: `app.py`)
- Flask routes → Search interface: returns results (evidence: `app.py`)
- Search interface → Flask routes: requests details (evidence: `static/js/app.js`)
- Search interface → Google Maps: renders maps (evidence: `static/js/app.js`)
- Embedding preparation → Place source data: processes place data (evidence: `README.md`)
- Embedding preparation → Place database: stores embeddings (evidence: `README.md`)
- Google ID importer → Google ID mapping: reads mappings (evidence: `import-google-ids.py`)
- Google ID importer → Place database: updates Google IDs (evidence: `import-google-ids.py`)
- Flask routes → Google ID mapping: imports mappings (evidence: `app.py`)
