Context for AI assistants working on this repo.
tb-solid-pod is a browser-based personal data pod inspired by the Solid Project, built with TinyBase for reactive state and LocalStorage. It is not a real Solid server (no LDP, no WebID-TLS); it simulates Solid-style data (personas, contacts, groups, type indexes, file metadata) in a single-page app.
- Dual interface: graphical UI (tabs, forms, lists) + CLI. The CLI runs in the browser (Terminal tab) and in Node (
npm run cli); same commands, environment-specific persistence (LocalStorage vs~/.tb-solid-pod/data/store.json). - App-neutral data store: In the Solid vision, your data belongs to you—not to any particular app. This project embraces that principle: whether you prefer a browser UI (no install, instant access from any device with a modern browser) or a terminal app (scripting, automation, headless operation, CI/CD pipelines), you work with the same data through the same commands. The interface is a matter of preference and context; the data is yours regardless of how you access it.
- Unified CLI = Agent API: The same CLI commands work as a programmatic API for AI coding agents. No custom SDK—agents issue CLI commands (
create-persona,list-contacts,export) in browser or terminal. See Principles and Goals for the full vision. - Data: personas (WebID-style), contacts (including agents), groups (org/team/group) with membership of contacts and your personas, type indexes, virtual file system with metadata, settings/preferences.
- Stack: React, TinyBase, Zod, Vite, TypeScript. Vocabularies: FOAF, vCard, Dublin Core, W3C Org,
@inrupt/vocab-*.
| Path | Purpose |
|---|---|
src/main.tsx |
App entry (demo only). |
src/App.tsx |
Root UI: tabs + CLI. |
src/index.ts |
Library entry – re-exports schemas, utils, CLI, components for import from 'tb-solid-pod'. |
src/schemas/ |
Zod schemas + factory functions + JSON Schema (json-schema.ts via Zod v4 toJSONSchema; persona, contact, group, file, typeIndex, preferences, base). Zod is source of truth—no canonical Solid JSON Schema; we generate from Zod. Static files: npm run generate:schemas → schema/*.json. |
src/utils/ |
settings, storeExport, typeIndex helpers, validation. |
src/cli/ |
CliTerminal (browser), run-node.tsx (Node entry), node-store.ts (file persister), command registry, parse-args, types. |
src/components/ |
PersonaList/Form, ContactList/Form, GroupList/Form, MembershipManager, FileMetadataPanel. |
docs/ |
CODING_GUIDELINES.md, DOCUMENTATION_GUIDELINES.md, DESIGN.md, IMPLEMENTATION_PLAN.md, TEST_PLAN.md, testing/. |
-
GitHub-ready
Repo on GitHub (devalbo/tb-solid-pod),mainpushed, LICENSE (AGPL-3.0-or-later). Repo is private for now. -
Runnable on checkout
npm installandnpm run devwork. README “Getting Started (Demo App)” is accurate..nvmrc(Node 20) and README Node note (“Requires Node 18+” /nvm use) added. -
Usable as a library (GitHub-only, no npm publish)
- package.json:
version0.1.0,description,keywords,main/types/exports→./src/index.ts,files:["src", "README.md"],private: truekept. - src/index.ts: Re-exports schemas, utils, CLI, and components.
- README: “Use as a library” section with
npm install github:devalbo/tb-solid-podand example imports.
- package.json:
-
GitHub Pages (code)
Vitebaseis env-driven (BASE_PATHin CI)..github/workflows/pages.ymlruns on every push tomain, builds withBASE_PATH=/tb-solid-pod/, and deploysdist/to thegh-pagesbranch. README has Live demo link and a "Live demo 404?" note (private repo = no Pages on free plan).
The repo supports runnable on checkout, use as a library (install from GitHub), and live demo on GitHub Pages.
When someone wants to use this in an app they’re working on, point them to the Integration Guide and the Integrating into your app section. Two options:
- Install from GitHub —
npm install github:devalbo/tb-solid-pod. Import schemas, components, and/or CLI. They need a TinyBase store (+ indexes if using files/CLI) and to wrap the app inProvider. README has store setup and table layout. - Copy-paste — Copy
src/schemasand optionallysrc/components,src/cli,src/utils. Same deps (TinyBase, Zod, vocabs). Use when they want to customize or avoid a dependency.
Schemas only (no UI): they can use just the Zod schemas and factory functions; no store/provider required unless they add components or CLI. With UI: they must create a store, optionally call initializeDefaultTypeRegistrations(store, baseUrl), and pass store (and indexes where needed) into the components.
- Library: Consumers install from GitHub (
npm install github:user/tb-solid-pod). We do not publish to npm for now;private: trueis intentional. - Schemas: Zod + JSON-LD; factory functions (e.g.
createPersona,createContact) take a base URL for IRIs. - CLI: Commands live in
src/cli/commands/; registry insrc/cli/registry.tsx. - Components: React components expect a TinyBase
store(and oftenindexes); they are default-exported and re-exported as named fromsrc/index.ts. - Store layout: Table and index names are the library’s stable contract for app authors; they are defined in
src/storeLayout.ts(STORE_TABLES,STORE_INDEXES). Value keys for settings are insrc/utils/settings.ts(SETTINGS_KEYS). Use these constants in code so the implementation stays coherent and app authors do not need to rework when we add sync or other features. - Data integrity: Row shapes match Zod schema output types (Persona, Contact, Group, TypeIndexRow). Prefer typed store accessors in
src/utils/storeAccessors.ts(getPersona, setPersona, getContact, setContact, getGroup, setGroup, getTypeIndexRow, setTypeIndexRow) over raw getRow/setRow so reads are Zod-validated and writes are validated before storage. - Documentation: When adding or editing documentation (README, DESIGN.md, docs/*.md, AGENTS.md), follow docs/DOCUMENTATION_GUIDELINES.md. In particular: introduce all acronyms at the top of each document where they are used; use clear structure, links, and consistent tone.
- Minimal effort to adopt — One install from GitHub, no backend or DB to run; LocalStorage works with no config.
- Pre-built data model — Personas, contacts, groups, type indexes, file metadata already modeled (Zod + JSON-LD); consumer doesn’t have to design schemas.
- Pick what to use — Schemas only, CLI, or React components; no need to take the full app.
- No new infra — No API to host, no auth to set up; runs in the browser with React (+ TinyBase if needed).
- Types, Zod, and JSON Schema included — TypeScript and Zod come with the package; JSON Schema (draft-2020-12) is exported for all schemas via Zod v4's toJSONSchema; no extra typing or schema authoring.
- Flexible integration — Copy-paste or install as dependency; both are documented for low effort.
- Agent-friendly CLI — The CLI doubles as an API for AI coding agents; same commands in browser and terminal, no custom integration needed. See Principles and Goals.
- README.md – Overview, limitations, Use as a library, Getting Started, CLI.
- docs/PRINCIPLES_AND_GOALS.md – Core principles (local-first, data sovereignty, sync later, interoperability); why TinyBase and Solid; what we commit to. Start here for the "why."
- docs/INTEGRATION_GUIDE.md – Step-by-step integration (install vs copy-paste), store setup, Provider, components, CLI.
- docs/USE_CASES.md – How app authors access and manage users, groups, and documents.
- docs/VERSIONING.md – Versioning strategy, build metadata, release process, and step-by-step instructions for cutting releases.
- docs/SHORTCOMINGS.md – What the library does not provide (no WAC, no "shared with me," no p2p transport, etc.).
- docs/DOCUMENT_SHARING_SCENARIOS.md – Sharing scenarios (Solid or ad hoc p2p).
- docs/SOLID_SERVER_STRATEGIES.md – Sync design, authority modes, implementation order.
- docs/SDLC_PROCESS.md – How changes are documented and verified; Feature Checklist.
- docs/CODING_GUIDELINES.md – TypeScript, functions, React components, naming.
- docs/DOCUMENTATION_GUIDELINES.md – How to write docs.
- docs/IMPLEMENTATION_PLAN.md – Feature phases and roadmap.
- docs/TEST_PLAN.md – Test phases and verification.
- docs/testing/ – Unit, BDD/E2E, Storybook docs.
- DESIGN.md – Design notes.