# tofanharits89/sintesanext_front architecture

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

- Interactive diagram: https://gitdiagram.com/tofanharits89/sintesanext_front
- Repository: https://github.com/tofanharits89/sintesanext_front

## Overview

Indo Finance Dashboard is a Next.js application for exploring public-finance data and operating related administrative workflows. Its principal user journey is to sign in, open a finance or inquiry view, and work with the resulting data; other major areas cover supplier analytics, regional transfers, messaging, and monitoring. Sampled API routes show server-side proxies forwarding session cookies and, for writes, CSRF tokens to a separate backend. The README is empty, and the sampled source does not establish most page-to-API wiring, so those links are intentionally omitted.

Main entry points: [`src/hooks/useAuth.ts`](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/hooks/useAuth.ts) (Auth state and roles), [`src/app/api/users/route.ts`](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/api/users/route.ts) (Users API proxy), [`src/app/api/satker/route.ts`](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/api/satker/route.ts) (Satker API), [`src/app/api/saved-queries/route.ts`](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/api/saved-queries/route.ts) (Saved queries API proxy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and administration"]
  node_login["Sign in<br/>[page.tsx]"]
  node_authhook["Auth state and roles<br/>[useAuth.ts]"]
  node_usersui["User administration<br/>[page.tsx]"]
  node_usersapi["Users API proxy<br/>[route.ts]"]
  node_csrf["CSRF token manager<br/>[csrfManager.ts]"]
end

subgraph group_finance["Finance data"]
  node_dashboard["Finance dashboard<br/>[page.tsx]"]
  node_epa["EPA analysis<br/>[page.tsx]"]
  node_satker["Satker data<br/>[page.tsx]"]
  node_satkerapi["Satker API<br/>[route.ts]"]
  node_supplier["Supplier analytics<br/>[page.tsx]"]
  node_tkd["Regional transfers<br/>[page.tsx]"]
end

subgraph group_inquiry["Inquiry and reporting"]
  node_inquiry["Data inquiry<br/>[page.tsx]"]
  node_queryui["Saved query management"]
  node_queryapi["Saved queries API proxy<br/>[route.ts]"]
end

subgraph group_collaboration["Messaging and alerts"]
  node_messages["Messaging<br/>[page.tsx]"]
  node_notifications["Notifications<br/>[page.tsx]"]
  node_notificationapi["Notifications API proxy<br/>[route.ts]"]
end

subgraph group_operations["Platform operations"]
  node_monitor["Performance monitoring<br/>[page.tsx]"]
end

node_user(("Dashboard user"))
node_backend["Finance backend"]

node_user -->|"signs in"| node_login
node_user -->|"opens"| node_dashboard
node_user -->|"analyzes"| node_epa
node_user -->|"explores"| node_satker
node_user -->|"reviews"| node_supplier
node_user -->|"reviews"| node_tkd
node_user -->|"queries"| node_inquiry
node_user -->|"messages"| node_messages
node_user -->|"checks"| node_notifications
node_user -->|"monitors"| node_monitor
node_authhook -->|"clears token cache"| node_csrf
node_usersapi -->|"forwards users requests"| node_backend
node_satkerapi -->|"fetches satker data"| node_backend
node_queryapi -->|"forwards query requests"| node_backend
node_notificationapi -->|"forwards notification requests"| node_backend
node_user -->|"administers users"| node_usersui
node_user -->|"manages saved queries"| node_queryui

click node_login "https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/(public)/login/page.tsx"
click node_authhook "https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/hooks/useAuth.ts"
click node_usersui "https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/users/page.tsx"
click node_usersapi "https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/api/users/route.ts"
click node_dashboard "https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/dashboard/page.tsx"
click node_epa "https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/epa/analisa/page.tsx"
click node_satker "https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/satker/page.tsx"
click node_satkerapi "https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/api/satker/route.ts"
click node_supplier "https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/data-supplier/dashboard/page.tsx"
click node_tkd "https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/transfer-daerah/dau/page.tsx"
click node_inquiry "https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/inquiry-data/belanja/page.tsx"
click node_queryui "https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/components/inquiry-data/query-management.tsx"
click node_queryapi "https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/api/saved-queries/route.ts"
click node_messages "https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/messages/page.tsx"
click node_notifications "https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/notifications/page.tsx"
click node_notificationapi "https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/api/notifications/route.ts"
click node_monitor "https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/monitor-performa/page.tsx"
click node_csrf "https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/lib/security/csrfManager.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_authhook,node_usersui,node_usersapi,node_csrf,node_user toneBlue
class node_dashboard,node_epa,node_satker,node_satkerapi,node_supplier,node_tkd toneAmber
class node_inquiry,node_queryui,node_queryapi toneMint
class node_messages,node_notifications,node_notificationapi toneRose
class node_monitor,node_backend toneIndigo
```

## Components

### Access and administration

- [Sign in](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/(public)/login/page.tsx): `src/app/(public)/login/page.tsx`
- [Auth state and roles](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/hooks/useAuth.ts): `src/hooks/useAuth.ts`
- [User administration](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/users/page.tsx): `src/app/users/page.tsx`
- [Users API proxy](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/api/users/route.ts): `src/app/api/users/route.ts`
- [CSRF token manager](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/lib/security/csrfManager.ts): `src/lib/security/csrfManager.ts`

### Finance data

- [Finance dashboard](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`
- [EPA analysis](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/epa/analisa/page.tsx): `src/app/epa/analisa/page.tsx`
- [Satker data](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/satker/page.tsx): `src/app/satker/page.tsx`
- [Satker API](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/api/satker/route.ts): `src/app/api/satker/route.ts`
- [Supplier analytics](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/data-supplier/dashboard/page.tsx): `src/app/data-supplier/dashboard/page.tsx`
- [Regional transfers](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/transfer-daerah/dau/page.tsx): `src/app/transfer-daerah/dau/page.tsx`

### Inquiry and reporting

- [Data inquiry](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/inquiry-data/belanja/page.tsx): `src/app/inquiry-data/belanja/page.tsx`
- [Saved query management](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/components/inquiry-data/query-management.tsx): `src/components/inquiry-data/query-management.tsx`
- [Saved queries API proxy](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/api/saved-queries/route.ts): `src/app/api/saved-queries/route.ts`

### Messaging and alerts

- [Messaging](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/messages/page.tsx): `src/app/messages/page.tsx`
- [Notifications](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/notifications/page.tsx): `src/app/notifications/page.tsx`
- [Notifications API proxy](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/api/notifications/route.ts): `src/app/api/notifications/route.ts`

### Platform operations

- [Performance monitoring](https://github.com/tofanharits89/sintesanext_front/blob/postgresExp/src/app/monitor-performa/page.tsx): `src/app/monitor-performa/page.tsx`

### Other components

- **Dashboard user**
- **Finance backend**

## Connections

- Dashboard user → Sign in: signs in
- Dashboard user → Finance dashboard: opens
- Dashboard user → EPA analysis: analyzes
- Dashboard user → Satker data: explores
- Dashboard user → Supplier analytics: reviews
- Dashboard user → Regional transfers: reviews
- Dashboard user → Data inquiry: queries
- Dashboard user → Messaging: messages
- Dashboard user → Notifications: checks
- Dashboard user → Performance monitoring: monitors
- Auth state and roles → CSRF token manager: clears token cache
- Users API proxy → Finance backend: forwards users requests
- Satker API → Finance backend: fetches satker data
- Saved queries API proxy → Finance backend: forwards query requests
- Notifications API proxy → Finance backend: forwards notification requests
- Dashboard user → User administration: administers users
- Dashboard user → Saved query management: manages saved queries
