# mehmetcan455/kocluk architecture

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

- Interactive diagram: https://gitdiagram.com/mehmetcan455/kocluk
- Repository: https://github.com/mehmetcan455/kocluk

## Overview

Zirve Akademi is an offline-first YKS study tracker. Students use its routed web app to manage books and reading progress, weekly plans, subject/topic progress, exams, photos, notes, and practice; data is stored locally first and account data syncs to the PHP API and MariaDB. The graph includes the documented account, export/delete, email, and maintenance capabilities. Some feature and sync internals were not sampled, so relationships without direct evidence are omitted.

Main entry points: [`api/src/Db/Database.php`](https://github.com/mehmetcan455/kocluk/blob/main/api/src/Db/Database.php) (Database access), [`api/src/Auth/AuthService.php`](https://github.com/mehmetcan455/kocluk/blob/main/api/src/Auth/AuthService.php) (Authentication), [`src/db/repositories.ts`](https://github.com/mehmetcan455/kocluk/blob/main/src/db/repositories.ts) (Study repositories), [`src/features/books`](https://github.com/mehmetcan455/kocluk/tree/main/src/features/books) (Book tracking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Study app"]
  node_routes["App routes<br/>[routes.tsx]"]
  node_authui["Account screens"]
  node_books["Book tracking"]
  node_schedule["Weekly planning"]
  node_subjects["Topic progress"]
  node_exams["Exams and practice"]
  node_photosnotes["Photos and notes"]
  node_dashboard["Study overview"]
  node_settings["Account settings"]
end

subgraph group_local["Local study data"]
  node_catalog["Book catalog<br/>[index.ts]"]
  node_localdb[("IndexedDB<br/>[db.ts]")]
  node_repositories["Study repositories<br/>[repositories.ts]"]
  node_scheduledata["Schedule data"]
end

subgraph group_account["Accounts and API"]
  node_api["PHP API router<br/>[App.php]"]
  node_authservice["Authentication<br/>[AuthService.php]"]
  node_sessions["Session service<br/>[SessionService.php]"]
  node_ratelimit["Rate limiting<br/>[RateLimiter.php]"]
  node_database["Database access<br/>[Database.php]"]
  node_mailer["Email delivery<br/>[Mailer.php]"]
end

subgraph group_sync["Data synchronization"]
  node_syncqueue["Sync queue<br/>[queue.ts]"]
  node_syncengine["Sync engine<br/>[engine.ts]"]
  node_syncservice["Sync service<br/>[SyncService.php]"]
  node_tablemap["Sync table mapping<br/>[TableMap.php]"]
end

subgraph group_ops["Operations"]
  node_maintenance["Maintenance tasks"]
  node_backup["Database backup<br/>[backup.php]"]
end

node_student(("Student"))
node_mariadb[("MariaDB")]

node_student -->|"uses"| node_routes
node_routes -->|"routes to"| node_authui
node_routes -->|"routes to"| node_books
node_student -->|"tracks reading"| node_books
node_student -->|"plans study"| node_schedule
node_student -->|"marks progress"| node_subjects
node_student -->|"records exams"| node_exams
node_student -->|"keeps study material"| node_photosnotes
node_student -->|"views overview"| node_dashboard
node_student -->|"manages account"| node_settings
node_books -->|"selects from"| node_catalog
node_books -.->|"stores through"| node_repositories
node_schedule -->|"saves plan"| node_scheduledata
node_schedule -->|"updates reading"| node_repositories
node_subjects -.->|"stores progress"| node_repositories
node_exams -.->|"stores records"| node_repositories
node_photosnotes -->|"keeps on device"| node_localdb
node_repositories -.->|"reads and writes"| node_localdb
node_scheduledata -.->|"reads and writes"| node_localdb
node_syncengine -->|"processes queue"| node_syncqueue
node_syncengine -->|"syncs via API"| node_syncservice
node_syncengine -->|"syncs local data"| node_localdb
node_api -->|"routes auth"| node_authservice
node_api -->|"manages sessions"| node_sessions
node_api -.->|"routes sync"| node_syncservice
node_authservice -->|"checks limits"| node_ratelimit
node_authservice -->|"creates sessions"| node_sessions
node_authservice -->|"queues email"| node_mailer
node_syncservice -->|"maps rows"| node_tablemap
node_syncservice -->|"reads and writes"| node_database
node_authservice -->|"reads and writes"| node_database
node_sessions -->|"stores sessions"| node_database
node_database -->|"connects to"| node_mariadb
node_maintenance -->|"maintains"| node_database
node_backup -->|"backs up"| node_database

click node_routes "https://github.com/mehmetcan455/kocluk/blob/main/src/app/routes.tsx"
click node_authui "https://github.com/mehmetcan455/kocluk/tree/main/src/features/auth"
click node_books "https://github.com/mehmetcan455/kocluk/tree/main/src/features/books"
click node_schedule "https://github.com/mehmetcan455/kocluk/tree/main/src/features/schedule"
click node_subjects "https://github.com/mehmetcan455/kocluk/tree/main/src/features/subjects"
click node_exams "https://github.com/mehmetcan455/kocluk/tree/main/src/features/exams"
click node_photosnotes "https://github.com/mehmetcan455/kocluk/tree/main/src/features/photos"
click node_dashboard "https://github.com/mehmetcan455/kocluk/tree/main/src/features/dashboard"
click node_settings "https://github.com/mehmetcan455/kocluk/tree/main/src/features/settings"
click node_catalog "https://github.com/mehmetcan455/kocluk/blob/main/src/data/catalog/index.ts"
click node_localdb "https://github.com/mehmetcan455/kocluk/blob/main/src/db/db.ts"
click node_repositories "https://github.com/mehmetcan455/kocluk/blob/main/src/db/repositories.ts"
click node_scheduledata "https://github.com/mehmetcan455/kocluk/blob/main/src/db/scheduleRepository.ts"
click node_syncqueue "https://github.com/mehmetcan455/kocluk/blob/main/src/db/sync/queue.ts"
click node_syncengine "https://github.com/mehmetcan455/kocluk/blob/main/src/db/sync/engine.ts"
click node_api "https://github.com/mehmetcan455/kocluk/blob/main/api/src/App.php"
click node_authservice "https://github.com/mehmetcan455/kocluk/blob/main/api/src/Auth/AuthService.php"
click node_sessions "https://github.com/mehmetcan455/kocluk/blob/main/api/src/Auth/SessionService.php"
click node_ratelimit "https://github.com/mehmetcan455/kocluk/blob/main/api/src/Auth/RateLimiter.php"
click node_syncservice "https://github.com/mehmetcan455/kocluk/blob/main/api/src/Sync/SyncService.php"
click node_tablemap "https://github.com/mehmetcan455/kocluk/blob/main/api/src/Sync/TableMap.php"
click node_database "https://github.com/mehmetcan455/kocluk/blob/main/api/src/Db/Database.php"
click node_mailer "https://github.com/mehmetcan455/kocluk/blob/main/api/src/Mail/Mailer.php"
click node_maintenance "https://github.com/mehmetcan455/kocluk/blob/main/api/src/Maintenance/MaintenanceService.php"
click node_backup "https://github.com/mehmetcan455/kocluk/blob/main/api/bin/backup.php"

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_routes,node_authui,node_books,node_schedule,node_subjects,node_exams,node_photosnotes,node_dashboard,node_settings toneBlue
class node_catalog,node_localdb,node_repositories,node_scheduledata,node_mariadb toneAmber
class node_api,node_authservice,node_sessions,node_ratelimit,node_database,node_mailer toneMint
class node_syncqueue,node_syncengine,node_syncservice,node_tablemap toneRose
class node_maintenance,node_backup,node_student toneIndigo
```

## Components

### Study app

- [App routes](https://github.com/mehmetcan455/kocluk/blob/main/src/app/routes.tsx): `src/app/routes.tsx`
- [Account screens](https://github.com/mehmetcan455/kocluk/tree/main/src/features/auth): `src/features/auth`
- [Book tracking](https://github.com/mehmetcan455/kocluk/tree/main/src/features/books): `src/features/books`
- [Weekly planning](https://github.com/mehmetcan455/kocluk/tree/main/src/features/schedule): `src/features/schedule`
- [Topic progress](https://github.com/mehmetcan455/kocluk/tree/main/src/features/subjects): `src/features/subjects`
- [Exams and practice](https://github.com/mehmetcan455/kocluk/tree/main/src/features/exams): `src/features/exams`
- [Photos and notes](https://github.com/mehmetcan455/kocluk/tree/main/src/features/photos): `src/features/photos`
- [Study overview](https://github.com/mehmetcan455/kocluk/tree/main/src/features/dashboard): `src/features/dashboard`
- [Account settings](https://github.com/mehmetcan455/kocluk/tree/main/src/features/settings): `src/features/settings`

### Local study data

- [Book catalog](https://github.com/mehmetcan455/kocluk/blob/main/src/data/catalog/index.ts): `src/data/catalog/index.ts`
- [IndexedDB](https://github.com/mehmetcan455/kocluk/blob/main/src/db/db.ts): `src/db/db.ts`
- [Study repositories](https://github.com/mehmetcan455/kocluk/blob/main/src/db/repositories.ts): `src/db/repositories.ts`
- [Schedule data](https://github.com/mehmetcan455/kocluk/blob/main/src/db/scheduleRepository.ts): `src/db/scheduleRepository.ts`

### Accounts and API

- [PHP API router](https://github.com/mehmetcan455/kocluk/blob/main/api/src/App.php): `api/src/App.php`
- [Authentication](https://github.com/mehmetcan455/kocluk/blob/main/api/src/Auth/AuthService.php): `api/src/Auth/AuthService.php`
- [Session service](https://github.com/mehmetcan455/kocluk/blob/main/api/src/Auth/SessionService.php): `api/src/Auth/SessionService.php`
- [Rate limiting](https://github.com/mehmetcan455/kocluk/blob/main/api/src/Auth/RateLimiter.php): `api/src/Auth/RateLimiter.php`
- [Database access](https://github.com/mehmetcan455/kocluk/blob/main/api/src/Db/Database.php): `api/src/Db/Database.php`
- [Email delivery](https://github.com/mehmetcan455/kocluk/blob/main/api/src/Mail/Mailer.php): `api/src/Mail/Mailer.php`

### Data synchronization

- [Sync queue](https://github.com/mehmetcan455/kocluk/blob/main/src/db/sync/queue.ts): `src/db/sync/queue.ts`
- [Sync engine](https://github.com/mehmetcan455/kocluk/blob/main/src/db/sync/engine.ts): `src/db/sync/engine.ts`
- [Sync service](https://github.com/mehmetcan455/kocluk/blob/main/api/src/Sync/SyncService.php): `api/src/Sync/SyncService.php`
- [Sync table mapping](https://github.com/mehmetcan455/kocluk/blob/main/api/src/Sync/TableMap.php): `api/src/Sync/TableMap.php`

### Operations

- [Maintenance tasks](https://github.com/mehmetcan455/kocluk/blob/main/api/src/Maintenance/MaintenanceService.php): `api/src/Maintenance/MaintenanceService.php`
- [Database backup](https://github.com/mehmetcan455/kocluk/blob/main/api/bin/backup.php): `api/bin/backup.php`

### Other components

- **Student**
- **MariaDB**

## Connections

- Student → App routes: uses (evidence: `src/app/routes.tsx`)
- App routes → Account screens: routes to (evidence: `src/app/routes.tsx`)
- App routes → Book tracking: routes to (evidence: `src/app/routes.tsx`)
- Student → Book tracking: tracks reading (evidence: `README.md`)
- Student → Weekly planning: plans study (evidence: `README.md`)
- Student → Topic progress: marks progress (evidence: `README.md`)
- Student → Exams and practice: records exams (evidence: `README.md`)
- Student → Photos and notes: keeps study material (evidence: `README.md`)
- Student → Study overview: views overview (evidence: `README.md`)
- Student → Account settings: manages account (evidence: `README.md`)
- Book tracking → Book catalog: selects from (evidence: `README.md`)
- Book tracking → Study repositories: stores through
- Weekly planning → Schedule data: saves plan (evidence: `README.md`)
- Weekly planning → Study repositories: updates reading (evidence: `README.md`)
- Topic progress → Study repositories: stores progress
- Exams and practice → Study repositories: stores records
- Photos and notes → IndexedDB: keeps on device (evidence: `README.md`)
- Study repositories → IndexedDB: reads and writes
- Schedule data → IndexedDB: reads and writes (evidence: `src/db/scheduleRepository.ts`)
- Sync engine → Sync queue: processes queue (evidence: `src/db/sync/engine.ts`)
- Sync engine → Sync service: syncs via API (evidence: `README.md`)
- Sync engine → IndexedDB: syncs local data (evidence: `src/db/sync/engine.ts`)
- PHP API router → Authentication: routes auth (evidence: `api/src/App.php`)
- PHP API router → Session service: manages sessions (evidence: `api/src/App.php`)
- PHP API router → Sync service: routes sync (evidence: `api/src/App.php`)
- Authentication → Rate limiting: checks limits (evidence: `api/src/Auth/AuthService.php`)
- Authentication → Session service: creates sessions (evidence: `api/src/Auth/AuthService.php`)
- Authentication → Email delivery: queues email (evidence: `api/src/Auth/AuthService.php`)
- Sync service → Sync table mapping: maps rows (evidence: `api/src/Sync/SyncService.php`)
- Sync service → Database access: reads and writes (evidence: `api/src/Sync/SyncService.php`)
- Authentication → Database access: reads and writes (evidence: `api/src/Auth/AuthService.php`)
- Session service → Database access: stores sessions (evidence: `api/src/Auth/SessionService.php`)
- Database access → MariaDB: connects to (evidence: `api/src/Db/Database.php`)
- Maintenance tasks → Database access: maintains (evidence: `api/src/Maintenance/MaintenanceService.php`)
- Database backup → Database access: backs up (evidence: `api/bin/backup.php`)
