# aryawirawicaksana029-ui/project-synchronization-live-location architecture

> Architecture diagram of the GitHub repository aryawirawicaksana029-ui/project-synchronization-live-location, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aryawirawicaksana029-ui/project-synchronization-live-location
- Repository: https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location

## Overview

This is a Next.js field-sales and store-operations application: field staff manage store visits, orders, payments, and location tracking, while administrators manage users, products, stores, tasks, and operational reporting. The graph follows those user-facing workflows into the shared data-access layer. Some page-to-data relationships are supported by the SOURCE INDEX rather than inspected page excerpts; links not shown by those references are omitted.

Main entry points: [`src/lib/db.ts`](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/lib/db.ts) (Data access), [`src/app/(dashboard)/dashboard/page.tsx`](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/(dashboard)/dashboard/page.tsx) (Dashboard overview), [`src/app/(dashboard)/dashboard/users/page.tsx`](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/(dashboard)/dashboard/users/page.tsx) (User and task management), [`src/app/(dashboard)/dashboard/katalog/page.tsx`](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/(dashboard)/dashboard/katalog/page.tsx) (Product catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Admin operations"]
  node_login["Sign in<br/>[page.tsx]"]
  node_overview["Dashboard overview<br/>[page.tsx]"]
  node_users["User and task management<br/>[page.tsx]"]
  node_catalog["Product catalog<br/>[page.tsx]"]
  node_stores_admin["Store administration<br/>[page.tsx]"]
  node_reports["Operational reports<br/>[page.tsx]"]
  node_attendance["Attendance<br/>[page.tsx]"]
  node_admin_map_page["Live map page<br/>[page.tsx]"]
  node_admin_map["Live map<br/>[AdminLiveMap.tsx]"]
  node_add_store["Add-store modal"]
  node_chart["Dashboard chart<br/>[DashboardChart.tsx]"]
end

subgraph group_field["Field operations"]
  node_mobile_home["Field home<br/>[page.tsx]"]
  node_mobile_stores["Store list<br/>[page.tsx]"]
  node_visit_detail["Store visit and order"]
  node_new_store["Register store<br/>[page.tsx]"]
  node_profile["Profile and deposits<br/>[page.tsx]"]
  node_store_map["Store location map"]
end

subgraph group_tracking["Location tracking"]
  node_location_page["Location screen<br/>[page.tsx]"]
  node_tracking_service["Live tracking service<br/>[trackingService.ts]"]
  node_tracking_map["Tracking map"]
end

subgraph group_data["Shared data layer"]
  node_db["Data access<br/>[db.ts]"]
  node_insforge["InsForge client<br/>[insforge.ts]"]
  node_types["Database types<br/>[database.types.ts]"]
  node_catalog_data["Catalog data and formatting<br/>[catalogData.ts]"]
end

node_admin_actor(("Administrator"))
node_field_actor(("Field staff"))

node_admin_actor -->|"signs in"| node_login
node_admin_actor -->|"views operations"| node_overview
node_admin_actor -->|"manages users"| node_users
node_admin_actor -->|"manages products"| node_catalog
node_admin_actor -->|"manages stores"| node_stores_admin
node_admin_actor -->|"reviews reports"| node_reports
node_admin_actor -->|"reviews attendance"| node_attendance
node_admin_actor -->|"views live map"| node_admin_map_page
node_admin_map_page -->|"renders map"| node_admin_map
node_admin_map_page -->|"opens modal"| node_add_store
node_admin_map -->|"reads location logs"| node_db
node_add_store -->|"creates store"| node_db
node_add_store -->|"loads map"| node_store_map
node_overview -->|"renders chart"| node_chart
node_overview -->|"loads dashboard data"| node_db
node_users -->|"manages users and tasks"| node_db
node_users -->|"formats amounts"| node_catalog_data
node_catalog -->|"manages products"| node_db
node_catalog -->|"formats prices"| node_catalog_data
node_stores_admin -->|"manages stores"| node_db
node_reports -->|"loads report data"| node_db
node_attendance -->|"loads attendance data"| node_db
node_field_actor -->|"uses field app"| node_mobile_home
node_field_actor -->|"browses stores"| node_mobile_stores
node_field_actor -->|"manages profile"| node_profile
node_mobile_home -->|"loads field activity"| node_db
node_mobile_home -->|"reads tracking state"| node_tracking_service
node_mobile_stores -->|"loads stores"| node_db
node_visit_detail -->|"records visit and order"| node_db
node_visit_detail -->|"formats prices"| node_catalog_data
node_new_store -->|"creates store"| node_db
node_new_store -->|"uses location map"| node_store_map
node_profile -->|"updates profile and deposits"| node_db
node_location_page -->|"controls tracking"| node_tracking_service
node_location_page -->|"renders tracking map"| node_tracking_map
node_tracking_service -->|"writes location pings"| node_db
node_db -->|"uses configured client"| node_insforge
node_db -->|"uses row types"| node_types

click node_login "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/login/page.tsx"
click node_overview "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/(dashboard)/dashboard/page.tsx"
click node_users "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/(dashboard)/dashboard/users/page.tsx"
click node_catalog "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/(dashboard)/dashboard/katalog/page.tsx"
click node_stores_admin "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/(dashboard)/dashboard/toko/page.tsx"
click node_reports "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/(dashboard)/dashboard/laporan/page.tsx"
click node_attendance "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/(dashboard)/dashboard/presensi/page.tsx"
click node_admin_map_page "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/(dashboard)/dashboard/peta/page.tsx"
click node_admin_map "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/components/AdminLiveMap.tsx"
click node_add_store "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/components/AdminAddStoreModal.tsx"
click node_chart "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/components/DashboardChart.tsx"
click node_mobile_home "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/mobile/page.tsx"
click node_mobile_stores "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/mobile/toko/page.tsx"
click node_visit_detail "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/mobile/toko/%5Bid%5D/DetailTokoClient.tsx"
click node_new_store "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/mobile/toko/baru/page.tsx"
click node_profile "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/mobile/profil/page.tsx"
click node_location_page "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/mobile/lokasi/page.tsx"
click node_tracking_service "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/lib/trackingService.ts"
click node_tracking_map "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/components/LocationTrackingMap.tsx"
click node_store_map "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/components/StoreLocationMap.tsx"
click node_db "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/lib/db.ts"
click node_insforge "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/lib/insforge.ts"
click node_types "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/lib/database.types.ts"
click node_catalog_data "https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/lib/catalogData.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_login,node_overview,node_users,node_catalog,node_stores_admin,node_reports,node_attendance,node_admin_map_page,node_admin_map,node_add_store,node_chart toneBlue
class node_mobile_home,node_mobile_stores,node_visit_detail,node_new_store,node_profile,node_store_map toneAmber
class node_location_page,node_tracking_service,node_tracking_map toneMint
class node_db,node_insforge,node_types,node_catalog_data toneRose
class node_admin_actor,node_field_actor toneIndigo
```

## Components

### Admin operations

- [Sign in](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/login/page.tsx): `src/app/login/page.tsx`
- [Dashboard overview](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/(dashboard)/dashboard/page.tsx): `src/app/(dashboard)/dashboard/page.tsx`
- [User and task management](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/(dashboard)/dashboard/users/page.tsx): `src/app/(dashboard)/dashboard/users/page.tsx`
- [Product catalog](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/(dashboard)/dashboard/katalog/page.tsx): `src/app/(dashboard)/dashboard/katalog/page.tsx`
- [Store administration](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/(dashboard)/dashboard/toko/page.tsx): `src/app/(dashboard)/dashboard/toko/page.tsx`
- [Operational reports](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/(dashboard)/dashboard/laporan/page.tsx): `src/app/(dashboard)/dashboard/laporan/page.tsx`
- [Attendance](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/(dashboard)/dashboard/presensi/page.tsx): `src/app/(dashboard)/dashboard/presensi/page.tsx`
- [Live map page](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/(dashboard)/dashboard/peta/page.tsx): `src/app/(dashboard)/dashboard/peta/page.tsx`
- [Live map](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/components/AdminLiveMap.tsx): `src/components/AdminLiveMap.tsx`
- [Add-store modal](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/components/AdminAddStoreModal.tsx): `src/components/AdminAddStoreModal.tsx`
- [Dashboard chart](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/components/DashboardChart.tsx): `src/components/DashboardChart.tsx`

### Field operations

- [Field home](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/mobile/page.tsx): `src/app/mobile/page.tsx`
- [Store list](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/mobile/toko/page.tsx): `src/app/mobile/toko/page.tsx`
- [Store visit and order](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/mobile/toko/%5Bid%5D/DetailTokoClient.tsx): `src/app/mobile/toko/[id]/DetailTokoClient.tsx`
- [Register store](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/mobile/toko/baru/page.tsx): `src/app/mobile/toko/baru/page.tsx`
- [Profile and deposits](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/mobile/profil/page.tsx): `src/app/mobile/profil/page.tsx`
- [Store location map](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/components/StoreLocationMap.tsx): `src/components/StoreLocationMap.tsx`

### Location tracking

- [Location screen](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/app/mobile/lokasi/page.tsx): `src/app/mobile/lokasi/page.tsx`
- [Live tracking service](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/lib/trackingService.ts): `src/lib/trackingService.ts`
- [Tracking map](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/components/LocationTrackingMap.tsx): `src/components/LocationTrackingMap.tsx`

### Shared data layer

- [Data access](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/lib/db.ts): `src/lib/db.ts`
- [InsForge client](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/lib/insforge.ts): `src/lib/insforge.ts`
- [Database types](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/lib/database.types.ts): `src/lib/database.types.ts`
- [Catalog data and formatting](https://github.com/aryawirawicaksana029-ui/project-synchronization-live-location/blob/main/src/lib/catalogData.ts): `src/lib/catalogData.ts`

### Other components

- **Administrator**
- **Field staff**

## Connections

- Administrator → Sign in: signs in (evidence: `src/app/login/page.tsx`)
- Administrator → Dashboard overview: views operations (evidence: `src/app/(dashboard)/dashboard/page.tsx`)
- Administrator → User and task management: manages users (evidence: `src/app/(dashboard)/dashboard/users/page.tsx`)
- Administrator → Product catalog: manages products (evidence: `src/app/(dashboard)/dashboard/katalog/page.tsx`)
- Administrator → Store administration: manages stores (evidence: `src/app/(dashboard)/dashboard/toko/page.tsx`)
- Administrator → Operational reports: reviews reports (evidence: `src/app/(dashboard)/dashboard/laporan/page.tsx`)
- Administrator → Attendance: reviews attendance (evidence: `src/app/(dashboard)/dashboard/presensi/page.tsx`)
- Administrator → Live map page: views live map (evidence: `src/app/(dashboard)/dashboard/peta/page.tsx`)
- Live map page → Live map: renders map (evidence: `src/app/(dashboard)/dashboard/peta/page.tsx`)
- Live map page → Add-store modal: opens modal (evidence: `src/app/(dashboard)/dashboard/peta/page.tsx`)
- Live map → Data access: reads location logs (evidence: `src/components/AdminLiveMap.tsx`)
- Add-store modal → Data access: creates store (evidence: `src/components/AdminAddStoreModal.tsx`)
- Add-store modal → Store location map: loads map (evidence: `src/components/AdminAddStoreModal.tsx`)
- Dashboard overview → Dashboard chart: renders chart (evidence: `src/app/(dashboard)/dashboard/page.tsx`)
- Dashboard overview → Data access: loads dashboard data (evidence: `src/app/(dashboard)/dashboard/page.tsx`)
- User and task management → Data access: manages users and tasks (evidence: `src/app/(dashboard)/dashboard/users/page.tsx`)
- User and task management → Catalog data and formatting: formats amounts (evidence: `src/app/(dashboard)/dashboard/users/page.tsx`)
- Product catalog → Data access: manages products (evidence: `src/app/(dashboard)/dashboard/katalog/page.tsx`)
- Product catalog → Catalog data and formatting: formats prices (evidence: `src/app/(dashboard)/dashboard/katalog/page.tsx`)
- Store administration → Data access: manages stores (evidence: `src/app/(dashboard)/dashboard/toko/page.tsx`)
- Operational reports → Data access: loads report data (evidence: `src/app/(dashboard)/dashboard/laporan/page.tsx`)
- Attendance → Data access: loads attendance data (evidence: `src/app/(dashboard)/dashboard/presensi/page.tsx`)
- Field staff → Field home: uses field app (evidence: `src/app/mobile/page.tsx`)
- Field staff → Store list: browses stores (evidence: `src/app/mobile/toko/page.tsx`)
- Field staff → Profile and deposits: manages profile (evidence: `src/app/mobile/profil/page.tsx`)
- Field home → Data access: loads field activity (evidence: `src/app/mobile/page.tsx`)
- Field home → Live tracking service: reads tracking state (evidence: `src/app/mobile/page.tsx`)
- Store list → Data access: loads stores (evidence: `src/app/mobile/toko/page.tsx`)
- Store visit and order → Data access: records visit and order (evidence: `src/app/mobile/toko/[id]/DetailTokoClient.tsx`)
- Store visit and order → Catalog data and formatting: formats prices (evidence: `src/app/mobile/toko/[id]/DetailTokoClient.tsx`)
- Register store → Data access: creates store (evidence: `src/app/mobile/toko/baru/page.tsx`)
- Register store → Store location map: uses location map (evidence: `src/app/mobile/toko/baru/page.tsx`)
- Profile and deposits → Data access: updates profile and deposits (evidence: `src/app/mobile/profil/page.tsx`)
- Location screen → Live tracking service: controls tracking (evidence: `src/app/mobile/lokasi/page.tsx`)
- Location screen → Tracking map: renders tracking map (evidence: `src/app/mobile/lokasi/page.tsx`)
- Live tracking service → Data access: writes location pings (evidence: `src/lib/trackingService.ts`)
- Data access → InsForge client: uses configured client (evidence: `src/lib/db.ts`)
- Data access → Database types: uses row types (evidence: `src/lib/db.ts`)
