# lloydlim1/dated. architecture

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

- Interactive diagram: https://gitdiagram.com/lloydlim1/dated.
- Repository: https://github.com/lloydlim1/dated.

## Overview

Dated is a mobile-first local discovery and community app. Visitors explore a place directory and map, then save places, share reviews and photo posts, and organize multi-stop outings; a separate itinerary flow supports private plans and shareable snapshots. The runtime uses a Next.js UI and API over local SQLite and filesystem storage. The map, catalog, social, and itinerary branches reflect README capabilities; some detailed route implementations are unsampled, so their internal links are omitted where evidence is unavailable.

Main entry points: [`src/server/discovery.ts`](https://github.com/lloydlim1/dated./blob/main/src/server/discovery.ts) (Live discovery), [`src/app/api/[...path]/route.ts`](https://github.com/lloydlim1/dated./blob/main/src/app/api/%5B...path%5D/route.ts) (API routes), [`src/lib/place-catalog.mjs`](https://github.com/lloydlim1/dated./blob/main/src/lib/place-catalog.mjs) (Place catalog), [`src/server/db.ts`](https://github.com/lloydlim1/dated./blob/main/src/server/db.ts) (SQLite store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User experience"]
  node_dated_app["Dated app<br/>[dated-app.tsx]"]
  node_map["Place map<br/>[place-map.tsx]"]
  node_photo_posts["Photo posts<br/>[photo-posts.tsx]"]
  node_place_select["Place selector<br/>[place-select.tsx]"]
  node_premium["Premium studio<br/>[premium-studio.tsx]"]
  node_itinerary_doc["Itinerary document"]
  node_shared_page["Shared itinerary page<br/>[page.tsx]"]
end

subgraph group_api["API and domain"]
  node_api_route["API routes<br/>[route.ts]"]
  node_auth["Authentication<br/>[auth.ts]"]
  node_read["Read models<br/>[read.ts]"]
  node_itineraries["Outing management<br/>[itineraries.ts]"]
  node_review_cred["Review credibility"]
  node_itinerary_logic["Itinerary logic<br/>[itinerary.ts]"]
end

subgraph group_places["Places and discovery"]
  node_discovery["Live discovery<br/>[discovery.ts]"]
  node_catalog_service["Catalog service<br/>[catalog.ts]"]
  node_place_catalog["Place catalog<br/>[place-catalog.mjs]"]
  node_museum_catalog["Museum catalog<br/>[museum-catalog.mjs]"]
  node_cinema_catalog["Cinema catalog<br/>[cinema-catalog.mjs]"]
  node_public_resource["Public resources"]
end

subgraph group_storage["Local persistence"]
  node_sqlite[("SQLite store<br/>[db.ts]")]
  node_seed["Sample content<br/>[seed.ts]"]
end

node_visitor(("Visitor"))
node_overpass["Overpass service"]

node_visitor -->|"uses"| node_dated_app
node_dated_app -.->|"fetches data"| node_api_route
node_dated_app -->|"renders"| node_map
node_dated_app -->|"renders"| node_photo_posts
node_dated_app -->|"renders"| node_place_select
node_dated_app -->|"renders"| node_premium
node_map -.->|"searches nearby"| node_discovery
node_api_route -->|"reads and writes"| node_sqlite
node_api_route -->|"checks access"| node_auth
node_api_route -->|"loads bootstrap"| node_read
node_api_route -->|"delegates requests"| node_itineraries
node_api_route -->|"routes discovery"| node_discovery
node_api_route -->|"initializes catalog"| node_place_catalog
node_auth -->|"queries sessions"| node_sqlite
node_read -->|"reads records"| node_sqlite
node_read -->|"checks visibility"| node_auth
node_read -->|"loads catalog status"| node_place_catalog
node_read -->|"summarizes reviews"| node_review_cred
node_itineraries -->|"reads and writes"| node_sqlite
node_itineraries -->|"checks users"| node_auth
node_itineraries -->|"uses calculations"| node_itinerary_logic
node_itineraries -->|"loads outing data"| node_read
node_sqlite -->|"initializes with"| node_seed
node_discovery -->|"reads and imports places"| node_sqlite
node_discovery -->|"normalizes and imports"| node_place_catalog
node_discovery -->|"limits requests"| node_auth
node_discovery -->|"queries mapped places"| node_overpass
node_discovery -->|"normalizes cinemas"| node_cinema_catalog
node_discovery -->|"normalizes museums"| node_museum_catalog
node_catalog_service -->|"uses catalog state"| node_sqlite
node_catalog_service -->|"uses place catalog"| node_place_catalog
node_catalog_service -->|"uses museum catalog"| node_museum_catalog
node_catalog_service -->|"uses cinema catalog"| node_cinema_catalog
node_museum_catalog -->|"imports places"| node_place_catalog
node_museum_catalog -->|"fetches resources"| node_public_resource
node_cinema_catalog -->|"imports places"| node_place_catalog
node_place_catalog -.->|"uses public resources"| node_public_resource
node_premium -->|"renders document"| node_itinerary_doc
node_shared_page -->|"loads snapshot"| node_itineraries
node_shared_page -->|"renders document"| node_itinerary_doc
node_itinerary_doc -->|"formats itinerary"| node_itinerary_logic

click node_dated_app "https://github.com/lloydlim1/dated./blob/main/src/components/dated-app.tsx"
click node_map "https://github.com/lloydlim1/dated./blob/main/src/components/place-map.tsx"
click node_photo_posts "https://github.com/lloydlim1/dated./blob/main/src/components/photo-posts.tsx"
click node_place_select "https://github.com/lloydlim1/dated./blob/main/src/components/place-select.tsx"
click node_premium "https://github.com/lloydlim1/dated./blob/main/src/components/premium-studio.tsx"
click node_itinerary_doc "https://github.com/lloydlim1/dated./blob/main/src/components/itinerary-document.tsx"
click node_shared_page "https://github.com/lloydlim1/dated./blob/main/src/app/itinerary/%5Btoken%5D/page.tsx"
click node_api_route "https://github.com/lloydlim1/dated./blob/main/src/app/api/%5B...path%5D/route.ts"
click node_auth "https://github.com/lloydlim1/dated./blob/main/src/server/auth.ts"
click node_read "https://github.com/lloydlim1/dated./blob/main/src/server/read.ts"
click node_itineraries "https://github.com/lloydlim1/dated./blob/main/src/server/itineraries.ts"
click node_discovery "https://github.com/lloydlim1/dated./blob/main/src/server/discovery.ts"
click node_catalog_service "https://github.com/lloydlim1/dated./blob/main/src/server/catalog.ts"
click node_place_catalog "https://github.com/lloydlim1/dated./blob/main/src/lib/place-catalog.mjs"
click node_museum_catalog "https://github.com/lloydlim1/dated./blob/main/src/lib/museum-catalog.mjs"
click node_cinema_catalog "https://github.com/lloydlim1/dated./blob/main/src/lib/cinema-catalog.mjs"
click node_public_resource "https://github.com/lloydlim1/dated./blob/main/src/lib/public-resource.mjs"
click node_sqlite "https://github.com/lloydlim1/dated./blob/main/src/server/db.ts"
click node_seed "https://github.com/lloydlim1/dated./blob/main/src/lib/seed.ts"
click node_review_cred "https://github.com/lloydlim1/dated./blob/main/src/lib/review-credibility.mjs"
click node_itinerary_logic "https://github.com/lloydlim1/dated./blob/main/src/lib/itinerary.ts"

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_dated_app,node_map,node_photo_posts,node_place_select,node_premium,node_itinerary_doc,node_shared_page toneBlue
class node_api_route,node_auth,node_read,node_itineraries,node_review_cred,node_itinerary_logic toneAmber
class node_discovery,node_catalog_service,node_place_catalog,node_museum_catalog,node_cinema_catalog,node_public_resource toneMint
class node_sqlite,node_seed toneRose
class node_visitor,node_overpass toneIndigo
```

## Components

### User experience

- [Dated app](https://github.com/lloydlim1/dated./blob/main/src/components/dated-app.tsx): `src/components/dated-app.tsx`
- [Place map](https://github.com/lloydlim1/dated./blob/main/src/components/place-map.tsx): `src/components/place-map.tsx`
- [Photo posts](https://github.com/lloydlim1/dated./blob/main/src/components/photo-posts.tsx): `src/components/photo-posts.tsx`
- [Place selector](https://github.com/lloydlim1/dated./blob/main/src/components/place-select.tsx): `src/components/place-select.tsx`
- [Premium studio](https://github.com/lloydlim1/dated./blob/main/src/components/premium-studio.tsx): `src/components/premium-studio.tsx`
- [Itinerary document](https://github.com/lloydlim1/dated./blob/main/src/components/itinerary-document.tsx): `src/components/itinerary-document.tsx`
- [Shared itinerary page](https://github.com/lloydlim1/dated./blob/main/src/app/itinerary/%5Btoken%5D/page.tsx): `src/app/itinerary/[token]/page.tsx`

### API and domain

- [API routes](https://github.com/lloydlim1/dated./blob/main/src/app/api/%5B...path%5D/route.ts): `src/app/api/[...path]/route.ts`
- [Authentication](https://github.com/lloydlim1/dated./blob/main/src/server/auth.ts): `src/server/auth.ts`
- [Read models](https://github.com/lloydlim1/dated./blob/main/src/server/read.ts): `src/server/read.ts`
- [Outing management](https://github.com/lloydlim1/dated./blob/main/src/server/itineraries.ts): `src/server/itineraries.ts`
- [Review credibility](https://github.com/lloydlim1/dated./blob/main/src/lib/review-credibility.mjs): `src/lib/review-credibility.mjs`
- [Itinerary logic](https://github.com/lloydlim1/dated./blob/main/src/lib/itinerary.ts): `src/lib/itinerary.ts`

### Places and discovery

- [Live discovery](https://github.com/lloydlim1/dated./blob/main/src/server/discovery.ts): `src/server/discovery.ts`
- [Catalog service](https://github.com/lloydlim1/dated./blob/main/src/server/catalog.ts): `src/server/catalog.ts`
- [Place catalog](https://github.com/lloydlim1/dated./blob/main/src/lib/place-catalog.mjs): `src/lib/place-catalog.mjs`
- [Museum catalog](https://github.com/lloydlim1/dated./blob/main/src/lib/museum-catalog.mjs): `src/lib/museum-catalog.mjs`
- [Cinema catalog](https://github.com/lloydlim1/dated./blob/main/src/lib/cinema-catalog.mjs): `src/lib/cinema-catalog.mjs`
- [Public resources](https://github.com/lloydlim1/dated./blob/main/src/lib/public-resource.mjs): `src/lib/public-resource.mjs`

### Local persistence

- [SQLite store](https://github.com/lloydlim1/dated./blob/main/src/server/db.ts): `src/server/db.ts`
- [Sample content](https://github.com/lloydlim1/dated./blob/main/src/lib/seed.ts): `src/lib/seed.ts`

### Other components

- **Visitor**
- **Overpass service**

## Connections

- Visitor → Dated app: uses (evidence: `README.md`)
- Dated app → API routes: fetches data
- Dated app → Place map: renders (evidence: `src/components/dated-app.tsx`)
- Dated app → Photo posts: renders (evidence: `src/components/dated-app.tsx`)
- Dated app → Place selector: renders (evidence: `src/components/dated-app.tsx`)
- Dated app → Premium studio: renders (evidence: `src/components/dated-app.tsx`)
- Place map → Live discovery: searches nearby
- API routes → SQLite store: reads and writes (evidence: `src/app/api/[...path]/route.ts`)
- API routes → Authentication: checks access (evidence: `src/app/api/[...path]/route.ts`)
- API routes → Read models: loads bootstrap (evidence: `src/app/api/[...path]/route.ts`)
- API routes → Outing management: delegates requests (evidence: `src/app/api/[...path]/route.ts`)
- API routes → Live discovery: routes discovery (evidence: `src/app/api/[...path]/route.ts`)
- API routes → Place catalog: initializes catalog (evidence: `src/app/api/[...path]/route.ts`)
- Authentication → SQLite store: queries sessions (evidence: `src/server/auth.ts`)
- Read models → SQLite store: reads records (evidence: `src/server/read.ts`)
- Read models → Authentication: checks visibility (evidence: `src/server/read.ts`)
- Read models → Place catalog: loads catalog status (evidence: `src/server/read.ts`)
- Read models → Review credibility: summarizes reviews (evidence: `src/server/read.ts`)
- Outing management → SQLite store: reads and writes (evidence: `src/server/itineraries.ts`)
- Outing management → Authentication: checks users (evidence: `src/server/itineraries.ts`)
- Outing management → Itinerary logic: uses calculations (evidence: `src/server/itineraries.ts`)
- Outing management → Read models: loads outing data (evidence: `src/server/itineraries.ts`)
- SQLite store → Sample content: initializes with (evidence: `src/server/db.ts`)
- Live discovery → SQLite store: reads and imports places (evidence: `src/server/discovery.ts`)
- Live discovery → Place catalog: normalizes and imports (evidence: `src/server/discovery.ts`)
- Live discovery → Authentication: limits requests (evidence: `src/server/discovery.ts`)
- Live discovery → Overpass service: queries mapped places (evidence: `README.md`)
- Live discovery → Cinema catalog: normalizes cinemas (evidence: `src/server/discovery.ts`)
- Live discovery → Museum catalog: normalizes museums (evidence: `src/server/discovery.ts`)
- Catalog service → SQLite store: uses catalog state (evidence: `src/server/catalog.ts`)
- Catalog service → Place catalog: uses place catalog (evidence: `src/server/catalog.ts`)
- Catalog service → Museum catalog: uses museum catalog (evidence: `src/server/catalog.ts`)
- Catalog service → Cinema catalog: uses cinema catalog (evidence: `src/server/catalog.ts`)
- Museum catalog → Place catalog: imports places (evidence: `src/lib/museum-catalog.mjs`)
- Museum catalog → Public resources: fetches resources (evidence: `src/lib/museum-catalog.mjs`)
- Cinema catalog → Place catalog: imports places (evidence: `src/lib/cinema-catalog.mjs`)
- Place catalog → Public resources: uses public resources (evidence: `src/lib/place-catalog.mjs`)
- Premium studio → Itinerary document: renders document (evidence: `src/components/premium-studio.tsx`)
- Shared itinerary page → Outing management: loads snapshot (evidence: `src/app/itinerary/[token]/page.tsx`)
- Shared itinerary page → Itinerary document: renders document (evidence: `src/app/itinerary/[token]/page.tsx`)
- Itinerary document → Itinerary logic: formats itinerary (evidence: `src/components/itinerary-document.tsx`)
