Skip to content

Architecture

github-actions[bot] edited this page Dec 6, 2026 · 1 revision
            Browser / installed PWA
     (React UI · service worker · local SQLite (WASM) for offline)
                          │  HTTP :5959
┌─────────────────────────▼────────────────────────────────────┐
│ Container                                                    │
│  ┌───────────────────────────────┐    ┌───────────────────┐  │
│  │ Next.js (Node)                │    │ Go API (Echo)     │  │
│  │ • serves the UI               │───▶│ 127.0.0.1:59234   │  │
│  │ • /api/proxy/* → /api/v1/*    │    │ • REST /api/v1    │  │
│  └───────────────────────────────┘    │ • image pipeline  │  │
│                                       │ • backup scheduler│  │
│                                       └─────────┬─────────┘  │
│                                                 │            │
│   /homevault (volume): db/ (SQLite + FTS5) · images/ · maps/ │
│                        backups/                              │
└──────────────────────────────────────────────────────────────┘
                                    │ optional: NFS / SMB / local copy
                                    ▼
                                   NAS
Layer Technology
UI Next.js 16 (App Router, standalone output), React 19, TypeScript, Tailwind CSS 4, shadcn/ui, TanStack Query, Lucide icons
Scanning Native BarcodeDetector where available, ZXing fallback
Offline Service worker caches; Go-compiled WebAssembly sync engine; wa-sqlite in the browser; last-writer-wins sync
API Go, Echo v4, sqlx, zerolog
Database SQLite through the pure-Go modernc.org/sqlite driver; WAL mode, FTS5 full-text indexes, recursive CTEs for the location tree
Images disintegration/imaging for resizing and EXIF rotation, chai2010/webp for encoding; a two-worker background thumbnail queue
Packaging Multi-stage Dockerfile → alpine:3.25 runtime with Node 26 and a static Go binary; multi-arch buildx

Repository layout

.
├── backend/                 Go API
│   ├── cmd/server/          main.go: config, logging, HTTP server
│   └── internal/
│       ├── api/router.go    every route in one place
│       ├── api/handlers/    one file per resource (+ tests)
│       ├── db/              connection, PRAGMAs, embedded migrations
│       └── models/          JSON/DB structs
├── frontend/                Next.js app
│   ├── app/                 pages (dashboard, items, containers, segments, search, settings, help…)
│   │   └── api/proxy/       server-side proxy to the Go API
│   ├── components/          UI components (shadcn/ui in components/ui)
│   ├── lib/                 API client, hooks, offline store, sync queue
│   ├── public/              PWA manifest, service worker, WASM assets, icons
│   └── wasm/                Go source of the offline sync engine (→ public/homevault-sync.wasm)
├── docs/                    documentation website sources (Zensical), API reference, openapi.yaml
├── mkdocs.yml               documentation website configuration
├── scripts/                 dev/start helpers, versioning and release tooling
├── Dockerfile               the all-in-one production image
├── docker-compose.yml       production-style compose (published image)
└── Makefile                 build, run, version and release targets

Clone this wiki locally