# inkloom-art/inkloom architecture

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

- Interactive diagram: https://gitdiagram.com/inkloom-art/inkloom
- Repository: https://github.com/inkloom-art/inkloom

## Overview

Inkloom is an early-access platform for a future logo-design product; logo generation is explicitly not live. The present user journey is to learn about the service, create and secure an account, redeem an access code, and see reserved credits. The repository also includes user and operations consoles, an API, persistence, and operational monitoring. Edges are limited to relationships shown in the README or source excerpts/index; several route-level connections remain unverified because their implementations were not sampled.

Main entry points: [`apps/web/workers/app.ts`](https://github.com/inkloom-art/inkloom/blob/master/apps/web/workers/app.ts) (Worker entry), [`packages/core/src/auth/auth.ts`](https://github.com/inkloom-art/inkloom/blob/master/packages/core/src/auth/auth.ts) (Authentication service), [`packages/db/src/client.ts`](https://github.com/inkloom-art/inkloom/blob/master/packages/db/src/client.ts) (Postgres database), [`packages/api/src/routes/auth.ts`](https://github.com/inkloom-art/inkloom/blob/master/packages/api/src/routes/auth.ts) (Authentication routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_web["Web application"]
  node_marketing["Marketing pages"]
  node_authui["Account flows"]
  node_memberui["Member console"]
  node_adminui["Operations console"]
end

subgraph group_services["API services"]
  node_worker["Worker entry<br/>[app.ts]"]
  node_api["API application<br/>[index.ts]"]
  node_authroutes["Authentication routes<br/>[auth.ts]"]
  node_authmiddleware["Access middleware<br/>[auth.ts]"]
end

subgraph group_domain["Account and credits"]
  node_authcore["Authentication service<br/>[auth.ts]"]
  node_sessionpolicy["Session policy<br/>[session-policy.ts]"]
  node_codes["Access-code redemption<br/>[redemption.ts]"]
  node_credits["Credit ledger<br/>[ledger.ts]"]
end

subgraph group_platform["Data and messaging"]
  node_database[("Postgres database<br/>[client.ts]")]
  node_authschema[("Account schema<br/>[auth.ts]")]
  node_email["Email delivery<br/>[transport.ts]"]
end

subgraph group_operations["Operations"]
  node_telemetry["Telemetry rollup<br/>[rollup.ts]"]
  node_retention["Retention sweep<br/>[sweep.ts]"]
  node_health["Health checks<br/>[index.ts]"]
end

node_visitor(("Visitor"))
node_member(("Member"))

node_visitor -->|"browses"| node_marketing
node_member -->|"creates account"| node_authui
node_member -.->|"uses"| node_memberui
node_web -->|"served by"| node_worker
node_worker -->|"dispatches API"| node_api
node_api -.->|"routes requests"| node_authroutes
node_authroutes -->|"uses authentication"| node_authcore
node_authroutes -->|"sends messages"| node_email
node_authroutes -->|"accesses data"| node_database
node_authmiddleware -->|"validates sessions"| node_authcore
node_authmiddleware -->|"checks session policy"| node_sessionpolicy
node_authcore -->|"persists account data"| node_database
node_authcore -->|"sends messages"| node_email
node_authcore -->|"uses session rules"| node_sessionpolicy
node_codes -->|"records credit entry"| node_credits
node_codes -->|"persists redemption"| node_database
node_credits -->|"reads and writes"| node_database
node_authschema -.->|"defines account tables"| node_database
node_worker -->|"runs daily rollup"| node_telemetry
node_worker -->|"runs sweep"| node_retention
node_worker -->|"checks health"| node_health

click node_web "https://github.com/inkloom-art/inkloom/tree/master/apps/web/app/routes"
click node_marketing "https://github.com/inkloom-art/inkloom/tree/master/apps/web/app/routes/marketing"
click node_authui "https://github.com/inkloom-art/inkloom/tree/master/apps/web/app/routes/auth"
click node_memberui "https://github.com/inkloom-art/inkloom/tree/master/apps/web/app/routes/app"
click node_adminui "https://github.com/inkloom-art/inkloom/tree/master/apps/web/app/routes/admin"
click node_worker "https://github.com/inkloom-art/inkloom/blob/master/apps/web/workers/app.ts"
click node_api "https://github.com/inkloom-art/inkloom/blob/master/packages/api/src/index.ts"
click node_authroutes "https://github.com/inkloom-art/inkloom/blob/master/packages/api/src/routes/auth.ts"
click node_authmiddleware "https://github.com/inkloom-art/inkloom/blob/master/packages/api/src/middleware/auth.ts"
click node_authcore "https://github.com/inkloom-art/inkloom/blob/master/packages/core/src/auth/auth.ts"
click node_sessionpolicy "https://github.com/inkloom-art/inkloom/blob/master/packages/core/src/auth/session-policy.ts"
click node_codes "https://github.com/inkloom-art/inkloom/blob/master/packages/core/src/access-codes/redemption.ts"
click node_credits "https://github.com/inkloom-art/inkloom/blob/master/packages/core/src/credits/ledger.ts"
click node_database "https://github.com/inkloom-art/inkloom/blob/master/packages/db/src/client.ts"
click node_authschema "https://github.com/inkloom-art/inkloom/blob/master/packages/db/src/schema/auth.ts"
click node_email "https://github.com/inkloom-art/inkloom/blob/master/packages/email/src/transport.ts"
click node_telemetry "https://github.com/inkloom-art/inkloom/blob/master/packages/core/src/telemetry/rollup.ts"
click node_retention "https://github.com/inkloom-art/inkloom/blob/master/packages/core/src/retention/sweep.ts"
click node_health "https://github.com/inkloom-art/inkloom/blob/master/packages/core/src/health/index.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_web,node_marketing,node_authui,node_memberui,node_adminui toneBlue
class node_worker,node_api,node_authroutes,node_authmiddleware toneAmber
class node_authcore,node_sessionpolicy,node_codes,node_credits toneMint
class node_database,node_authschema,node_email toneRose
class node_telemetry,node_retention,node_health,node_visitor,node_member toneIndigo
```

## Components

### Web experience

- [Web application](https://github.com/inkloom-art/inkloom/tree/master/apps/web/app/routes): `apps/web/app/routes`
- [Marketing pages](https://github.com/inkloom-art/inkloom/tree/master/apps/web/app/routes/marketing): `apps/web/app/routes/marketing`
- [Account flows](https://github.com/inkloom-art/inkloom/tree/master/apps/web/app/routes/auth): `apps/web/app/routes/auth`
- [Member console](https://github.com/inkloom-art/inkloom/tree/master/apps/web/app/routes/app): `apps/web/app/routes/app`
- [Operations console](https://github.com/inkloom-art/inkloom/tree/master/apps/web/app/routes/admin): `apps/web/app/routes/admin`

### API services

- [Worker entry](https://github.com/inkloom-art/inkloom/blob/master/apps/web/workers/app.ts): `apps/web/workers/app.ts`
- [API application](https://github.com/inkloom-art/inkloom/blob/master/packages/api/src/index.ts): `packages/api/src/index.ts`
- [Authentication routes](https://github.com/inkloom-art/inkloom/blob/master/packages/api/src/routes/auth.ts): `packages/api/src/routes/auth.ts`
- [Access middleware](https://github.com/inkloom-art/inkloom/blob/master/packages/api/src/middleware/auth.ts): `packages/api/src/middleware/auth.ts`

### Account and credits

- [Authentication service](https://github.com/inkloom-art/inkloom/blob/master/packages/core/src/auth/auth.ts): `packages/core/src/auth/auth.ts`
- [Session policy](https://github.com/inkloom-art/inkloom/blob/master/packages/core/src/auth/session-policy.ts): `packages/core/src/auth/session-policy.ts`
- [Access-code redemption](https://github.com/inkloom-art/inkloom/blob/master/packages/core/src/access-codes/redemption.ts): `packages/core/src/access-codes/redemption.ts`
- [Credit ledger](https://github.com/inkloom-art/inkloom/blob/master/packages/core/src/credits/ledger.ts): `packages/core/src/credits/ledger.ts`

### Data and messaging

- [Postgres database](https://github.com/inkloom-art/inkloom/blob/master/packages/db/src/client.ts): `packages/db/src/client.ts`
- [Account schema](https://github.com/inkloom-art/inkloom/blob/master/packages/db/src/schema/auth.ts): `packages/db/src/schema/auth.ts`
- [Email delivery](https://github.com/inkloom-art/inkloom/blob/master/packages/email/src/transport.ts): `packages/email/src/transport.ts`

### Operations

- [Telemetry rollup](https://github.com/inkloom-art/inkloom/blob/master/packages/core/src/telemetry/rollup.ts): `packages/core/src/telemetry/rollup.ts`
- [Retention sweep](https://github.com/inkloom-art/inkloom/blob/master/packages/core/src/retention/sweep.ts): `packages/core/src/retention/sweep.ts`
- [Health checks](https://github.com/inkloom-art/inkloom/blob/master/packages/core/src/health/index.ts): `packages/core/src/health/index.ts`

### Other components

- **Visitor**
- **Member**

## Connections

- Visitor → Marketing pages: browses
- Member → Account flows: creates account
- Member → Member console: uses
- Web application → Worker entry: served by
- Worker entry → API application: dispatches API (evidence: `apps/web/workers/app.ts`)
- API application → Authentication routes: routes requests
- Authentication routes → Authentication service: uses authentication (evidence: `packages/api/src/routes/auth.ts`)
- Authentication routes → Email delivery: sends messages (evidence: `packages/api/src/routes/auth.ts`)
- Authentication routes → Postgres database: accesses data (evidence: `packages/api/src/routes/auth.ts`)
- Access middleware → Authentication service: validates sessions (evidence: `packages/api/src/middleware/auth.ts`)
- Access middleware → Session policy: checks session policy (evidence: `packages/api/src/middleware/auth.ts`)
- Authentication service → Postgres database: persists account data (evidence: `packages/core/src/auth/auth.ts`)
- Authentication service → Email delivery: sends messages (evidence: `packages/core/src/auth/auth.ts`)
- Authentication service → Session policy: uses session rules (evidence: `packages/core/src/auth/auth.ts`)
- Access-code redemption → Credit ledger: records credit entry (evidence: `packages/core/src/access-codes/redemption.ts`)
- Access-code redemption → Postgres database: persists redemption (evidence: `packages/core/src/access-codes/redemption.ts`)
- Credit ledger → Postgres database: reads and writes (evidence: `packages/core/src/credits/ledger.ts`)
- Account schema → Postgres database: defines account tables
- Worker entry → Telemetry rollup: runs daily rollup (evidence: `apps/web/workers/app.ts`)
- Worker entry → Retention sweep: runs sweep (evidence: `apps/web/workers/app.ts`)
- Worker entry → Health checks: checks health (evidence: `apps/web/workers/app.ts`)
