# safak-senal-61/g-n-birlik architecture

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

- Interactive diagram: https://gitdiagram.com/safak-senal-61/g-n-birlik
- Repository: https://github.com/safak-senal-61/g-n-birlik

## Overview

Günübirlik İş Bul is a location-based day-job marketplace for workers and employers. The main journey is account sign-in, finding or posting a job, applying, managing the application through completion, and reviewing the other party. The web client and API/service layers are represented alongside messaging, notifications, wallet, and admin capabilities documented in the README. The tree lists no mobile-app source despite the README describing one. Several feature links are documented rather than verified from sampled route implementations.

Main entry points: [`src/lib/db.ts`](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/lib/db.ts) (Application database), [`src/server/services/applications.service.ts`](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/services/applications.service.ts) (Applications), [`src/lib/api.ts`](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/lib/api.ts) (API client), [`src/app/api/v1/jobs/route.ts`](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/app/api/v1/jobs/route.ts) (REST routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_auth_ui["Auth screen<br/>[auth-screen.tsx]"]
  node_auth_state["Auth state<br/>[auth-store.ts]"]
  node_api_client["API client<br/>[api.ts]"]
  node_jobs_ui["Job screens"]
  node_application_ui["Application screen"]
end

subgraph group_api["API and identity"]
  node_api_routes["REST routes<br/>[route.ts]"]
  node_auth_routes["Auth routes<br/>[route.ts]"]
  node_auth_service["Identity service<br/>[auth.service.ts]"]
  node_auth_helpers["Auth and notices<br/>[auth.ts]"]
  node_route_wrapper["Route handling<br/>[route.ts]"]
  node_rate_limit["Rate limiting<br/>[rate-limit.ts]"]
end

subgraph group_market["Job marketplace"]
  node_jobs_service["Job listings<br/>[jobs.service.ts]"]
  node_applications_service["Applications"]
  node_reviews_service["Reviews and verification<br/>[reviews.service.ts]"]
  node_database[("Application database<br/>[db.ts]")]
  node_geocoding["Location search<br/>[geocode.ts]"]
end

subgraph group_engage["Engagement and payments"]
  node_messages["Messaging"]
  node_realtime["Realtime service<br/>[index.ts]"]
  node_notifications["Notifications"]
  node_wallet["Wallet and escrow<br/>[wallet.service.ts]"]
  node_push["Push delivery<br/>[onesignal.ts]"]
end

subgraph group_ops["Platform operations"]
  node_admin["Administration<br/>[admin.service.ts]"]
  node_maintenance["Maintenance controls"]
end

node_worker(("Worker"))
node_employer(("Employer"))

node_worker -->|"signs in"| node_auth_ui
node_employer -->|"signs in"| node_auth_ui
node_auth_ui -->|"uses state"| node_auth_state
node_auth_state -->|"calls auth API"| node_api_client
node_auth_state -->|"connects socket"| node_realtime
node_auth_state -->|"registers user"| node_push
node_worker -->|"searches jobs"| node_jobs_ui
node_employer -->|"posts jobs"| node_jobs_ui
node_jobs_ui -.->|"requests jobs"| node_api_client
node_api_client -.->|"sends requests"| node_api_routes
node_api_routes -->|"dispatches"| node_jobs_service
node_jobs_service -->|"reads and writes"| node_database
node_worker -->|"applies"| node_application_ui
node_application_ui -.->|"submits"| node_api_client
node_api_client -.->|"sends requests"| node_api_routes
node_api_routes -->|"dispatches"| node_applications_service
node_applications_service -->|"reads and writes"| node_database
node_applications_service -->|"creates notices"| node_auth_helpers
node_applications_service -.->|"notifies users"| node_notifications
node_applications_service -.->|"requests payment review"| node_wallet
node_worker -->|"messages employer"| node_messages
node_employer -->|"messages worker"| node_messages
node_messages -.->|"delivers live messages"| node_realtime
node_auth_routes -->|"limits login"| node_rate_limit
node_auth_routes -->|"reads and updates"| node_database
node_auth_routes -->|"verifies and signs"| node_auth_helpers
node_auth_routes -->|"wraps requests"| node_route_wrapper
node_route_wrapper -->|"checks limits"| node_rate_limit
node_auth_service -->|"reads and writes"| node_database
node_auth_service -->|"hashes and signs"| node_auth_helpers
node_reviews_service -.->|"reads and writes"| node_database
node_worker -->|"rates employer"| node_reviews_service
node_employer -->|"rates worker"| node_reviews_service
node_geocoding -.->|"serves location queries"| node_api_routes
node_notifications -.->|"sends live alerts"| node_realtime
node_notifications -.->|"sends push alerts"| node_push
node_admin -->|"manages records"| node_database
node_maintenance -.->|"reads and updates"| node_database

click node_auth_ui "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/components/screens/auth-screen.tsx"
click node_auth_state "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/lib/auth-store.ts"
click node_api_client "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/lib/api.ts"
click node_jobs_ui "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/components/screens/jobs-list-screen.tsx"
click node_application_ui "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/components/screens/applications-screen.tsx"
click node_api_routes "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/app/api/v1/jobs/route.ts"
click node_auth_routes "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/app/api/v1/auth/login/route.ts"
click node_auth_service "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/services/auth.service.ts"
click node_auth_helpers "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/lib/auth.ts"
click node_route_wrapper "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/lib/route.ts"
click node_rate_limit "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/lib/rate-limit.ts"
click node_jobs_service "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/services/jobs.service.ts"
click node_applications_service "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/services/applications.service.ts"
click node_reviews_service "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/services/reviews.service.ts"
click node_database "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/lib/db.ts"
click node_messages "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/services/messages.service.ts"
click node_realtime "https://github.com/safak-senal-61/g-n-birlik/blob/main/mini-services/job-realtime/index.ts"
click node_notifications "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/services/notifications.service.ts"
click node_wallet "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/services/wallet.service.ts"
click node_admin "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/services/admin.service.ts"
click node_maintenance "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/services/maintenance.service.ts"
click node_geocoding "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/lib/geocode.ts"
click node_push "https://github.com/safak-senal-61/g-n-birlik/blob/main/src/lib/onesignal.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_auth_ui,node_auth_state,node_api_client,node_jobs_ui,node_application_ui toneBlue
class node_api_routes,node_auth_routes,node_auth_service,node_auth_helpers,node_route_wrapper,node_rate_limit toneAmber
class node_jobs_service,node_applications_service,node_reviews_service,node_database,node_geocoding toneMint
class node_messages,node_realtime,node_notifications,node_wallet,node_push,node_worker toneRose
class node_admin,node_maintenance,node_employer toneIndigo
```

## Components

### Web client

- [Auth screen](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/components/screens/auth-screen.tsx): `src/components/screens/auth-screen.tsx`
- [Auth state](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/lib/auth-store.ts): `src/lib/auth-store.ts`
- [API client](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/lib/api.ts): `src/lib/api.ts`
- [Job screens](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/components/screens/jobs-list-screen.tsx): `src/components/screens/jobs-list-screen.tsx`
- [Application screen](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/components/screens/applications-screen.tsx): `src/components/screens/applications-screen.tsx`

### API and identity

- [REST routes](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/app/api/v1/jobs/route.ts): `src/app/api/v1/jobs/route.ts`
- [Auth routes](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/app/api/v1/auth/login/route.ts): `src/app/api/v1/auth/login/route.ts`
- [Identity service](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/services/auth.service.ts): `src/server/services/auth.service.ts`
- [Auth and notices](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/lib/auth.ts): `src/server/lib/auth.ts`
- [Route handling](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/lib/route.ts): `src/server/lib/route.ts`
- [Rate limiting](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/lib/rate-limit.ts): `src/server/lib/rate-limit.ts`

### Job marketplace

- [Job listings](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/services/jobs.service.ts): `src/server/services/jobs.service.ts`
- [Applications](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/services/applications.service.ts): `src/server/services/applications.service.ts`
- [Reviews and verification](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/services/reviews.service.ts): `src/server/services/reviews.service.ts`
- [Application database](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/lib/db.ts): `src/lib/db.ts`
- [Location search](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/lib/geocode.ts): `src/lib/geocode.ts`

### Engagement and payments

- [Messaging](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/services/messages.service.ts): `src/server/services/messages.service.ts`
- [Realtime service](https://github.com/safak-senal-61/g-n-birlik/blob/main/mini-services/job-realtime/index.ts): `mini-services/job-realtime/index.ts`
- [Notifications](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/services/notifications.service.ts): `src/server/services/notifications.service.ts`
- [Wallet and escrow](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/services/wallet.service.ts): `src/server/services/wallet.service.ts`
- [Push delivery](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/lib/onesignal.ts): `src/lib/onesignal.ts`

### Platform operations

- [Administration](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/services/admin.service.ts): `src/server/services/admin.service.ts`
- [Maintenance controls](https://github.com/safak-senal-61/g-n-birlik/blob/main/src/server/services/maintenance.service.ts): `src/server/services/maintenance.service.ts`

### Other components

- **Worker**
- **Employer**

## Connections

- Worker → Auth screen: signs in (evidence: `README.md`)
- Employer → Auth screen: signs in (evidence: `README.md`)
- Auth screen → Auth state: uses state (evidence: `src/components/screens/auth-screen.tsx`)
- Auth state → API client: calls auth API (evidence: `src/lib/auth-store.ts`)
- Auth state → Realtime service: connects socket (evidence: `src/lib/auth-store.ts`)
- Auth state → Push delivery: registers user (evidence: `src/lib/auth-store.ts`)
- Worker → Job screens: searches jobs (evidence: `README.md`)
- Employer → Job screens: posts jobs (evidence: `README.md`)
- Job screens → API client: requests jobs
- API client → REST routes: sends requests
- REST routes → Job listings: dispatches (evidence: `src/app/api/v1/jobs/route.ts`)
- Job listings → Application database: reads and writes (evidence: `src/server/services/jobs.service.ts`)
- Worker → Application screen: applies (evidence: `README.md`)
- Application screen → API client: submits
- API client → REST routes: sends requests
- REST routes → Applications: dispatches
- Applications → Application database: reads and writes (evidence: `src/server/services/applications.service.ts`)
- Applications → Auth and notices: creates notices (evidence: `src/server/services/applications.service.ts`)
- Applications → Notifications: notifies users
- Applications → Wallet and escrow: requests payment review
- Worker → Messaging: messages employer (evidence: `README.md`)
- Employer → Messaging: messages worker (evidence: `README.md`)
- Messaging → Realtime service: delivers live messages
- Auth routes → Rate limiting: limits login (evidence: `src/app/api/v1/auth/login/route.ts`)
- Auth routes → Application database: reads and updates (evidence: `src/app/api/v1/auth/login/route.ts`)
- Auth routes → Auth and notices: verifies and signs (evidence: `src/app/api/v1/auth/login/route.ts`)
- Auth routes → Route handling: wraps requests (evidence: `src/app/api/v1/auth/login/route.ts`)
- Route handling → Rate limiting: checks limits (evidence: `src/server/lib/route.ts`)
- Identity service → Application database: reads and writes (evidence: `src/server/services/auth.service.ts`)
- Identity service → Auth and notices: hashes and signs (evidence: `src/server/services/auth.service.ts`)
- Reviews and verification → Application database: reads and writes (evidence: `src/server/services/reviews.service.ts`)
- Worker → Reviews and verification: rates employer (evidence: `README.md`)
- Employer → Reviews and verification: rates worker (evidence: `README.md`)
- Location search → REST routes: serves location queries
- Notifications → Realtime service: sends live alerts
- Notifications → Push delivery: sends push alerts
- Administration → Application database: manages records (evidence: `src/server/services/admin.service.ts`)
- Maintenance controls → Application database: reads and updates
