# nesar123sbr/geotanah-deliserdang architecture

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

- Interactive diagram: https://gitdiagram.com/nesar123sbr/geotanah-deliserdang
- Repository: https://github.com/nesar123sbr/geotanah-deliserdang

## Overview

GeoTanah Dairi is a cadastral WebGIS for parcel verification and field surveys. The principal workflow runs from dashboard parcel review and spatial metrics to field collection/import, photo documentation, and survey submission, with updated parcel data available for review and export. The graph preserves documented capabilities such as filters, overlap/area checks, realtime updates, and audit/RLS. Some page and database wiring is described in the README rather than sampled source, so those links reflect that documentation; uncertain implementation details are omitted.

Main entry points: [`app/page.tsx`](https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/app/page.tsx) (Parcel dashboard), [`app/survey/page.tsx`](https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/app/survey/page.tsx) (Survey workflow), [`lib/supabase.ts`](https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/lib/supabase.ts) (Supabase client), [`types/database.ts`](https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/types/database.ts) (Parcel data and metrics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web workflows"]
  node_dashboard["Parcel dashboard<br/>[page.tsx]"]
  node_auth["Login and recovery<br/>[AuthModal.tsx]"]
  node_survey["Survey workflow<br/>[page.tsx]"]
  node_reset["Password reset<br/>[page.tsx]"]
end

subgraph group_gis["Mapping and spatial data"]
  node_parcelmap["Parcel map<br/>[ParcelMap.tsx]"]
  node_drawmap["Survey digitizer<br/>[SurveyDrawMap.tsx]"]
  node_geoimport["GPS file parser<br/>[parseGeoFile.ts]"]
end

subgraph group_cloud["Supabase services"]
  node_supabaseclient["Supabase client<br/>[supabase.ts]"]
  node_parceldata[("Parcel data and metrics<br/>[database.ts]")]
  node_storage[("Photo storage<br/>[supabase.ts]")]
  node_policies["RLS and audit"]
end

subgraph group_exports["Survey deliverables"]
  node_exportmodal["Export controls<br/>[ExportModal.tsx]"]
  node_exporter["Geodatabase exporter"]
  node_archive["ZIP deliverables"]
end

node_reviewer(("Reviewer"))
node_surveyor(("Field surveyor"))
node_imagery(("Map imagery"))

node_reviewer -->|"reviews parcels"| node_dashboard
node_surveyor -->|"records survey"| node_survey
node_dashboard -->|"requests parcel data"| node_supabaseclient
node_supabaseclient -->|"calls metrics RPC"| node_parceldata
node_parceldata -->|"returns metrics"| node_dashboard
node_parceldata -.->|"streams updates"| node_dashboard
node_dashboard -->|"renders parcels"| node_parcelmap
node_imagery -->|"provides tiles"| node_parcelmap
node_dashboard -->|"opens login"| node_auth
node_auth -->|"authenticates"| node_supabaseclient
node_reset -->|"resets password"| node_supabaseclient
node_survey -->|"parses GPS file"| node_geoimport
node_geoimport -->|"returns polygon metadata"| node_survey
node_survey -->|"displays digitizing map"| node_drawmap
node_imagery -->|"provides tiles"| node_drawmap
node_survey -->|"submits survey"| node_supabaseclient
node_supabaseclient -->|"calls survey RPC"| node_parceldata
node_survey -->|"uploads photos"| node_storage
node_dashboard -->|"removes parcel photos"| node_storage
node_parceldata -->|"enforces access and audit"| node_policies
node_dashboard -->|"opens export"| node_exportmodal
node_exportmodal -->|"starts export"| node_exporter
node_exporter -->|"fetches transformed photos"| node_storage
node_exporter -->|"packages ZIP"| node_archive
node_archive -->|"downloads"| node_reviewer

click node_dashboard "https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/app/page.tsx"
click node_auth "https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/components/AuthModal.tsx"
click node_survey "https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/app/survey/page.tsx"
click node_reset "https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/app/reset-password/page.tsx"
click node_parcelmap "https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/components/ParcelMap.tsx"
click node_drawmap "https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/components/SurveyDrawMap.tsx"
click node_geoimport "https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/lib/parseGeoFile.ts"
click node_supabaseclient "https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/lib/supabase.ts"
click node_parceldata "https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/types/database.ts"
click node_storage "https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/lib/supabase.ts"
click node_policies "https://github.com/nesar123sbr/geotanah-deliserdang/tree/main/supabase/migrations"
click node_exportmodal "https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/components/ExportModal.tsx"
click node_exporter "https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/lib/exportGeodatabase.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_dashboard,node_auth,node_survey,node_reset,node_reviewer toneBlue
class node_parcelmap,node_drawmap,node_geoimport toneAmber
class node_supabaseclient,node_parceldata,node_storage,node_policies toneMint
class node_exportmodal,node_exporter,node_archive toneRose
class node_surveyor,node_imagery toneIndigo
```

## Components

### Web workflows

- [Parcel dashboard](https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/app/page.tsx): `app/page.tsx`
- [Login and recovery](https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/components/AuthModal.tsx): `components/AuthModal.tsx`
- [Survey workflow](https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/app/survey/page.tsx): `app/survey/page.tsx`
- [Password reset](https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/app/reset-password/page.tsx): `app/reset-password/page.tsx`

### Mapping and spatial data

- [Parcel map](https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/components/ParcelMap.tsx): `components/ParcelMap.tsx`
- [Survey digitizer](https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/components/SurveyDrawMap.tsx): `components/SurveyDrawMap.tsx`
- [GPS file parser](https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/lib/parseGeoFile.ts): `lib/parseGeoFile.ts`

### Supabase services

- [Supabase client](https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/lib/supabase.ts): `lib/supabase.ts`
- [Parcel data and metrics](https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/types/database.ts): `types/database.ts`
- [Photo storage](https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/lib/supabase.ts): `lib/supabase.ts`
- [RLS and audit](https://github.com/nesar123sbr/geotanah-deliserdang/tree/main/supabase/migrations): `supabase/migrations`

### Survey deliverables

- [Export controls](https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/components/ExportModal.tsx): `components/ExportModal.tsx`
- [Geodatabase exporter](https://github.com/nesar123sbr/geotanah-deliserdang/blob/main/lib/exportGeodatabase.ts): `lib/exportGeodatabase.ts`
- **ZIP deliverables**

### Other components

- **Reviewer**
- **Field surveyor**
- **Map imagery**

## Connections

- Reviewer → Parcel dashboard: reviews parcels
- Field surveyor → Survey workflow: records survey
- Parcel dashboard → Supabase client: requests parcel data
- Supabase client → Parcel data and metrics: calls metrics RPC
- Parcel data and metrics → Parcel dashboard: returns metrics
- Parcel data and metrics → Parcel dashboard: streams updates
- Parcel dashboard → Parcel map: renders parcels
- Map imagery → Parcel map: provides tiles
- Parcel dashboard → Login and recovery: opens login
- Login and recovery → Supabase client: authenticates
- Password reset → Supabase client: resets password
- Survey workflow → GPS file parser: parses GPS file
- GPS file parser → Survey workflow: returns polygon metadata
- Survey workflow → Survey digitizer: displays digitizing map
- Map imagery → Survey digitizer: provides tiles
- Survey workflow → Supabase client: submits survey
- Supabase client → Parcel data and metrics: calls survey RPC
- Survey workflow → Photo storage: uploads photos
- Parcel dashboard → Photo storage: removes parcel photos
- Parcel data and metrics → RLS and audit: enforces access and audit
- Parcel dashboard → Export controls: opens export
- Export controls → Geodatabase exporter: starts export
- Geodatabase exporter → Photo storage: fetches transformed photos
- Geodatabase exporter → ZIP deliverables: packages ZIP
- ZIP deliverables → Reviewer: downloads
