# nisalasxlik/ssr-hanthane architecture

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

- Interactive diagram: https://gitdiagram.com/nisalasxlik/ssr-hanthane
- Repository: https://github.com/nisalasxlik/ssr-hanthane

## Overview

This repository is an early Hanthana Platform backend scaffold, described as an academic collaboration platform, but the sampled runtime mainly exposes status and diagnostic endpoints. The principal workflow is an HTTP request entering a RoadRunner worker, being routed to a health, system, PostgreSQL, or Redis check, and returning JSON. The worker uses PDO for PostgreSQL and the Redis extension for cache diagnostics; SQL schema files are present, but their contents and runtime use were not sampled. The README lists a Svelte frontend, but no frontend source is in the tree. Connections shown are limited to relationships visible in the worker excerpt.

Main entry points: [`backend/worker.php`](https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/worker.php) (Request router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_request["HTTP Runtime"]
  node_worker["RoadRunner worker<br/>[worker.php]"]
  node_router["Request router<br/>[worker.php]"]
  node_simpleworker["Simple worker<br/>[worker-simple.php]"]
  node_fallback["Fallback server"]
  node_index["Status response<br/>[index.php]"]
end

subgraph group_diagnostics["Status Endpoints"]
  node_health["Health check<br/>[worker.php]"]
  node_system["System info<br/>[worker.php]"]
  node_dbcheck["Database diagnostics<br/>[worker.php]"]
  node_redischeck["Redis diagnostics<br/>[worker.php]"]
end

subgraph group_services["Data Services"]
  node_pgconnect["PDO connection<br/>[worker.php]"]
  node_postgres[("PostgreSQL")]
  node_redisconnect["Redis connection<br/>[worker.php]"]
  node_redis[("Redis")]
  node_schema["SQL schema<br/>[01_full.sql]"]
end

node_client(("HTTP client"))

node_client -->|"sends request"| node_worker
node_worker -->|"routes request"| node_router
node_router -->|"dispatches health"| node_health
node_router -->|"dispatches system"| node_system
node_router -->|"dispatches DB test"| node_dbcheck
node_router -->|"dispatches Redis test"| node_redischeck
node_dbcheck -->|"opens connection"| node_pgconnect
node_health -->|"checks database"| node_pgconnect
node_pgconnect -->|"queries"| node_postgres
node_redischeck -->|"opens connection"| node_redisconnect
node_health -->|"pings"| node_redisconnect
node_redisconnect -->|"connects"| node_redis

click node_worker "https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/worker.php"
click node_router "https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/worker.php"
click node_health "https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/worker.php"
click node_system "https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/worker.php"
click node_dbcheck "https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/worker.php"
click node_redischeck "https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/worker.php"
click node_pgconnect "https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/worker.php"
click node_redisconnect "https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/worker.php"
click node_schema "https://github.com/nisalasxlik/ssr-hanthane/blob/main/DB/01_full.sql"
click node_simpleworker "https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/worker-simple.php"
click node_fallback "https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/fallback-server.php"
click node_index "https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/index.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_worker,node_router,node_simpleworker,node_fallback,node_index,node_client toneBlue
class node_health,node_system,node_dbcheck,node_redischeck toneAmber
class node_pgconnect,node_postgres,node_redisconnect,node_redis,node_schema toneMint
```

## Components

### HTTP Runtime

- [RoadRunner worker](https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/worker.php): `backend/worker.php`
- [Request router](https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/worker.php): `backend/worker.php`
- [Simple worker](https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/worker-simple.php): `backend/worker-simple.php`
- [Fallback server](https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/fallback-server.php): `backend/fallback-server.php`
- [Status response](https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/index.php): `backend/index.php`

### Status Endpoints

- [Health check](https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/worker.php): `backend/worker.php`
- [System info](https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/worker.php): `backend/worker.php`
- [Database diagnostics](https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/worker.php): `backend/worker.php`
- [Redis diagnostics](https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/worker.php): `backend/worker.php`

### Data Services

- [PDO connection](https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/worker.php): `backend/worker.php`
- **PostgreSQL**
- [Redis connection](https://github.com/nisalasxlik/ssr-hanthane/blob/main/backend/worker.php): `backend/worker.php`
- **Redis**
- [SQL schema](https://github.com/nisalasxlik/ssr-hanthane/blob/main/DB/01_full.sql): `DB/01_full.sql`

### Other components

- **HTTP client**

## Connections

- HTTP client → RoadRunner worker: sends request (evidence: `backend/worker.php`)
- RoadRunner worker → Request router: routes request (evidence: `backend/worker.php`)
- Request router → Health check: dispatches health (evidence: `backend/worker.php`)
- Request router → System info: dispatches system (evidence: `backend/worker.php`)
- Request router → Database diagnostics: dispatches DB test (evidence: `backend/worker.php`)
- Request router → Redis diagnostics: dispatches Redis test (evidence: `backend/worker.php`)
- Database diagnostics → PDO connection: opens connection (evidence: `backend/worker.php`)
- Health check → PDO connection: checks database (evidence: `backend/worker.php`)
- PDO connection → PostgreSQL: queries (evidence: `backend/worker.php`)
- Redis diagnostics → Redis connection: opens connection (evidence: `backend/worker.php`)
- Health check → Redis connection: pings (evidence: `backend/worker.php`)
- Redis connection → Redis: connects (evidence: `backend/worker.php`)
