Skip to content

Architecture Overview

Norn is structured as three independent modules: an API server, a React UI, and a CLI. They communicate through a REST API and WebSocket connection.

System diagram

Module boundaries

API (api/)

The Go backend — a single binary that runs the HTTP server, WebSocket hub, deploy/forge pipelines, cron scheduler, and health checker.

api/
├── handler/     REST + WebSocket handlers (chi router)
├── hub/         WebSocket broadcast hub (gorilla/websocket)
├── k8s/         Kubernetes API client (client-go)
├── model/       infraspec parser, data models
├── pipeline/    Deploy, Forge, and Teardown pipelines
├── secrets/     SOPS encrypt/decrypt + K8s sync
├── cron/        Cron scheduler (in-container execution)
└── store/       PostgreSQL persistence (pgx)

CLI (cli/)

Charm-powered terminal client. Connects to the API via HTTP and WebSocket.

cli/
├── api/         HTTP + WebSocket API client
├── cmd/         Cobra commands (status, deploy, logs, etc.)
├── style/       Lip Gloss color palette and component styles
└── terraform/   Terraform runner for cluster commands

UI (ui/)

React 19 + Vite + TypeScript single-page application.

ui/src/
├── components/  AppCard, LogViewer, DeployPanel, Welcome, StatusBar
├── hooks/       useApps, useWebSocket
└── types/       TypeScript interfaces

Request flow

A typical deploy request flows through the system like this:

API endpoints

MethodEndpointDescription
GET/api/healthService health check
GET/api/appsList all discovered apps
GET/api/apps/:idApp detail + recent deployments
GET/api/apps/:id/logsStream pod logs
POST/api/apps/:id/deployTrigger deploy pipeline
POST/api/apps/:id/restartRolling restart
POST/api/apps/:id/rollbackRollback to previous image
GET/api/apps/:id/artifactsList retained image tags
GET/api/apps/:id/secretsList secret names
PUT/api/apps/:id/secretsUpdate secrets
GET/api/apps/:id/snapshotsList DB snapshots
GET/api/apps/:id/health-historyHealth check history
POST/api/apps/:id/forgeTrigger forge pipeline
DELETE/api/apps/:id/forgeTrigger teardown pipeline
GET/api/apps/:id/forgeGet forge state
GET/api/deploymentsList all deployments (filterable)
WS/wsReal-time events

Configuration

VariableDefaultDescription
NORN_PORT8800API server port
NORN_DATABASE_URLpostgres://norn:norn@localhost:5432/norn_db?sslmode=disablePostgreSQL connection
NORN_APPS_DIR~/projectsDirectory to scan for infraspec.yaml
NORN_UI_DIR(empty)Path to built UI static files (production only)
NORN_URLhttp://localhost:8800CLI: API server URL