# di-one1/lacak-v1 architecture

> Architecture diagram of the GitHub repository di-one1/lacak-v1, 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/di-one1/lacak-v1
- Repository: https://github.com/di-one1/lacak-v1

## Overview

Lacak is a lost-and-found application: people report missing or found belongings, browse available finds, and staff or users handle matching and claims; the app also provides histories and resident records. The graph highlights the public catalog and claim workflows, plus report and resident-management capabilities indicated by the source tree. Source excerpts confirm the public data reads and claim-client calls; several route and action implementations were not sampled, so their internal wiring is omitted.

Main entry points: [`src/features/claim/components/AmbilBarangClient.tsx`](https://github.com/di-one1/lacak-v1/blob/main/src/features/claim/components/AmbilBarangClient.tsx) (Claim workflow), [`src/features/warga/components/WargaClient.tsx`](https://github.com/di-one1/lacak-v1/blob/main/src/features/warga/components/WargaClient.tsx) (Resident management), [`src/lib/prisma.ts`](https://github.com/di-one1/lacak-v1/blob/main/src/lib/prisma.ts) (Application database), [`src/app/page.tsx`](https://github.com/di-one1/lacak-v1/blob/main/src/app/page.tsx) (Public pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public discovery"]
  node_public_pages["Public pages<br/>[page.tsx]"]
  node_search_page["Search page<br/>[page.tsx]"]
  node_public_portal["Public portal<br/>[PublicPortal.tsx]"]
  node_search_portal["Catalog search"]
  node_catalog_service["Catalog data"]
  node_public_api["Found-items API<br/>[route.ts]"]
end

subgraph group_items["Item operations"]
  node_lost_report["Lost reports<br/>[lost-report.ts]"]
  node_found_item["Found-item actions<br/>[found-item.ts]"]
  node_item_lifecycle["Item lifecycle<br/>[item-lifecycle.ts]"]
  node_matching["Item matching<br/>[matching.ts]"]
  node_report_form["Report form<br/>[LaporForm.tsx]"]
  node_found_form["Found-item form"]
end

subgraph group_claims["Claim workflow"]
  node_claim_page["Claim page<br/>[page.tsx]"]
  node_claim_client["Claim workflow"]
  node_claim_actions["Claim actions<br/>[actions.ts]"]
end

subgraph group_records["Records and residents"]
  node_history_pages["History pages<br/>[page.tsx]"]
  node_warga_page["Resident records<br/>[page.tsx]"]
  node_warga_client["Resident management<br/>[WargaClient.tsx]"]
  node_warga_actions["Resident actions<br/>[actions.ts]"]
end

subgraph group_platform["Application services"]
  node_database[("Application database<br/>[prisma.ts]")]
  node_supabase[("Supabase service<br/>[supabase.ts]")]
end

node_visitor(("Visitor or user"))

node_visitor -->|"browses"| node_public_pages
node_visitor -->|"searches"| node_search_page
node_public_pages -->|"renders"| node_public_portal
node_search_page -->|"renders"| node_search_portal
node_search_portal -->|"receives catalog"| node_catalog_service
node_catalog_service -->|"reads catalog"| node_database
node_public_api -->|"reads found items"| node_database
node_visitor -->|"submits report"| node_report_form
node_visitor -->|"registers find"| node_found_form
node_claim_page -->|"renders"| node_claim_client
node_claim_client -->|"requests claim data"| node_claim_actions
node_claim_client -->|"loads matches"| node_matching
node_visitor -->|"starts claim"| node_claim_page
node_history_pages -->|"loads history"| node_database
node_warga_page -->|"renders"| node_warga_client
node_warga_client -->|"runs resident actions"| node_warga_actions
node_warga_client -->|"subscribes to changes"| node_supabase

click node_public_pages "https://github.com/di-one1/lacak-v1/blob/main/src/app/page.tsx"
click node_search_page "https://github.com/di-one1/lacak-v1/blob/main/src/app/pencarian/page.tsx"
click node_public_portal "https://github.com/di-one1/lacak-v1/blob/main/src/components/public/PublicPortal.tsx"
click node_search_portal "https://github.com/di-one1/lacak-v1/blob/main/src/components/public/PublicSearchPortal.tsx"
click node_catalog_service "https://github.com/di-one1/lacak-v1/blob/main/src/features/item/services/public-item-service.ts"
click node_public_api "https://github.com/di-one1/lacak-v1/blob/main/src/app/api/public/found-items/route.ts"
click node_lost_report "https://github.com/di-one1/lacak-v1/blob/main/src/features/item/actions/lost-report.ts"
click node_found_item "https://github.com/di-one1/lacak-v1/blob/main/src/features/item/actions/found-item.ts"
click node_item_lifecycle "https://github.com/di-one1/lacak-v1/blob/main/src/features/item/actions/item-lifecycle.ts"
click node_matching "https://github.com/di-one1/lacak-v1/blob/main/src/features/item/actions/matching.ts"
click node_report_form "https://github.com/di-one1/lacak-v1/blob/main/src/app/lapor/LaporForm.tsx"
click node_found_form "https://github.com/di-one1/lacak-v1/blob/main/src/app/taruh/TaruhBarangForm.tsx"
click node_claim_page "https://github.com/di-one1/lacak-v1/blob/main/src/app/ambil/page.tsx"
click node_claim_client "https://github.com/di-one1/lacak-v1/blob/main/src/features/claim/components/AmbilBarangClient.tsx"
click node_claim_actions "https://github.com/di-one1/lacak-v1/blob/main/src/features/claim/actions.ts"
click node_history_pages "https://github.com/di-one1/lacak-v1/blob/main/src/app/riwayat/laporan/page.tsx"
click node_warga_page "https://github.com/di-one1/lacak-v1/blob/main/src/app/data-warga/page.tsx"
click node_warga_client "https://github.com/di-one1/lacak-v1/blob/main/src/features/warga/components/WargaClient.tsx"
click node_warga_actions "https://github.com/di-one1/lacak-v1/blob/main/src/features/warga/actions.ts"
click node_database "https://github.com/di-one1/lacak-v1/blob/main/src/lib/prisma.ts"
click node_supabase "https://github.com/di-one1/lacak-v1/blob/main/src/lib/supabase.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_public_pages,node_search_page,node_public_portal,node_search_portal,node_catalog_service,node_public_api,node_visitor toneBlue
class node_lost_report,node_found_item,node_item_lifecycle,node_matching,node_report_form,node_found_form toneAmber
class node_claim_page,node_claim_client,node_claim_actions toneMint
class node_history_pages,node_warga_page,node_warga_client,node_warga_actions toneRose
class node_database,node_supabase toneIndigo
```

## Components

### Public discovery

- [Public pages](https://github.com/di-one1/lacak-v1/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Search page](https://github.com/di-one1/lacak-v1/blob/main/src/app/pencarian/page.tsx): `src/app/pencarian/page.tsx`
- [Public portal](https://github.com/di-one1/lacak-v1/blob/main/src/components/public/PublicPortal.tsx): `src/components/public/PublicPortal.tsx`
- [Catalog search](https://github.com/di-one1/lacak-v1/blob/main/src/components/public/PublicSearchPortal.tsx): `src/components/public/PublicSearchPortal.tsx`
- [Catalog data](https://github.com/di-one1/lacak-v1/blob/main/src/features/item/services/public-item-service.ts): `src/features/item/services/public-item-service.ts`
- [Found-items API](https://github.com/di-one1/lacak-v1/blob/main/src/app/api/public/found-items/route.ts): `src/app/api/public/found-items/route.ts`

### Item operations

- [Lost reports](https://github.com/di-one1/lacak-v1/blob/main/src/features/item/actions/lost-report.ts): `src/features/item/actions/lost-report.ts`
- [Found-item actions](https://github.com/di-one1/lacak-v1/blob/main/src/features/item/actions/found-item.ts): `src/features/item/actions/found-item.ts`
- [Item lifecycle](https://github.com/di-one1/lacak-v1/blob/main/src/features/item/actions/item-lifecycle.ts): `src/features/item/actions/item-lifecycle.ts`
- [Item matching](https://github.com/di-one1/lacak-v1/blob/main/src/features/item/actions/matching.ts): `src/features/item/actions/matching.ts`
- [Report form](https://github.com/di-one1/lacak-v1/blob/main/src/app/lapor/LaporForm.tsx): `src/app/lapor/LaporForm.tsx`
- [Found-item form](https://github.com/di-one1/lacak-v1/blob/main/src/app/taruh/TaruhBarangForm.tsx): `src/app/taruh/TaruhBarangForm.tsx`

### Claim workflow

- [Claim page](https://github.com/di-one1/lacak-v1/blob/main/src/app/ambil/page.tsx): `src/app/ambil/page.tsx`
- [Claim workflow](https://github.com/di-one1/lacak-v1/blob/main/src/features/claim/components/AmbilBarangClient.tsx): `src/features/claim/components/AmbilBarangClient.tsx`
- [Claim actions](https://github.com/di-one1/lacak-v1/blob/main/src/features/claim/actions.ts): `src/features/claim/actions.ts`

### Records and residents

- [History pages](https://github.com/di-one1/lacak-v1/blob/main/src/app/riwayat/laporan/page.tsx): `src/app/riwayat/laporan/page.tsx`
- [Resident records](https://github.com/di-one1/lacak-v1/blob/main/src/app/data-warga/page.tsx): `src/app/data-warga/page.tsx`
- [Resident management](https://github.com/di-one1/lacak-v1/blob/main/src/features/warga/components/WargaClient.tsx): `src/features/warga/components/WargaClient.tsx`
- [Resident actions](https://github.com/di-one1/lacak-v1/blob/main/src/features/warga/actions.ts): `src/features/warga/actions.ts`

### Application services

- [Application database](https://github.com/di-one1/lacak-v1/blob/main/src/lib/prisma.ts): `src/lib/prisma.ts`
- [Supabase service](https://github.com/di-one1/lacak-v1/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`

### Other components

- **Visitor or user**

## Connections

- Visitor or user → Public pages: browses
- Visitor or user → Search page: searches
- Public pages → Public portal: renders
- Search page → Catalog search: renders
- Catalog search → Catalog data: receives catalog
- Catalog data → Application database: reads catalog
- Found-items API → Application database: reads found items
- Visitor or user → Report form: submits report
- Visitor or user → Found-item form: registers find
- Claim page → Claim workflow: renders
- Claim workflow → Claim actions: requests claim data
- Claim workflow → Item matching: loads matches
- Visitor or user → Claim page: starts claim
- History pages → Application database: loads history
- Resident records → Resident management: renders
- Resident management → Resident actions: runs resident actions
- Resident management → Supabase service: subscribes to changes
