No description
  • Rust 97.4%
  • Nix 2.6%
Find a file
JMARyA 5c2a271ffd
feat: source items from items/ and flows from flows/, flows as markdown
Itemdb sources are now structured: items live under <source>/items/ and
flows under <source>/flows/. Flow definitions become markdown (frontmatter
+ body), are drawn from the same itemdb sources, and layer by id the same
way items do (later source wins, deep merge). The body becomes a FlowDef
description, surfaced by GET /flows.

- itemdb loader scoped to <source>/items/ so flow files aren't read as items
- flowdefs reads markdown, layered across config.itemdb.sources
- drop the obsolete paths.flows config
- migrate example/ and deploy/ to the new layout

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 23:44:36 +02:00
.woodpecker ci: fix 2025-12-14 17:48:24 +01:00
deploy/kubernetes feat: source items from items/ and flows from flows/, flows as markdown 2026-06-20 23:44:36 +02:00
docs deploy: split k8s manifest into one file per resource 2026-06-20 22:01:32 +02:00
example feat: source items from items/ and flows from flows/, flows as markdown 2026-06-20 23:44:36 +02:00
migrations rewrite: carve-off engine, layered itemdb, db-backed auth, pinned docs 2026-06-12 23:14:11 +02:00
src feat: source items from items/ and flows from flows/, flows as markdown 2026-06-20 23:44:36 +02:00
.gitignore rewrite: carve-off engine, layered itemdb, db-backed auth, pinned docs 2026-06-12 23:14:11 +02:00
Cargo.lock fixes 2026-06-15 23:39:20 +02:00
Cargo.toml fixes 2026-06-15 23:39:20 +02:00
devenv.lock fixes 2026-06-15 23:39:20 +02:00
devenv.nix rewrite: carve-off engine, layered itemdb, db-backed auth, pinned docs 2026-06-12 23:14:11 +02:00
devenv.yaml fixes 2026-06-15 23:39:20 +02:00
flake.lock feat: nix builds 2025-12-14 17:34:57 +01:00
flake.nix rewrite: carve-off engine, layered itemdb, db-backed auth, pinned docs 2026-06-12 23:14:11 +02:00
README.md deploy: split k8s manifest into one file per resource 2026-06-20 22:01:32 +02:00
renovate.json Add renovate.json 2025-06-28 00:00:18 +00:00
zensical.toml docs: getting started guide, real zensical nav 2026-06-12 23:44:10 +02:00

CDB

CDB is a primitive economic database. It tracks the flow of things — what exists, where it is, where it came from, where it went.

What does the C stand for? Some say economic. Some say commodity. Some say community. Some say commune. All of them are right.

What it is

  • Small. Five primitives — items, states, transactions, locations, flows — that compose into whatever inventory situation you have.
  • Scale-invariant. One person's pantry, a shared household, a maker space, a community.
  • API-first. CDB is infrastructure. Automation and integrations live outside as operators and talk to it over HTTP.
  • Yours. Self-hosted, no cloud, no analytics. The data about what you own and consume belongs to you.
  • Federated (eventually). Sovereign instances exchanging items and demand signals, peer to peer.

The full documentation lives in docs/ — concepts, architecture, data model.

Running

CDB is a single binary plus PostgreSQL. An instance is configured by a config.toml and a set of definition directories (itemdb sources, locations, flows) — see Storage. Users and tokens live in the database, not in files.

Development

devenv up                              # starts postgres (and provides nightly rust)
cargo run -- example/config.toml       # migrate + serve on 127.0.0.1:8080

Create the first admin (also works as lockout recovery):

cargo run -- example/config.toml bootstrap <name>

Log in with the printed one-time password via POST /auth/login, then manage users and operator tokens through the API — see Users.

Deployment

The container image is built with nix — no Dockerfile:

nix build .#containerImage
skopeo copy docker-archive:result docker://registry.example.com/cdb:latest

deploy/kubernetes/ is a deployment template, one manifest per resource (apply with kubectl apply -f deploy/kubernetes/): itemdb sources are cloned by git init containers (fetching and pinning repos is the deployment's job — core only reads directories), config lives in a Secret, and a minimal postgres is included for small instances.