# albinondjonale/jc architecture

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

- Interactive diagram: https://gitdiagram.com/albinondjonale/jc
- Repository: https://github.com/albinondjonale/jc

## Overview

JC is a small PHP web framework. Its main workflow is application setup, route registration, request handling, middleware and route callbacks, then response generation for the client. The README also documents template rendering and several response types. Other supported capabilities include authentication pages and middleware, database models and query construction, migrations, background queues, realtime requests, validation, and logging. Some runtime sections were not sampled, so links to those features are limited to explicit README or source evidence.

Main entry points: [`jc/qbuilder/qbuilder.php`](https://github.com/albinondjonale/jc/blob/main/jc/qbuilder/qbuilder.php) (Query builder), [`jc/index.php`](https://github.com/albinondjonale/jc/blob/main/jc/index.php) (Application runner), [`jc/http/response.php`](https://github.com/albinondjonale/jc/blob/main/jc/http/response.php) (HTTP responses), [`jc/helpers.php`](https://github.com/albinondjonale/jc/blob/main/jc/helpers.php) (Framework helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web runtime"]
  node_app["Application runner<br/>[index.php]"]
  node_routes["Route registry<br/>[index.php]"]
  node_request["Request parsing<br/>[request.php]"]
  node_middleware["Middleware<br/>[middleware.php]"]
  node_response["HTTP responses<br/>[response.php]"]
end

subgraph group_identity["Identity and rendering"]
  node_pages["Auth pages<br/>[pages.php]"]
  node_auth["Auth middleware<br/>[middleware.php]"]
  node_templates["Template rendering<br/>[response.php]"]
  node_validation["Validation and auth<br/>[util.php]"]
end

subgraph group_data["Data management"]
  node_model["ORM models<br/>[model.php]"]
  node_query["Query builder<br/>[qbuilder.php]"]
  node_migrations["Schema migrations<br/>[migration.php]"]
  node_migration_defs["Migration definitions<br/>[migrations.php]"]
  node_database[("SQL database")]
end

subgraph group_async["Async and utilities"]
  node_queue["File-backed queue<br/>[queue.php]"]
  node_queue_push["Queue writer<br/>[push.php]"]
  node_realtime["Realtime requests<br/>[request.php]"]
  node_helpers["Framework helpers<br/>[helpers.php]"]
  node_logs[("File logs")]
end

node_client(("Browser client"))

node_client -->|"sends request"| node_app
node_app -->|"runs routes"| node_routes
node_routes -->|"receives request"| node_request
node_routes -->|"applies middleware"| node_middleware
node_routes -->|"returns response"| node_response
node_response -->|"sends response"| node_client
node_middleware -->|"provides auth"| node_auth
node_auth -->|"checks credentials"| node_validation
node_pages -->|"validates login"| node_validation
node_pages -->|"returns responses"| node_response
node_response -->|"renders templates"| node_templates
node_model -->|"builds queries"| node_query
node_migrations -->|"builds schema queries"| node_query
node_migration_defs -->|"runs migrations"| node_migrations
node_query -->|"executes SQL"| node_database
node_helpers -->|"creates connection"| node_query
node_query -->|"queues SQL"| node_queue
node_queue -->|"starts writer"| node_queue_push
node_app -->|"constructs request"| node_realtime
node_app -->|"writes logs"| node_helpers
node_helpers -->|"appends entries"| node_logs

click node_app "https://github.com/albinondjonale/jc/blob/main/jc/index.php"
click node_routes "https://github.com/albinondjonale/jc/blob/main/jc/index.php"
click node_request "https://github.com/albinondjonale/jc/blob/main/jc/http/request.php"
click node_middleware "https://github.com/albinondjonale/jc/blob/main/jc/middleware/middleware.php"
click node_response "https://github.com/albinondjonale/jc/blob/main/jc/http/response.php"
click node_pages "https://github.com/albinondjonale/jc/blob/main/jc/pages/pages.php"
click node_auth "https://github.com/albinondjonale/jc/blob/main/jc/middleware/middleware.php"
click node_templates "https://github.com/albinondjonale/jc/blob/main/jc/http/response.php"
click node_validation "https://github.com/albinondjonale/jc/blob/main/jc/util/util.php"
click node_model "https://github.com/albinondjonale/jc/blob/main/jc/model/model.php"
click node_query "https://github.com/albinondjonale/jc/blob/main/jc/qbuilder/qbuilder.php"
click node_migrations "https://github.com/albinondjonale/jc/blob/main/jc/migration.php"
click node_migration_defs "https://github.com/albinondjonale/jc/blob/main/infrastructure/migrations.php"
click node_queue "https://github.com/albinondjonale/jc/blob/main/jc/queue/queue.php"
click node_queue_push "https://github.com/albinondjonale/jc/blob/main/jc/queue/push.php"
click node_realtime "https://github.com/albinondjonale/jc/blob/main/jc/http/request.php"
click node_helpers "https://github.com/albinondjonale/jc/blob/main/jc/helpers.php"
click node_logs "https://github.com/albinondjonale/jc/tree/main/jc/storage/log"

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_routes,node_request,node_middleware,node_response,node_client toneBlue
class node_pages,node_auth,node_templates,node_validation toneAmber
class node_model,node_query,node_migrations,node_migration_defs,node_database toneMint
class node_queue,node_queue_push,node_realtime,node_helpers,node_logs toneRose
```

## Components

### Web runtime

- [Application runner](https://github.com/albinondjonale/jc/blob/main/jc/index.php): `jc/index.php`
- [Route registry](https://github.com/albinondjonale/jc/blob/main/jc/index.php): `jc/index.php`
- [Request parsing](https://github.com/albinondjonale/jc/blob/main/jc/http/request.php): `jc/http/request.php`
- [Middleware](https://github.com/albinondjonale/jc/blob/main/jc/middleware/middleware.php): `jc/middleware/middleware.php`
- [HTTP responses](https://github.com/albinondjonale/jc/blob/main/jc/http/response.php): `jc/http/response.php`

### Identity and rendering

- [Auth pages](https://github.com/albinondjonale/jc/blob/main/jc/pages/pages.php): `jc/pages/pages.php`
- [Auth middleware](https://github.com/albinondjonale/jc/blob/main/jc/middleware/middleware.php): `jc/middleware/middleware.php`
- [Template rendering](https://github.com/albinondjonale/jc/blob/main/jc/http/response.php): `jc/http/response.php`
- [Validation and auth](https://github.com/albinondjonale/jc/blob/main/jc/util/util.php): `jc/util/util.php`

### Data management

- [ORM models](https://github.com/albinondjonale/jc/blob/main/jc/model/model.php): `jc/model/model.php`
- [Query builder](https://github.com/albinondjonale/jc/blob/main/jc/qbuilder/qbuilder.php): `jc/qbuilder/qbuilder.php`
- [Schema migrations](https://github.com/albinondjonale/jc/blob/main/jc/migration.php): `jc/migration.php`
- [Migration definitions](https://github.com/albinondjonale/jc/blob/main/infrastructure/migrations.php): `infrastructure/migrations.php`
- **SQL database**

### Async and utilities

- [File-backed queue](https://github.com/albinondjonale/jc/blob/main/jc/queue/queue.php): `jc/queue/queue.php`
- [Queue writer](https://github.com/albinondjonale/jc/blob/main/jc/queue/push.php): `jc/queue/push.php`
- [Realtime requests](https://github.com/albinondjonale/jc/blob/main/jc/http/request.php): `jc/http/request.php`
- [Framework helpers](https://github.com/albinondjonale/jc/blob/main/jc/helpers.php): `jc/helpers.php`
- [File logs](https://github.com/albinondjonale/jc/tree/main/jc/storage/log): `jc/storage/log`

### Other components

- **Browser client**

## Connections

- Browser client → Application runner: sends request (evidence: `README.md`)
- Application runner → Route registry: runs routes (evidence: `README.md`)
- Route registry → Request parsing: receives request (evidence: `README.md`)
- Route registry → Middleware: applies middleware (evidence: `jc/index.php`)
- Route registry → HTTP responses: returns response (evidence: `README.md`)
- HTTP responses → Browser client: sends response (evidence: `README.md`)
- Middleware → Auth middleware: provides auth (evidence: `jc/middleware/middleware.php`)
- Auth middleware → Validation and auth: checks credentials (evidence: `jc/middleware/middleware.php`)
- Auth pages → Validation and auth: validates login (evidence: `jc/pages/pages.php`)
- Auth pages → HTTP responses: returns responses (evidence: `jc/pages/pages.php`)
- HTTP responses → Template rendering: renders templates (evidence: `jc/http/response.php`)
- ORM models → Query builder: builds queries (evidence: `jc/model/model.php`)
- Schema migrations → Query builder: builds schema queries (evidence: `jc/migration.php`)
- Migration definitions → Schema migrations: runs migrations (evidence: `infrastructure/migrations.php`)
- Query builder → SQL database: executes SQL (evidence: `jc/qbuilder/qbuilder.php`)
- Framework helpers → Query builder: creates connection (evidence: `jc/helpers.php`)
- Query builder → File-backed queue: queues SQL (evidence: `jc/qbuilder/qbuilder.php`)
- File-backed queue → Queue writer: starts writer (evidence: `jc/queue/queue.php`)
- Application runner → Realtime requests: constructs request (evidence: `jc/index.php`)
- Application runner → Framework helpers: writes logs (evidence: `jc/index.php`)
- Framework helpers → File logs: appends entries (evidence: `jc/helpers.php`)
