# sweproj5osh/sweproj_5oshhatgebak architecture

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

- Interactive diagram: https://gitdiagram.com/sweproj5osh/sweproj_5oshhatgebak
- Repository: https://github.com/sweproj5osh/sweproj_5oshhatgebak

## Overview

This is a Cairo street-parking modular monolith. The driver-facing journey is to sign in, scan a site code, open a parking ticket, pay the committee price, and receive an answer; the server remains responsible for business rules. The README documents a transactional write pipeline that validates requests, checks repeatability, runs a module handler, appends one audit entry, stages events, and commits. The tree and excerpts show the entry point and several domain implementations; many other domain capabilities are represented by their exact module directories because their source was not sampled.

Main entry points: [`src/entrypoint/operations/registry.ts`](https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/entrypoint/operations/registry.ts) (Operation registry), [`src/entrypoint/writes.ts`](https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/entrypoint/writes.ts) (Write pipeline), [`src/modules/ticketing`](https://github.com/sweproj5osh/sweproj_5oshhatgebak/tree/main/src/modules/ticketing) (Ticketing), [`src/entrypoint/main.ts`](https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/entrypoint/main.ts) (HTTP entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Driver clients"]
  node_client_auth["Sign-in client"]
  node_client_scan["Scan client"]
  node_client_pay["Payment client"]
end

subgraph group_runtime["Server runtime"]
  node_entry["HTTP entry<br/>[main.ts]"]
  node_server["HTTP server<br/>[server.ts]"]
  node_request["Request pipeline<br/>[handle-request.ts]"]
  node_writes["Write pipeline<br/>[writes.ts]"]
  node_operations["Operation registry<br/>[registry.ts]"]
end

subgraph group_parking["Parking operations"]
  node_accounts["Accounts and access<br/>[public.ts]"]
  node_sites["Sites and codes<br/>[public.ts]"]
  node_licensing["Licensing and attendance"]
  node_tickets["Ticketing"]
end

subgraph group_governance["Governance domains"]
  node_prices["Committee prices"]
  node_payments["Payments"]
  node_cash["Cash custody"]
  node_approvals["Approvals"]
  node_money["Money dashboard"]
  node_other_domains["Other services"]
end

subgraph group_foundation["Shared foundation"]
  node_audit["Audit log"]
  node_uow["Unit of work<br/>[unit-of-work.ts]"]
  node_memory_db[("In-memory database")]
  node_event["Domain events<br/>[event.ts]"]
end

node_driver(("Driver"))

node_driver -.->|"signs in"| node_client_auth
node_driver -.->|"scans code"| node_client_scan
node_driver -.->|"pays"| node_client_pay
node_client_auth -.->|"calls server"| node_entry
node_client_scan -.->|"calls server"| node_entry
node_client_pay -.->|"calls server"| node_entry
node_entry -->|"starts"| node_server
node_server -->|"handles requests"| node_request
node_request -.->|"routes writes"| node_writes
node_writes -.->|"dispatches"| node_operations
node_operations -.->|"registers handlers"| node_accounts
node_operations -.->|"registers handlers"| node_sites
node_operations -.->|"registers handlers"| node_licensing
node_operations -.->|"registers handlers"| node_tickets
node_operations -.->|"registers handlers"| node_prices
node_operations -.->|"registers handlers"| node_payments
node_writes -->|"appends entry"| node_audit
node_writes -->|"stages events"| node_event
node_writes -->|"commits together"| node_uow
node_memory_db -->|"implements"| node_uow
node_accounts -->|"uses transaction"| node_uow
node_sites -->|"uses transaction"| node_uow
node_licensing -->|"checks access"| node_accounts
node_licensing -->|"locates site"| node_sites
node_tickets -->|"checks ownership"| node_accounts
node_tickets -.->|"uses site codes"| node_sites
node_payments -.->|"settles tickets"| node_tickets
node_payments -.->|"uses prices"| node_prices

click node_client_auth "https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/apps/shared-client/sign-in/driver-sign-in-client.ts"
click node_client_scan "https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/apps/shared-client/scanning/driver-scan-client.ts"
click node_client_pay "https://github.com/sweproj5osh/sweproj_5oshhatgebak/tree/main/src/apps/shared-client/payments"
click node_entry "https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/entrypoint/main.ts"
click node_server "https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/entrypoint/server.ts"
click node_request "https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/entrypoint/handle-request.ts"
click node_writes "https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/entrypoint/writes.ts"
click node_operations "https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/entrypoint/operations/registry.ts"
click node_accounts "https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/modules/accounts-and-access-control/public.ts"
click node_sites "https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/modules/sites-and-areas/public.ts"
click node_licensing "https://github.com/sweproj5osh/sweproj_5oshhatgebak/tree/main/src/modules/licensing-assignment-attendance"
click node_tickets "https://github.com/sweproj5osh/sweproj_5oshhatgebak/tree/main/src/modules/ticketing"
click node_prices "https://github.com/sweproj5osh/sweproj_5oshhatgebak/tree/main/src/modules/committee-prices"
click node_payments "https://github.com/sweproj5osh/sweproj_5oshhatgebak/tree/main/src/modules/payments"
click node_cash "https://github.com/sweproj5osh/sweproj_5oshhatgebak/tree/main/src/modules/cash-custody"
click node_approvals "https://github.com/sweproj5osh/sweproj_5oshhatgebak/tree/main/src/modules/approvals"
click node_money "https://github.com/sweproj5osh/sweproj_5oshhatgebak/tree/main/src/modules/money-check-dashboard"
click node_audit "https://github.com/sweproj5osh/sweproj_5oshhatgebak/tree/main/src/modules/audit-log"
click node_other_domains "https://github.com/sweproj5osh/sweproj_5oshhatgebak/tree/main/src/modules"
click node_uow "https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/shared/unit-of-work.ts"
click node_memory_db "https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/adapters/in-memory/in-memory-database.ts"
click node_event "https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/shared/events/event.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_client_auth,node_client_scan,node_client_pay toneBlue
class node_entry,node_server,node_request,node_writes,node_operations toneAmber
class node_accounts,node_sites,node_licensing,node_tickets toneMint
class node_prices,node_payments,node_cash,node_approvals,node_money,node_other_domains toneRose
class node_audit,node_uow,node_memory_db,node_event,node_driver toneIndigo
```

## Components

### Driver clients

- [Sign-in client](https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/apps/shared-client/sign-in/driver-sign-in-client.ts): `src/apps/shared-client/sign-in/driver-sign-in-client.ts`
- [Scan client](https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/apps/shared-client/scanning/driver-scan-client.ts): `src/apps/shared-client/scanning/driver-scan-client.ts`
- [Payment client](https://github.com/sweproj5osh/sweproj_5oshhatgebak/tree/main/src/apps/shared-client/payments): `src/apps/shared-client/payments`

### Server runtime

- [HTTP entry](https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/entrypoint/main.ts): `src/entrypoint/main.ts`
- [HTTP server](https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/entrypoint/server.ts): `src/entrypoint/server.ts`
- [Request pipeline](https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/entrypoint/handle-request.ts): `src/entrypoint/handle-request.ts`
- [Write pipeline](https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/entrypoint/writes.ts): `src/entrypoint/writes.ts`
- [Operation registry](https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/entrypoint/operations/registry.ts): `src/entrypoint/operations/registry.ts`

### Parking operations

- [Accounts and access](https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/modules/accounts-and-access-control/public.ts): `src/modules/accounts-and-access-control/public.ts`
- [Sites and codes](https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/modules/sites-and-areas/public.ts): `src/modules/sites-and-areas/public.ts`
- [Licensing and attendance](https://github.com/sweproj5osh/sweproj_5oshhatgebak/tree/main/src/modules/licensing-assignment-attendance): `src/modules/licensing-assignment-attendance`
- [Ticketing](https://github.com/sweproj5osh/sweproj_5oshhatgebak/tree/main/src/modules/ticketing): `src/modules/ticketing`

### Governance domains

- [Committee prices](https://github.com/sweproj5osh/sweproj_5oshhatgebak/tree/main/src/modules/committee-prices): `src/modules/committee-prices`
- [Payments](https://github.com/sweproj5osh/sweproj_5oshhatgebak/tree/main/src/modules/payments): `src/modules/payments`
- [Cash custody](https://github.com/sweproj5osh/sweproj_5oshhatgebak/tree/main/src/modules/cash-custody): `src/modules/cash-custody`
- [Approvals](https://github.com/sweproj5osh/sweproj_5oshhatgebak/tree/main/src/modules/approvals): `src/modules/approvals`
- [Money dashboard](https://github.com/sweproj5osh/sweproj_5oshhatgebak/tree/main/src/modules/money-check-dashboard): `src/modules/money-check-dashboard`
- [Other services](https://github.com/sweproj5osh/sweproj_5oshhatgebak/tree/main/src/modules): `src/modules`

### Shared foundation

- [Audit log](https://github.com/sweproj5osh/sweproj_5oshhatgebak/tree/main/src/modules/audit-log): `src/modules/audit-log`
- [Unit of work](https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/shared/unit-of-work.ts): `src/shared/unit-of-work.ts`
- [In-memory database](https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/adapters/in-memory/in-memory-database.ts): `src/adapters/in-memory/in-memory-database.ts`
- [Domain events](https://github.com/sweproj5osh/sweproj_5oshhatgebak/blob/main/src/shared/events/event.ts): `src/shared/events/event.ts`

### Other components

- **Driver**

## Connections

- Driver → Sign-in client: signs in
- Driver → Scan client: scans code
- Driver → Payment client: pays
- Sign-in client → HTTP entry: calls server
- Scan client → HTTP entry: calls server
- Payment client → HTTP entry: calls server
- HTTP entry → HTTP server: starts (evidence: `src/entrypoint/main.ts`)
- HTTP server → Request pipeline: handles requests (evidence: `src/entrypoint/server.ts`)
- Request pipeline → Write pipeline: routes writes
- Write pipeline → Operation registry: dispatches
- Operation registry → Accounts and access: registers handlers
- Operation registry → Sites and codes: registers handlers
- Operation registry → Licensing and attendance: registers handlers
- Operation registry → Ticketing: registers handlers
- Operation registry → Committee prices: registers handlers
- Operation registry → Payments: registers handlers
- Write pipeline → Audit log: appends entry
- Write pipeline → Domain events: stages events
- Write pipeline → Unit of work: commits together
- In-memory database → Unit of work: implements (evidence: `src/adapters/in-memory/in-memory-database.ts`)
- Accounts and access → Unit of work: uses transaction (evidence: `src/modules/accounts-and-access-control/public.ts`)
- Sites and codes → Unit of work: uses transaction (evidence: `src/modules/sites-and-areas/public.ts`)
- Licensing and attendance → Accounts and access: checks access (evidence: `src/modules/licensing-assignment-attendance/internal/assignments-service.ts`)
- Licensing and attendance → Sites and codes: locates site (evidence: `src/modules/licensing-assignment-attendance/internal/assignments-service.ts`)
- Ticketing → Accounts and access: checks ownership (evidence: `src/modules/accounts-and-access-control/public.ts`)
- Ticketing → Sites and codes: uses site codes
- Payments → Ticketing: settles tickets
- Payments → Committee prices: uses prices
