# owl23007/nova-http architecture

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

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

## Overview

Nova is a lightweight Node.js TCP-based HTTP framework. The main workflow is an application developer configuring an app, which accepts HTTP requests, parses them, dispatches middleware and routes, and returns a response over the connection. Major documented features include sub-apps, lifecycle hooks, streaming with backpressure, body parsing, and static files. The tree and excerpts support the core dispatch and server relationships; the exact internals of some protocol and CLI wiring were not sampled.

Main entry points: [`packages/nova-http/src/core/application.ts`](https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/core/application.ts) (Application), [`packages/nova-http/src/server/http1-connection.ts`](https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/server/http1-connection.ts) (Connection coordinator), [`packages/nova-http/src/core/middleware-chain.ts`](https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/core/middleware-chain.ts) (Middleware chain), [`packages/nova-http/src/index.ts`](https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/index.ts) (Public API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["App setup"]
  node_api["Public API<br/>[index.ts]"]
  node_appfactory["App factory<br/>[nova.ts]"]
  node_cli["Project CLI<br/>[nova.ts]"]
  node_templates["App templates"]
end

subgraph group_runtime["Request runtime"]
  node_application["Application<br/>[application.ts]"]
  node_router["Radix router<br/>[router.ts]"]
  node_middleware["Middleware chain"]
  node_hooks["Lifecycle hooks<br/>[hooks.ts]"]
  node_request["Request model<br/>[request.ts]"]
  node_response["Response model<br/>[response.ts]"]
end

subgraph group_http["HTTP transport"]
  node_tcpserver["TCP server<br/>[server.ts]"]
  node_connection["Connection coordinator"]
  node_parser["HTTP/1 parser<br/>[parser.ts]"]
  node_messages["HTTP messages<br/>[index.ts]"]
  node_sink["Response sink"]
end

subgraph group_features["HTTP features"]
  node_bodyparser["Body parser<br/>[body-parser.ts]"]
  node_staticfiles["Static files<br/>[static-files.ts]"]
  node_staticserving["File serving<br/>[send-file.ts]"]
end

node_developer(("App developer"))
node_client(("HTTP client"))

node_developer -->|"uses"| node_api
node_api -->|"exports"| node_appfactory
node_appfactory -->|"creates"| node_application
node_developer -.->|"runs"| node_cli
node_cli -.->|"scaffolds from"| node_templates
node_client -->|"opens connection"| node_tcpserver
node_tcpserver -->|"creates"| node_connection
node_connection -->|"parses bytes"| node_parser
node_connection -->|"dispatches request"| node_application
node_parser -->|"builds messages"| node_messages
node_connection -->|"constructs"| node_request
node_application -->|"dispatches"| node_middleware
node_application -->|"matches routes"| node_router
node_application -->|"emits events"| node_hooks
node_middleware -->|"runs middleware"| node_bodyparser
node_middleware -->|"runs middleware"| node_staticfiles
node_staticfiles -->|"sends files"| node_staticserving
node_application -->|"produces response"| node_response
node_response -->|"writes response"| node_sink
node_sink -->|"writes bytes"| node_connection

click node_api "https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/index.ts"
click node_appfactory "https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/app/nova.ts"
click node_application "https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/core/application.ts"
click node_router "https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/core/router.ts"
click node_middleware "https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/core/middleware-chain.ts"
click node_hooks "https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/core/hooks.ts"
click node_request "https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/core/request.ts"
click node_response "https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/core/response.ts"
click node_tcpserver "https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/server/server.ts"
click node_connection "https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/server/http1-connection.ts"
click node_parser "https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/protocol/http1/parser.ts"
click node_messages "https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/message/index.ts"
click node_sink "https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/server/http1-response-sink.ts"
click node_bodyparser "https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/middlewares/body-parser.ts"
click node_staticfiles "https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/middlewares/static-files.ts"
click node_staticserving "https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/static/send-file.ts"
click node_cli "https://github.com/owl23007/nova-http/blob/master/packages/nova-http/cli/nova.ts"
click node_templates "https://github.com/owl23007/nova-http/tree/master/packages/nova-http/cli/templates"

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_api,node_appfactory,node_cli,node_templates,node_client toneBlue
class node_application,node_router,node_middleware,node_hooks,node_request,node_response toneAmber
class node_tcpserver,node_connection,node_parser,node_messages,node_sink toneMint
class node_bodyparser,node_staticfiles,node_staticserving toneRose
class node_developer toneIndigo
```

## Components

### App setup

- [Public API](https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/index.ts): `packages/nova-http/src/index.ts`
- [App factory](https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/app/nova.ts): `packages/nova-http/src/app/nova.ts`
- [Project CLI](https://github.com/owl23007/nova-http/blob/master/packages/nova-http/cli/nova.ts): `packages/nova-http/cli/nova.ts`
- [App templates](https://github.com/owl23007/nova-http/tree/master/packages/nova-http/cli/templates): `packages/nova-http/cli/templates`

### Request runtime

- [Application](https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/core/application.ts): `packages/nova-http/src/core/application.ts`
- [Radix router](https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/core/router.ts): `packages/nova-http/src/core/router.ts`
- [Middleware chain](https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/core/middleware-chain.ts): `packages/nova-http/src/core/middleware-chain.ts`
- [Lifecycle hooks](https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/core/hooks.ts): `packages/nova-http/src/core/hooks.ts`
- [Request model](https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/core/request.ts): `packages/nova-http/src/core/request.ts`
- [Response model](https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/core/response.ts): `packages/nova-http/src/core/response.ts`

### HTTP transport

- [TCP server](https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/server/server.ts): `packages/nova-http/src/server/server.ts`
- [Connection coordinator](https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/server/http1-connection.ts): `packages/nova-http/src/server/http1-connection.ts`
- [HTTP/1 parser](https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/protocol/http1/parser.ts): `packages/nova-http/src/protocol/http1/parser.ts`
- [HTTP messages](https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/message/index.ts): `packages/nova-http/src/message/index.ts`
- [Response sink](https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/server/http1-response-sink.ts): `packages/nova-http/src/server/http1-response-sink.ts`

### HTTP features

- [Body parser](https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/middlewares/body-parser.ts): `packages/nova-http/src/middlewares/body-parser.ts`
- [Static files](https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/middlewares/static-files.ts): `packages/nova-http/src/middlewares/static-files.ts`
- [File serving](https://github.com/owl23007/nova-http/blob/master/packages/nova-http/src/static/send-file.ts): `packages/nova-http/src/static/send-file.ts`

### Other components

- **App developer**
- **HTTP client**

## Connections

- App developer → Public API: uses
- Public API → App factory: exports
- App factory → Application: creates
- App developer → Project CLI: runs
- Project CLI → App templates: scaffolds from
- HTTP client → TCP server: opens connection
- TCP server → Connection coordinator: creates
- Connection coordinator → HTTP/1 parser: parses bytes
- Connection coordinator → Application: dispatches request
- HTTP/1 parser → HTTP messages: builds messages
- Connection coordinator → Request model: constructs
- Application → Middleware chain: dispatches
- Application → Radix router: matches routes
- Application → Lifecycle hooks: emits events
- Middleware chain → Body parser: runs middleware
- Middleware chain → Static files: runs middleware
- Static files → File serving: sends files
- Application → Response model: produces response
- Response model → Response sink: writes response
- Response sink → Connection coordinator: writes bytes
