# tigerfox1974/ktpgv architecture

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

- Interactive diagram: https://gitdiagram.com/tigerfox1974/ktpgv
- Repository: https://github.com/tigerfox1974/ktpgv

## Overview

KTPGV is an institutional revenue and operations management web application. Its central workflow records payment evidence, reviews and verifies the dekont, creates a revenue-bent record and receipt, then supports related planning and reporting. The graph also preserves the documented E-bent credit and blasting stages, agenda, administration, and audit/reporting capabilities. Sampled excerpts show app routing, shared state, OCR, and persistence boundaries; some capability links rely on README statements because their page implementations were not sampled.

Main entry points: [`src/pages/KayitDetay.tsx`](https://github.com/tigerfox1974/ktpgv/blob/main/src/pages/KayitDetay.tsx) (Transaction detail), [`src/pages/YeniIslem.tsx`](https://github.com/tigerfox1974/ktpgv/blob/main/src/pages/YeniIslem.tsx) (New transaction), [`src/App.tsx`](https://github.com/tigerfox1974/ktpgv/blob/main/src/App.tsx) (App router), [`src/components/islem/DekontBolumu.tsx`](https://github.com/tigerfox1974/ktpgv/blob/main/src/components/islem/DekontBolumu.tsx) (Payment evidence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and access"]
  node_app["App router<br/>[App.tsx]"]
  node_access["Access control<br/>[YetkiKapisi.tsx]"]
  node_context["App state<br/>[AppContext.tsx]"]
  node_auth["Authentication<br/>[index.ts]"]
  node_repository["Repository layer"]
end

subgraph group_revenue["Revenue and documents"]
  node_newtx["New transaction<br/>[YeniIslem.tsx]"]
  node_bentform["Bent fields<br/>[BentAlanlari.tsx]"]
  node_calculation["Fee calculation<br/>[hesaplama.ts]"]
  node_receipt["Payment evidence<br/>[DekontBolumu.tsx]"]
  node_ocr["Dekont OCR<br/>[dekontOcr.ts]"]
  node_review["Document review"]
  node_record["Transaction detail<br/>[KayitDetay.tsx]"]
  node_receiptgen["Receipt generation<br/>[MakbuzModal.tsx]"]
  node_storage["Dekont storage<br/>[dekontStorage.ts]"]
end

subgraph group_operations["Operations and credits"]
  node_agenda["Agenda planning<br/>[Ajanda.tsx]"]
  node_blast["Blasting schedule"]
  node_credit["Credit accounting<br/>[krediYukleme.ts]"]
  node_creditmoves["Credit movements"]
end

subgraph group_oversight["Administration and oversight"]
  node_reporting["Reports and archive<br/>[Raporlar.tsx]"]
  node_audit["Audit log<br/>[AuditLog.tsx]"]
  node_admin["User and unit admin"]
end

node_staff(("Staff user"))
node_supabase[("Supabase")]

node_staff -->|"uses"| node_app
node_app -->|"provides state"| node_context
node_app -->|"guards routes"| node_access
node_app -->|"routes to"| node_newtx
node_context -->|"loads session"| node_auth
node_context -->|"calls data layer"| node_repository
node_staff -->|"submits payment"| node_newtx
node_newtx -->|"renders fields"| node_bentform
node_newtx -->|"calculates amount"| node_calculation
node_newtx -->|"collects evidence"| node_receipt
node_receipt -->|"reads document"| node_ocr
node_receipt -->|"opens review"| node_review
node_receipt -.->|"stores file"| node_storage
node_staff -->|"verifies evidence"| node_review
node_review -->|"enables transaction"| node_record
node_record -->|"produces receipt"| node_receiptgen
node_record -->|"supports planning"| node_agenda
node_agenda -->|"plans blasting"| node_blast
node_blast -->|"records usage"| node_credit
node_staff -->|"reviews balances"| node_creditmoves
node_creditmoves -.->|"summarizes credits"| node_credit
node_record -->|"feeds reports"| node_reporting
node_record -->|"audits activity"| node_audit
node_staff -->|"manages access"| node_admin
node_repository -->|"persists records"| node_supabase
node_storage -->|"uploads files"| node_supabase

click node_app "https://github.com/tigerfox1974/ktpgv/blob/main/src/App.tsx"
click node_access "https://github.com/tigerfox1974/ktpgv/blob/main/src/components/common/YetkiKapisi.tsx"
click node_context "https://github.com/tigerfox1974/ktpgv/blob/main/src/contexts/AppContext.tsx"
click node_auth "https://github.com/tigerfox1974/ktpgv/blob/main/src/services/auth/index.ts"
click node_newtx "https://github.com/tigerfox1974/ktpgv/blob/main/src/pages/YeniIslem.tsx"
click node_bentform "https://github.com/tigerfox1974/ktpgv/blob/main/src/components/islem/BentAlanlari.tsx"
click node_calculation "https://github.com/tigerfox1974/ktpgv/blob/main/src/utils/hesaplama.ts"
click node_receipt "https://github.com/tigerfox1974/ktpgv/blob/main/src/components/islem/DekontBolumu.tsx"
click node_ocr "https://github.com/tigerfox1974/ktpgv/blob/main/src/utils/dekontOcr.ts"
click node_review "https://github.com/tigerfox1974/ktpgv/blob/main/src/components/islem/dekont-inceleme/DekontIncelemeCalismaAlani.tsx"
click node_record "https://github.com/tigerfox1974/ktpgv/blob/main/src/pages/KayitDetay.tsx"
click node_receiptgen "https://github.com/tigerfox1974/ktpgv/blob/main/src/components/islem/MakbuzModal.tsx"
click node_agenda "https://github.com/tigerfox1974/ktpgv/blob/main/src/pages/Ajanda.tsx"
click node_blast "https://github.com/tigerfox1974/ktpgv/blob/main/src/pages/PatlatmaTakvimi.tsx"
click node_credit "https://github.com/tigerfox1974/ktpgv/blob/main/src/utils/krediYukleme.ts"
click node_creditmoves "https://github.com/tigerfox1974/ktpgv/blob/main/src/pages/KrediHareketleri.tsx"
click node_reporting "https://github.com/tigerfox1974/ktpgv/blob/main/src/pages/Raporlar.tsx"
click node_audit "https://github.com/tigerfox1974/ktpgv/blob/main/src/pages/AuditLog.tsx"
click node_admin "https://github.com/tigerfox1974/ktpgv/blob/main/src/pages/KullaniciYonetimi.tsx"
click node_repository "https://github.com/tigerfox1974/ktpgv/blob/main/src/services/repository/SupabaseKtpgvRepository.ts"
click node_storage "https://github.com/tigerfox1974/ktpgv/blob/main/src/services/storage/dekontStorage.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_app,node_access,node_context,node_auth,node_repository,node_staff toneBlue
class node_newtx,node_bentform,node_calculation,node_receipt,node_ocr,node_review,node_record,node_receiptgen,node_storage,node_supabase toneAmber
class node_agenda,node_blast,node_credit,node_creditmoves toneMint
class node_reporting,node_audit,node_admin toneRose
```

## Components

### Application and access

- [App router](https://github.com/tigerfox1974/ktpgv/blob/main/src/App.tsx): `src/App.tsx`
- [Access control](https://github.com/tigerfox1974/ktpgv/blob/main/src/components/common/YetkiKapisi.tsx): `src/components/common/YetkiKapisi.tsx`
- [App state](https://github.com/tigerfox1974/ktpgv/blob/main/src/contexts/AppContext.tsx): `src/contexts/AppContext.tsx`
- [Authentication](https://github.com/tigerfox1974/ktpgv/blob/main/src/services/auth/index.ts): `src/services/auth/index.ts`
- [Repository layer](https://github.com/tigerfox1974/ktpgv/blob/main/src/services/repository/SupabaseKtpgvRepository.ts): `src/services/repository/SupabaseKtpgvRepository.ts`

### Revenue and documents

- [New transaction](https://github.com/tigerfox1974/ktpgv/blob/main/src/pages/YeniIslem.tsx): `src/pages/YeniIslem.tsx`
- [Bent fields](https://github.com/tigerfox1974/ktpgv/blob/main/src/components/islem/BentAlanlari.tsx): `src/components/islem/BentAlanlari.tsx`
- [Fee calculation](https://github.com/tigerfox1974/ktpgv/blob/main/src/utils/hesaplama.ts): `src/utils/hesaplama.ts`
- [Payment evidence](https://github.com/tigerfox1974/ktpgv/blob/main/src/components/islem/DekontBolumu.tsx): `src/components/islem/DekontBolumu.tsx`
- [Dekont OCR](https://github.com/tigerfox1974/ktpgv/blob/main/src/utils/dekontOcr.ts): `src/utils/dekontOcr.ts`
- [Document review](https://github.com/tigerfox1974/ktpgv/blob/main/src/components/islem/dekont-inceleme/DekontIncelemeCalismaAlani.tsx): `src/components/islem/dekont-inceleme/DekontIncelemeCalismaAlani.tsx`
- [Transaction detail](https://github.com/tigerfox1974/ktpgv/blob/main/src/pages/KayitDetay.tsx): `src/pages/KayitDetay.tsx`
- [Receipt generation](https://github.com/tigerfox1974/ktpgv/blob/main/src/components/islem/MakbuzModal.tsx): `src/components/islem/MakbuzModal.tsx`
- [Dekont storage](https://github.com/tigerfox1974/ktpgv/blob/main/src/services/storage/dekontStorage.ts): `src/services/storage/dekontStorage.ts`

### Operations and credits

- [Agenda planning](https://github.com/tigerfox1974/ktpgv/blob/main/src/pages/Ajanda.tsx): `src/pages/Ajanda.tsx`
- [Blasting schedule](https://github.com/tigerfox1974/ktpgv/blob/main/src/pages/PatlatmaTakvimi.tsx): `src/pages/PatlatmaTakvimi.tsx`
- [Credit accounting](https://github.com/tigerfox1974/ktpgv/blob/main/src/utils/krediYukleme.ts): `src/utils/krediYukleme.ts`
- [Credit movements](https://github.com/tigerfox1974/ktpgv/blob/main/src/pages/KrediHareketleri.tsx): `src/pages/KrediHareketleri.tsx`

### Administration and oversight

- [Reports and archive](https://github.com/tigerfox1974/ktpgv/blob/main/src/pages/Raporlar.tsx): `src/pages/Raporlar.tsx`
- [Audit log](https://github.com/tigerfox1974/ktpgv/blob/main/src/pages/AuditLog.tsx): `src/pages/AuditLog.tsx`
- [User and unit admin](https://github.com/tigerfox1974/ktpgv/blob/main/src/pages/KullaniciYonetimi.tsx): `src/pages/KullaniciYonetimi.tsx`

### Other components

- **Staff user**
- **Supabase**

## Connections

- Staff user → App router: uses
- App router → App state: provides state (evidence: `src/App.tsx`)
- App router → Access control: guards routes (evidence: `src/App.tsx`)
- App router → New transaction: routes to (evidence: `src/App.tsx`)
- App state → Authentication: loads session (evidence: `src/contexts/AppContext.tsx`)
- App state → Repository layer: calls data layer (evidence: `src/contexts/AppContext.tsx`)
- Staff user → New transaction: submits payment
- New transaction → Bent fields: renders fields (evidence: `src/pages/YeniIslem.tsx`)
- New transaction → Fee calculation: calculates amount (evidence: `src/pages/YeniIslem.tsx`)
- New transaction → Payment evidence: collects evidence (evidence: `src/pages/YeniIslem.tsx`)
- Payment evidence → Dekont OCR: reads document (evidence: `src/components/islem/DekontBolumu.tsx`)
- Payment evidence → Document review: opens review (evidence: `src/components/islem/DekontBolumu.tsx`)
- Payment evidence → Dekont storage: stores file
- Staff user → Document review: verifies evidence
- Document review → Transaction detail: enables transaction
- Transaction detail → Receipt generation: produces receipt (evidence: `src/pages/KayitDetay.tsx`)
- Transaction detail → Agenda planning: supports planning
- Agenda planning → Blasting schedule: plans blasting
- Blasting schedule → Credit accounting: records usage
- Staff user → Credit movements: reviews balances
- Credit movements → Credit accounting: summarizes credits
- Transaction detail → Reports and archive: feeds reports
- Transaction detail → Audit log: audits activity
- Staff user → User and unit admin: manages access
- Repository layer → Supabase: persists records (evidence: `src/services/repository/SupabaseKtpgvRepository.ts`)
- Dekont storage → Supabase: uploads files (evidence: `src/services/storage/dekontStorage.ts`)
