Repository navigation
Architecture
Hamroqulovv edited this page Oct 8, 2026
·
2 revisions
Git is the source of truth. The database is only an index and a stats store. Static files on disk are the delivery mechanism.
flowchart LR
Registry[Git: /registry] --> Builder[packages/builder] --> Static[Static /r/*.json on disk]
Static --> CLI[apps/cli]
CLI --> Events[POST /api/events]
Events --> API[apps/api] --> DB[(Postgres)]
Caddy[Caddy] --> Static
Caddy --> API
Reading components (CLI or website) never hits the API or database — Caddy serves static files. The API handles only dynamic concerns: events/stats, likes, newsletter, admin.
| Path | Description | Status |
|---|---|---|
apps/api |
Hono server: events, stats, likes, newsletter, RSS | Planned (stub) |
apps/cli |
@framebits/cli — init, add (list/search/diff/update planned) |
Ready |
apps/web |
React + Vite catalog, detail pages, sandboxed playground | Ready |
packages/shared |
Zod schemas + inferred types (single source of truth) | Ready |
packages/db |
Drizzle schema, migrations, DB client, seed/sync | Planned (stub) |
packages/builder |
Registry build pipeline | Ready |
packages/config |
Shared tsconfig + ESLint config | Ready |
registry/ |
Component sources — data, never executed by CLI/API/site | Ready |
deploy/ |
Docker Compose, Caddyfile, deploy scripts | Placeholder |
pnpm build:registry [--out dir] [--check]
-
Discover every
meta.jsonunder/registry - Validate all of them (collects every error, then fails)
- Cross-validate: duplicate slugs, missing deps, cycles (with full path), slug/folder mismatches, missing sources or demos
- Type-check all sources against pinned React + Tailwind types
- Analyze imports (TS compiler API): undeclared externals fail; registry imports must use alias form and be declared
-
Security scan (AST + CSS):
eval,Function, network/cookie access fail - Normalize line endings/BOM, map to CLI target paths
- Hash canonical JSON (SHA-256, key-order independent, excludes version/title/timestamps)
-
Version via
registry.lock.json(new →1.0.0, changed → patch; immutable<slug>@<version>.jsonarchives) - Emit atomically: byte-identical output on identical input
- Index search (MiniSearch) + manifest + JSON schemas
--check runs everything and writes nothing — it gates every PR in CI.
| Artifact | Schema | Notes |
|---|---|---|
meta.json (human-written) |
MetaSchema |
Strict: unknown keys rejected |
/r/<slug>.json |
RegistryItemSchema |
schemaVersion: 1, POSIX-only file paths |
/r/index.json |
RegistryIndexSchema |
Published/deprecated only, sorted |
framebits.json |
CliConfigSchema |
See Configuration |
All schemas live in packages/shared — never duplicated. Details:
docs/CONTRACTS.md and docs/BUILDER.md in the repo.
The normative spec lives in the repo:
docs/MASTER_PROMPT.md. If this wiki contradicts the repo, the repo wins — please open an issue.