# ton25467/nova architecture

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

- Interactive diagram: https://gitdiagram.com/ton25467/nova
- Repository: https://github.com/ton25467/nova

## Overview

Nova is a Go HTTP framework for registering and serving APIs, with request middleware and typed request/response helpers. Its core workflow is HTTP request → route match and handler chain → response. The repository also provides database adapters, API documentation/client generation, and a Web3 ticketing toolkit. The README is empty and source excerpts are partial, so links between unsampled subsystems are omitted rather than inferred.

Main entry points: [`engine.go`](https://github.com/ton25467/nova/blob/main/engine.go) (HTTP engine), [`typed.go`](https://github.com/ton25467/nova/blob/main/typed.go) (Typed handlers), [`context.go`](https://github.com/ton25467/nova/blob/main/context.go) (Request context), [`middleware`](https://github.com/ton25467/nova/tree/main/middleware) (Middleware)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP Framework"]
  node_engine["HTTP engine<br/>[engine.go]"]
  node_router["Route tree<br/>[tree.go]"]
  node_context["Request context<br/>[context.go]"]
  node_middleware["Middleware"]
  node_binding["Binding helpers<br/>[binding.go]"]
  node_validation["Validation<br/>[validator.go]"]
  node_typed["Typed handlers<br/>[typed.go]"]
  node_errors["HTTP errors<br/>[errors.go]"]
end

subgraph group_api["API Tooling"]
  node_openapi["OpenAPI docs<br/>[openapi.go]"]
  node_swagger["Swagger UI<br/>[swagger.go]"]
  node_codegen["Client generator"]
  node_sdk["Generated SDKs"]
end

subgraph group_data["Data Adapters"]
  node_database[("Database adapters")]
  node_cache["Database cache<br/>[cache.go]"]
end

subgraph group_web3["Web3 Ticketing"]
  node_web3client["Ethereum RPC<br/>[client.go]"]
  node_signer["Voucher signer<br/>[signer.go]"]
  node_inventory["Ticket inventory<br/>[inventory.go]"]
  node_listener["Chain listener<br/>[listener.go]"]
  node_contract["Ticket contract<br/>[TicketSBT.sol]"]
end

node_client(("HTTP client"))

node_client -->|"sends request"| node_engine
node_engine -->|"matches route"| node_router
node_engine -->|"runs handlers"| node_context
node_engine -->|"runs chain"| node_middleware
node_middleware -->|"uses request"| node_context
node_binding -->|"reads request"| node_context
node_typed -->|"binds and responds"| node_context
node_typed -->|"uses binding"| node_binding
node_typed -->|"validates input"| node_validation
node_typed -->|"returns errors"| node_errors
node_engine -->|"generates TypeScript"| node_codegen
node_codegen -->|"generates clients"| node_sdk
node_client -.->|"uses client"| node_sdk
node_web3client -->|"queries chain"| node_contract
node_listener -->|"uses RPC"| node_web3client

click node_engine "https://github.com/ton25467/nova/blob/main/engine.go"
click node_router "https://github.com/ton25467/nova/blob/main/tree.go"
click node_context "https://github.com/ton25467/nova/blob/main/context.go"
click node_middleware "https://github.com/ton25467/nova/tree/main/middleware"
click node_binding "https://github.com/ton25467/nova/blob/main/binding.go"
click node_validation "https://github.com/ton25467/nova/blob/main/validator.go"
click node_typed "https://github.com/ton25467/nova/blob/main/typed.go"
click node_errors "https://github.com/ton25467/nova/blob/main/errors.go"
click node_openapi "https://github.com/ton25467/nova/blob/main/openapi.go"
click node_swagger "https://github.com/ton25467/nova/blob/main/swagger.go"
click node_codegen "https://github.com/ton25467/nova/tree/main/codegen"
click node_sdk "https://github.com/ton25467/nova/tree/main/sdk"
click node_database "https://github.com/ton25467/nova/tree/main/database"
click node_cache "https://github.com/ton25467/nova/blob/main/database/cache.go"
click node_web3client "https://github.com/ton25467/nova/blob/main/sdk/web3/client.go"
click node_signer "https://github.com/ton25467/nova/blob/main/sdk/web3/signer.go"
click node_inventory "https://github.com/ton25467/nova/blob/main/sdk/web3/inventory.go"
click node_listener "https://github.com/ton25467/nova/blob/main/sdk/web3/listener.go"
click node_contract "https://github.com/ton25467/nova/blob/main/contracts/TicketSBT.sol"

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_engine,node_router,node_context,node_middleware,node_binding,node_validation,node_typed,node_errors,node_client toneBlue
class node_openapi,node_swagger,node_codegen,node_sdk toneAmber
class node_database,node_cache toneMint
class node_web3client,node_signer,node_inventory,node_listener,node_contract toneRose
```

## Components

### HTTP Framework

- [HTTP engine](https://github.com/ton25467/nova/blob/main/engine.go): `engine.go`
- [Route tree](https://github.com/ton25467/nova/blob/main/tree.go): `tree.go`
- [Request context](https://github.com/ton25467/nova/blob/main/context.go): `context.go`
- [Middleware](https://github.com/ton25467/nova/tree/main/middleware): `middleware`
- [Binding helpers](https://github.com/ton25467/nova/blob/main/binding.go): `binding.go`
- [Validation](https://github.com/ton25467/nova/blob/main/validator.go): `validator.go`
- [Typed handlers](https://github.com/ton25467/nova/blob/main/typed.go): `typed.go`
- [HTTP errors](https://github.com/ton25467/nova/blob/main/errors.go): `errors.go`

### API Tooling

- [OpenAPI docs](https://github.com/ton25467/nova/blob/main/openapi.go): `openapi.go`
- [Swagger UI](https://github.com/ton25467/nova/blob/main/swagger.go): `swagger.go`
- [Client generator](https://github.com/ton25467/nova/tree/main/codegen): `codegen`
- [Generated SDKs](https://github.com/ton25467/nova/tree/main/sdk): `sdk`

### Data Adapters

- [Database adapters](https://github.com/ton25467/nova/tree/main/database): `database`
- [Database cache](https://github.com/ton25467/nova/blob/main/database/cache.go): `database/cache.go`

### Web3 Ticketing

- [Ethereum RPC](https://github.com/ton25467/nova/blob/main/sdk/web3/client.go): `sdk/web3/client.go`
- [Voucher signer](https://github.com/ton25467/nova/blob/main/sdk/web3/signer.go): `sdk/web3/signer.go`
- [Ticket inventory](https://github.com/ton25467/nova/blob/main/sdk/web3/inventory.go): `sdk/web3/inventory.go`
- [Chain listener](https://github.com/ton25467/nova/blob/main/sdk/web3/listener.go): `sdk/web3/listener.go`
- [Ticket contract](https://github.com/ton25467/nova/blob/main/contracts/TicketSBT.sol): `contracts/TicketSBT.sol`

### Other components

- **HTTP client**

## Connections

- HTTP client → HTTP engine: sends request
- HTTP engine → Route tree: matches route
- HTTP engine → Request context: runs handlers
- HTTP engine → Middleware: runs chain
- Middleware → Request context: uses request
- Binding helpers → Request context: reads request
- Typed handlers → Request context: binds and responds
- Typed handlers → Binding helpers: uses binding
- Typed handlers → Validation: validates input
- Typed handlers → HTTP errors: returns errors
- HTTP engine → Client generator: generates TypeScript
- Client generator → Generated SDKs: generates clients
- HTTP client → Generated SDKs: uses client
- Ethereum RPC → Ticket contract: queries chain
- Chain listener → Ethereum RPC: uses RPC
