# marlblue/wargacheck architecture

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

## Overview

WargaCheck is an Indonesian AI document assistant. Residents can chat with the assistant, generate a personalized administrative-document checklist, or scan a document for analysis. The supplied source excerpts support the client-to-server API flows and the server’s Gemini integration; implementation details for scanning and several other component interactions were not sampled.

Main entry points: [`src/App.tsx`](https://github.com/marlblue/wargacheck/blob/main/src/App.tsx) (App navigation), [`src/services/gemini.ts`](https://github.com/marlblue/wargacheck/blob/main/src/services/gemini.ts) (API client), [`src/components/Chat.tsx`](https://github.com/marlblue/wargacheck/blob/main/src/components/Chat.tsx) (AI chat), [`src/components/BerkasChecker.tsx`](https://github.com/marlblue/wargacheck/blob/main/src/components/BerkasChecker.tsx) (Checklist builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_main["React entry<br/>[main.tsx]"]
  node_app_shell["App navigation<br/>[App.tsx]"]
end

subgraph group_features["User features"]
  node_welcome["Welcome screen<br/>[WelcomeContent.tsx]"]
  node_chat["AI chat<br/>[Chat.tsx]"]
  node_chat_input["Chat input<br/>[ChatInput.tsx]"]
  node_berkas["Checklist builder<br/>[BerkasChecker.tsx]"]
  node_scanner["Document scanner"]
end

subgraph group_integration["AI integration"]
  node_client_api["API client<br/>[gemini.ts]"]
  node_chat_api["Chat endpoint<br/>[server.js]"]
  node_check_api["Checklist endpoint<br/>[server.js]"]
  node_scan_api["Scan endpoint<br/>[server.js]"]
end

subgraph group_utilities["Shared utilities"]
  node_theme["Theme preference<br/>[useTheme.ts]"]
  node_text_format["Text formatting<br/>[formatText.ts]"]
end

node_resident(("Resident"))
node_gemini{{"Google Gemini"}}

node_resident -->|"opens app"| node_main
node_main -->|"renders"| node_app_shell
node_app_shell -->|"shows"| node_welcome
node_app_shell -->|"loads"| node_chat
node_app_shell -->|"loads"| node_berkas
node_app_shell -->|"opens"| node_scanner
node_app_shell -->|"uses"| node_theme
node_welcome -->|"requests navigation"| node_app_shell
node_chat -->|"renders"| node_chat_input
node_chat_input -->|"submits message"| node_chat
node_chat -->|"sends chat"| node_client_api
node_berkas -->|"requests checklist"| node_client_api
node_scanner -->|"uploads image"| node_client_api
node_client_api -->|"posts chat"| node_chat_api
node_client_api -->|"posts details"| node_check_api
node_client_api -->|"posts image"| node_scan_api
node_chat_api -->|"generates response"| node_gemini
node_check_api -->|"generates checklist"| node_gemini
node_scan_api -->|"analyzes image"| node_gemini
node_chat -->|"formats sharing text"| node_text_format
node_berkas -->|"formats checklist"| node_text_format

click node_main "https://github.com/marlblue/wargacheck/blob/main/src/main.tsx"
click node_app_shell "https://github.com/marlblue/wargacheck/blob/main/src/App.tsx"
click node_welcome "https://github.com/marlblue/wargacheck/blob/main/src/components/WelcomeContent.tsx"
click node_chat "https://github.com/marlblue/wargacheck/blob/main/src/components/Chat.tsx"
click node_chat_input "https://github.com/marlblue/wargacheck/blob/main/src/components/ChatInput.tsx"
click node_berkas "https://github.com/marlblue/wargacheck/blob/main/src/components/BerkasChecker.tsx"
click node_scanner "https://github.com/marlblue/wargacheck/blob/main/src/components/DocumentScanner.tsx"
click node_client_api "https://github.com/marlblue/wargacheck/blob/main/src/services/gemini.ts"
click node_chat_api "https://github.com/marlblue/wargacheck/blob/main/server.js"
click node_check_api "https://github.com/marlblue/wargacheck/blob/main/server.js"
click node_scan_api "https://github.com/marlblue/wargacheck/blob/main/server.js"
click node_theme "https://github.com/marlblue/wargacheck/blob/main/src/hooks/useTheme.ts"
click node_text_format "https://github.com/marlblue/wargacheck/blob/main/src/utils/formatText.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_main,node_app_shell toneBlue
class node_welcome,node_chat,node_chat_input,node_berkas,node_scanner toneAmber
class node_client_api,node_chat_api,node_check_api,node_scan_api toneMint
class node_theme,node_text_format toneRose
class node_resident,node_gemini toneIndigo
```

## Components

### Application shell

- [React entry](https://github.com/marlblue/wargacheck/blob/main/src/main.tsx): `src/main.tsx`
- [App navigation](https://github.com/marlblue/wargacheck/blob/main/src/App.tsx): `src/App.tsx`

### User features

- [Welcome screen](https://github.com/marlblue/wargacheck/blob/main/src/components/WelcomeContent.tsx): `src/components/WelcomeContent.tsx`
- [AI chat](https://github.com/marlblue/wargacheck/blob/main/src/components/Chat.tsx): `src/components/Chat.tsx`
- [Chat input](https://github.com/marlblue/wargacheck/blob/main/src/components/ChatInput.tsx): `src/components/ChatInput.tsx`
- [Checklist builder](https://github.com/marlblue/wargacheck/blob/main/src/components/BerkasChecker.tsx): `src/components/BerkasChecker.tsx`
- [Document scanner](https://github.com/marlblue/wargacheck/blob/main/src/components/DocumentScanner.tsx): `src/components/DocumentScanner.tsx`

### AI integration

- [API client](https://github.com/marlblue/wargacheck/blob/main/src/services/gemini.ts): `src/services/gemini.ts`
- [Chat endpoint](https://github.com/marlblue/wargacheck/blob/main/server.js): `server.js`
- [Checklist endpoint](https://github.com/marlblue/wargacheck/blob/main/server.js): `server.js`
- [Scan endpoint](https://github.com/marlblue/wargacheck/blob/main/server.js): `server.js`

### Shared utilities

- [Theme preference](https://github.com/marlblue/wargacheck/blob/main/src/hooks/useTheme.ts): `src/hooks/useTheme.ts`
- [Text formatting](https://github.com/marlblue/wargacheck/blob/main/src/utils/formatText.ts): `src/utils/formatText.ts`

### Other components

- **Resident**
- **Google Gemini**

## Connections

- Resident → React entry: opens app
- React entry → App navigation: renders
- App navigation → Welcome screen: shows
- App navigation → AI chat: loads
- App navigation → Checklist builder: loads
- App navigation → Document scanner: opens
- App navigation → Theme preference: uses
- Welcome screen → App navigation: requests navigation
- AI chat → Chat input: renders
- Chat input → AI chat: submits message
- AI chat → API client: sends chat
- Checklist builder → API client: requests checklist
- Document scanner → API client: uploads image
- API client → Chat endpoint: posts chat
- API client → Checklist endpoint: posts details
- API client → Scan endpoint: posts image
- Chat endpoint → Google Gemini: generates response
- Checklist endpoint → Google Gemini: generates checklist
- Scan endpoint → Google Gemini: analyzes image
- AI chat → Text formatting: formats sharing text
- Checklist builder → Text formatting: formats checklist
