# isakibul15/parksverige architecture

> Architecture diagram of the GitHub repository isakibul15/parksverige, 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/isakibul15/parksverige
- Repository: https://github.com/isakibul15/parksverige

## Overview

ParkSverige is an early-stage Stockholm parking intelligence product: drivers search or browse nearby parking, inspect zone restrictions and prices, and use account, vehicle, favorite, and alert features. The web prototype is the clearest user-facing path; a NestJS API exposes parallel scaffold endpoints. Data is currently largely static prototype data, while workers simulate rule-source normalization and resolution, alongside a documented Databricks direction. Dashed links indicate plausible but unverified integrations; sampled excerpts do not establish production persistence or runtime wiring for several documented capabilities.

Main entry points: [`services/api/src/app.module.ts`](https://github.com/isakibul15/parksverige/blob/main/services/api/src/app.module.ts) (API application), [`packages/prototype-data/src/index.ts`](https://github.com/isakibul15/parksverige/blob/main/packages/prototype-data/src/index.ts) (Stockholm sample data), [`services/workers/src/stockholm-rule-pipeline.ts`](https://github.com/isakibul15/parksverige/blob/main/services/workers/src/stockholm-rule-pipeline.ts) (Rule pipeline), [`services/api/src/data/stockholm.stub.ts`](https://github.com/isakibul15/parksverige/blob/main/services/api/src/data/stockholm.stub.ts) (API data adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Driver experiences"]
  node_mobile["Mobile app<br/>[index.tsx]"]
end

subgraph group_web["Web experience"]
  node_webapp["Web app"]
  node_zone_map["Zone map<br/>[zone-map.tsx]"]
  node_web_api["Web API routes"]
  node_web_client["API client<br/>[api.ts]"]
end

subgraph group_api["API services"]
  node_api_entry["API application<br/>[app.module.ts]"]
  node_auth["Authentication<br/>[auth.controller.ts]"]
  node_parking_ctrl["Parking endpoints"]
  node_parking_service["Parking service<br/>[parking.service.ts]"]
  node_vehicles["Vehicle endpoints"]
  node_favorites["Favorites endpoint"]
  node_alerts["Alert endpoint"]
  node_health["Health endpoint"]
end

subgraph group_data["Parking data"]
  node_stub["API data adapter<br/>[stockholm.stub.ts]"]
  node_prototype_data[("Stockholm sample data<br/>[index.ts]")]
  node_rules["Parking rules<br/>[stockholm-rules.ts]"]
  node_map_data["Tariff map overlays<br/>[stockholm-map.ts]"]
  node_shared_types["Shared contracts<br/>[index.ts]"]
  node_serving_store[("Postgres + PostGIS")]
end

subgraph group_pipeline["Rule intelligence"]
  node_workers["Rule pipeline"]
  node_source_parser["Source parser"]
  node_source_refresh["Source refresh"]
  node_databricks["Databricks workflow"]
end

node_driver(("Driver"))

node_driver -->|"uses"| node_webapp
node_webapp -->|"renders"| node_zone_map
node_webapp -->|"fetches"| node_web_api
node_webapp -->|"reads sample data"| node_prototype_data
node_web_api -->|"serves sample data"| node_prototype_data
node_web_client -.->|"requests"| node_web_api
node_driver -.->|"uses"| node_mobile
node_api_entry -->|"registers"| node_auth
node_api_entry -->|"registers"| node_parking_ctrl
node_api_entry -->|"registers"| node_vehicles
node_api_entry -->|"registers"| node_favorites
node_api_entry -->|"registers"| node_alerts
node_api_entry -->|"registers"| node_health
node_parking_ctrl -->|"delegates"| node_parking_service
node_parking_service -->|"reads parking data"| node_stub
node_auth -->|"reads demo identity"| node_stub
node_vehicles -->|"reads demo vehicles"| node_stub
node_favorites -->|"reads favorites"| node_stub
node_alerts -->|"reads alerts"| node_stub
node_stub -->|"re-exports"| node_prototype_data
node_prototype_data -->|"uses rules"| node_rules
node_prototype_data -->|"uses overlays"| node_map_data
node_prototype_data -->|"types data"| node_shared_types
node_workers -->|"loads snapshots"| node_source_parser
node_workers -->|"resolves sample rules"| node_prototype_data
node_workers -->|"types resolutions"| node_shared_types
node_source_refresh -.->|"triggers pipeline"| node_workers
node_databricks -.->|"parallels processing"| node_workers
node_workers -.->|"publishes export"| node_serving_store
node_api_entry -.->|"planned serving"| node_serving_store

click node_webapp "https://github.com/isakibul15/parksverige/blob/main/apps/web/app/_components/prototype-shell.tsx"
click node_zone_map "https://github.com/isakibul15/parksverige/blob/main/apps/web/app/_components/zone-map.tsx"
click node_web_api "https://github.com/isakibul15/parksverige/tree/main/apps/web/app/api"
click node_web_client "https://github.com/isakibul15/parksverige/blob/main/apps/web/app/_lib/api.ts"
click node_mobile "https://github.com/isakibul15/parksverige/blob/main/apps/mobile/app/index.tsx"
click node_api_entry "https://github.com/isakibul15/parksverige/blob/main/services/api/src/app.module.ts"
click node_auth "https://github.com/isakibul15/parksverige/blob/main/services/api/src/modules/auth/auth.controller.ts"
click node_parking_ctrl "https://github.com/isakibul15/parksverige/blob/main/services/api/src/modules/parking/parking.controller.ts"
click node_parking_service "https://github.com/isakibul15/parksverige/blob/main/services/api/src/modules/parking/parking.service.ts"
click node_vehicles "https://github.com/isakibul15/parksverige/blob/main/services/api/src/modules/vehicles/vehicles.controller.ts"
click node_favorites "https://github.com/isakibul15/parksverige/blob/main/services/api/src/modules/favorites/favorites.controller.ts"
click node_alerts "https://github.com/isakibul15/parksverige/blob/main/services/api/src/modules/notifications/notifications.controller.ts"
click node_health "https://github.com/isakibul15/parksverige/blob/main/services/api/src/modules/health/health.controller.ts"
click node_stub "https://github.com/isakibul15/parksverige/blob/main/services/api/src/data/stockholm.stub.ts"
click node_prototype_data "https://github.com/isakibul15/parksverige/blob/main/packages/prototype-data/src/index.ts"
click node_rules "https://github.com/isakibul15/parksverige/blob/main/packages/prototype-data/src/stockholm-rules.ts"
click node_map_data "https://github.com/isakibul15/parksverige/blob/main/packages/prototype-data/src/stockholm-map.ts"
click node_shared_types "https://github.com/isakibul15/parksverige/blob/main/packages/shared-types/src/index.ts"
click node_workers "https://github.com/isakibul15/parksverige/blob/main/services/workers/src/stockholm-rule-pipeline.ts"
click node_source_parser "https://github.com/isakibul15/parksverige/blob/main/services/workers/src/stockholm-source-parser.ts"
click node_source_refresh "https://github.com/isakibul15/parksverige/blob/main/services/workers/src/stockholm-source-refresh.ts"
click node_databricks "https://github.com/isakibul15/parksverige/blob/main/data-platform/databricks/notebooks/stockholm_rule_pipeline.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_mobile toneBlue
class node_webapp,node_zone_map,node_web_api,node_web_client toneAmber
class node_api_entry,node_auth,node_parking_ctrl,node_parking_service,node_vehicles,node_favorites,node_alerts,node_health toneMint
class node_stub,node_prototype_data,node_rules,node_map_data,node_shared_types,node_serving_store toneRose
class node_workers,node_source_parser,node_source_refresh,node_databricks,node_driver toneIndigo
```

## Components

### Driver experiences

- [Mobile app](https://github.com/isakibul15/parksverige/blob/main/apps/mobile/app/index.tsx): `apps/mobile/app/index.tsx`

### Web experience

- [Web app](https://github.com/isakibul15/parksverige/blob/main/apps/web/app/_components/prototype-shell.tsx): `apps/web/app/_components/prototype-shell.tsx`
- [Zone map](https://github.com/isakibul15/parksverige/blob/main/apps/web/app/_components/zone-map.tsx): `apps/web/app/_components/zone-map.tsx`
- [Web API routes](https://github.com/isakibul15/parksverige/tree/main/apps/web/app/api): `apps/web/app/api`
- [API client](https://github.com/isakibul15/parksverige/blob/main/apps/web/app/_lib/api.ts): `apps/web/app/_lib/api.ts`

### API services

- [API application](https://github.com/isakibul15/parksverige/blob/main/services/api/src/app.module.ts): `services/api/src/app.module.ts`
- [Authentication](https://github.com/isakibul15/parksverige/blob/main/services/api/src/modules/auth/auth.controller.ts): `services/api/src/modules/auth/auth.controller.ts`
- [Parking endpoints](https://github.com/isakibul15/parksverige/blob/main/services/api/src/modules/parking/parking.controller.ts): `services/api/src/modules/parking/parking.controller.ts`
- [Parking service](https://github.com/isakibul15/parksverige/blob/main/services/api/src/modules/parking/parking.service.ts): `services/api/src/modules/parking/parking.service.ts`
- [Vehicle endpoints](https://github.com/isakibul15/parksverige/blob/main/services/api/src/modules/vehicles/vehicles.controller.ts): `services/api/src/modules/vehicles/vehicles.controller.ts`
- [Favorites endpoint](https://github.com/isakibul15/parksverige/blob/main/services/api/src/modules/favorites/favorites.controller.ts): `services/api/src/modules/favorites/favorites.controller.ts`
- [Alert endpoint](https://github.com/isakibul15/parksverige/blob/main/services/api/src/modules/notifications/notifications.controller.ts): `services/api/src/modules/notifications/notifications.controller.ts`
- [Health endpoint](https://github.com/isakibul15/parksverige/blob/main/services/api/src/modules/health/health.controller.ts): `services/api/src/modules/health/health.controller.ts`

### Parking data

- [API data adapter](https://github.com/isakibul15/parksverige/blob/main/services/api/src/data/stockholm.stub.ts): `services/api/src/data/stockholm.stub.ts`
- [Stockholm sample data](https://github.com/isakibul15/parksverige/blob/main/packages/prototype-data/src/index.ts): `packages/prototype-data/src/index.ts`
- [Parking rules](https://github.com/isakibul15/parksverige/blob/main/packages/prototype-data/src/stockholm-rules.ts): `packages/prototype-data/src/stockholm-rules.ts`
- [Tariff map overlays](https://github.com/isakibul15/parksverige/blob/main/packages/prototype-data/src/stockholm-map.ts): `packages/prototype-data/src/stockholm-map.ts`
- [Shared contracts](https://github.com/isakibul15/parksverige/blob/main/packages/shared-types/src/index.ts): `packages/shared-types/src/index.ts`
- **Postgres + PostGIS**

### Rule intelligence

- [Rule pipeline](https://github.com/isakibul15/parksverige/blob/main/services/workers/src/stockholm-rule-pipeline.ts): `services/workers/src/stockholm-rule-pipeline.ts`
- [Source parser](https://github.com/isakibul15/parksverige/blob/main/services/workers/src/stockholm-source-parser.ts): `services/workers/src/stockholm-source-parser.ts`
- [Source refresh](https://github.com/isakibul15/parksverige/blob/main/services/workers/src/stockholm-source-refresh.ts): `services/workers/src/stockholm-source-refresh.ts`
- [Databricks workflow](https://github.com/isakibul15/parksverige/blob/main/data-platform/databricks/notebooks/stockholm_rule_pipeline.py): `data-platform/databricks/notebooks/stockholm_rule_pipeline.py`

### Other components

- **Driver**

## Connections

- Driver → Web app: uses
- Web app → Zone map: renders (evidence: `apps/web/app/_components/prototype-shell.tsx`)
- Web app → Web API routes: fetches (evidence: `apps/web/app/_components/prototype-shell.tsx`)
- Web app → Stockholm sample data: reads sample data (evidence: `apps/web/app/_components/prototype-shell.tsx`)
- Web API routes → Stockholm sample data: serves sample data (evidence: `apps/web/app/api/vehicles/route.ts`)
- API client → Web API routes: requests
- Driver → Mobile app: uses
- API application → Authentication: registers (evidence: `services/api/src/app.module.ts`)
- API application → Parking endpoints: registers (evidence: `services/api/src/app.module.ts`)
- API application → Vehicle endpoints: registers (evidence: `services/api/src/app.module.ts`)
- API application → Favorites endpoint: registers (evidence: `services/api/src/app.module.ts`)
- API application → Alert endpoint: registers (evidence: `services/api/src/app.module.ts`)
- API application → Health endpoint: registers (evidence: `services/api/src/app.module.ts`)
- Parking endpoints → Parking service: delegates (evidence: `services/api/src/modules/parking/parking.controller.ts`)
- Parking service → API data adapter: reads parking data (evidence: `services/api/src/modules/parking/parking.service.ts`)
- Authentication → API data adapter: reads demo identity (evidence: `services/api/src/modules/auth/auth.controller.ts`)
- Vehicle endpoints → API data adapter: reads demo vehicles (evidence: `services/api/src/modules/vehicles/vehicles.controller.ts`)
- Favorites endpoint → API data adapter: reads favorites (evidence: `services/api/src/modules/favorites/favorites.controller.ts`)
- Alert endpoint → API data adapter: reads alerts (evidence: `services/api/src/modules/notifications/notifications.controller.ts`)
- API data adapter → Stockholm sample data: re-exports (evidence: `services/api/src/data/stockholm.stub.ts`)
- Stockholm sample data → Parking rules: uses rules (evidence: `packages/prototype-data/src/index.ts`)
- Stockholm sample data → Tariff map overlays: uses overlays (evidence: `packages/prototype-data/src/index.ts`)
- Stockholm sample data → Shared contracts: types data (evidence: `packages/prototype-data/src/index.ts`)
- Rule pipeline → Source parser: loads snapshots (evidence: `services/workers/src/stockholm-rule-pipeline.ts`)
- Rule pipeline → Stockholm sample data: resolves sample rules (evidence: `services/workers/src/stockholm-rule-pipeline.ts`)
- Rule pipeline → Shared contracts: types resolutions (evidence: `services/workers/src/stockholm-rule-pipeline.ts`)
- Source refresh → Rule pipeline: triggers pipeline
- Databricks workflow → Rule pipeline: parallels processing
- Rule pipeline → Postgres + PostGIS: publishes export
- API application → Postgres + PostGIS: planned serving
