Skip to content

Commit adbd136

Browse files
committed
adding principles and goals doc; referring to it from other docs
1 parent 86d8758 commit adbd136

10 files changed

Lines changed: 299 additions & 86 deletions

AGENTS.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Context for AI assistants working on this repo.
77
**tb-solid-pod** is a browser-based personal data pod inspired by the [Solid Project](https://solidproject.org/), built with [TinyBase](https://tinybase.org/) 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.
88

99
- **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`).
10+
- **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](docs/PRINCIPLES_AND_GOALS.md) for the full vision.
1011
- **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.
1112
- **Stack**: React, TinyBase, Zod, Vite, TypeScript. Vocabularies: FOAF, vCard, Dublin Core, W3C Org, `@inrupt/vocab-*`.
1213

@@ -68,22 +69,23 @@ When someone wants to use this in an app they’re working on, point them to the
6869
- **Pre-built data model** — Personas, contacts, groups, type indexes, file metadata already modeled (Zod + JSON-LD); consumer doesn’t have to design schemas.
6970
- **Pick what to use** — Schemas only, CLI, or React components; no need to take the full app.
7071
- **No new infra** — No API to host, no auth to set up; runs in the browser with React (+ TinyBase if needed).
71-
- **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 v4s toJSONSchema; no extra typing or schema authoring.
72+
- **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.
7273
- **Flexible integration** — Copy-paste or install as dependency; both are documented for low effort.
74+
- **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](docs/PRINCIPLES_AND_GOALS.md#8-unified-cli-for-browser-and-terminal).
7375

7476
## Useful docs
7577

76-
- **README.md** – Overview, limitations, Use as a library (Zod + JSON Schema), link to Integration Guide, Getting Started (Node note, Live demo + 404 troubleshooting), Running the CLI in the terminal (`npm run cli`, exit, single-command mode), Testing (unit, BDD, Storybook link), CLI command list.
77-
- **docs/INTEGRATION_GUIDE.md** – Step-by-step integration (install-from-GitHub vs copy-paste), store setup, Provider, components, CLI (browser + terminal), data tables, extending.
78-
- **docs/SDLC_PROCESS.md** – How changes are introduced, documented, and verified; links to Feature Checklist.
79-
- **docs/FEATURE_CHECKLIST.md** – Manual verification checklist ordered by dependency (foundational first); assume features are broken until verified.
80-
- **docs/CODING_GUIDELINES.md** – TypeScript (strict types, no sloppy types), short functions, simple React components, naming, file length.
81-
- **docs/DOCUMENTATION_GUIDELINES.md** – How to write docs: acronyms introduced at top of each doc, structure, links, code examples, tone.
78+
- **README.md** – Overview, limitations, Use as a library, Getting Started, CLI.
79+
- **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."**
80+
- **docs/INTEGRATION_GUIDE.md** – Step-by-step integration (install vs copy-paste), store setup, Provider, components, CLI.
81+
- **docs/USE_CASES.md** – How app authors access and manage users, groups, and documents.
82+
- **docs/SHORTCOMINGS.md** – What the library does *not* provide (no WAC, no "shared with me," no p2p transport, etc.).
83+
- **docs/DOCUMENT_SHARING_SCENARIOS.md** – Sharing scenarios (Solid or ad hoc p2p).
84+
- **docs/SOLID_SERVER_STRATEGIES.md** – Sync design, authority modes, implementation order.
85+
- **docs/SDLC_PROCESS.md** – How changes are documented and verified; Feature Checklist.
86+
- **docs/CODING_GUIDELINES.md** – TypeScript, functions, React components, naming.
87+
- **docs/DOCUMENTATION_GUIDELINES.md** – How to write docs.
8288
- **docs/IMPLEMENTATION_PLAN.md** – Feature phases and roadmap.
83-
- **docs/DOCUMENT_REVIEW.md** – Documentation review: planning strengths, objections/risks, and areas where more information is required.
84-
- **docs/USE_CASES.md** – How app authors use the library to access and manage users (personas), groups, and documents; Q&A and quick reference.
85-
- **docs/DOCUMENT_SHARING_SCENARIOS.md** – Scenarios for apps where users share document-oriented data (Solid or ad hoc p2p); what the library helps with and what the app adds.
86-
- **docs/SHORTCOMINGS.md** – Shortcomings for document sharing and collaboration (no WAC, no "shared with me," no p2p transport, etc.).
8789
- **docs/TEST_PLAN.md** – Test phases and verification.
88-
- **docs/testing/** – Unit (unit-tests.md), BDD/E2E (bdd-tests.md), Storybook (storybook.md); BDD does not start the dev server (start it manually).
90+
- **docs/testing/** – Unit, BDD/E2E, Storybook docs.
8991
- **DESIGN.md** – Design notes.

README.md

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -52,27 +52,16 @@ This library provides a complete foundation for **user-owned social data** in we
5252

5353
## Benefits for Social Applications
5454

55-
### 1. User Data Ownership
56-
Users control their data in their browser's LocalStorage. No server-side database required for basic functionality. Data can be exported as JSON-LD for portability.
57-
58-
### 2. Interoperable Schemas
59-
Built on established vocabularies (FOAF, vCard, Dublin Core, Schema.org, W3C Org), making data portable to other Solid-compatible systems or any RDF-aware application.
60-
61-
### 3. Relationship Modeling
62-
The contact + group + persona architecture supports:
63-
- Friend/follower relationships
64-
- Team collaboration structures
65-
- Organization hierarchies
66-
- Agent/bot permissions (who can act on your behalf)
67-
68-
### 4. Offline-First
69-
TinyBase with LocalStorage means the app works entirely offline. No network requests required for core functionality.
70-
71-
### 5. Reactive UI
72-
TinyBase's reactive hooks (`useRow`, `useTable`, `useSliceRowIds`) keep UI in sync with data automatically. Changes in CLI reflect immediately in the graphical UI and vice versa.
73-
74-
### 6. Extensible Foundation
75-
The schema system (Zod + JSON-LD) provides a pattern for adding new data types. The CLI command registry makes adding new commands straightforward.
55+
See [docs/PRINCIPLES_AND_GOALS.md](docs/PRINCIPLES_AND_GOALS.md) for the full rationale (why TinyBase, why Solid, what we commit to).
56+
57+
| Benefit | Summary |
58+
|---------|---------|
59+
| **User Data Ownership** | Data in browser LocalStorage; export as JSON-LD anytime. |
60+
| **Interoperable Schemas** | FOAF, vCard, Dublin Core, Schema.org, W3C Org—portable to Solid/RDF systems. |
61+
| **Relationship Modeling** | Personas + contacts + groups support friend/follower, team, org, and agent patterns. |
62+
| **Offline-First** | TinyBase + LocalStorage; no network required for core features. |
63+
| **Reactive UI** | TinyBase hooks keep UI in sync; CLI and UI reflect changes immediately. |
64+
| **Extensible** | Zod + JSON-LD schemas and CLI command registry for adding new types. |
7665

7766
## Limitations & Where It Falls Short
7867

docs/DOCUMENT_SHARING_SCENARIOS.md

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
11
# Document-sharing scenarios
22

3-
This doc describes how **tb-solid-pod** can support applications where **users share document-oriented data** with one another—ideally following **Solid** principles (pod URLs, access control, federation) or, as a fallback, **ad hoc peer-to-peer** (export/import, link, or custom channel). It is written for app authors who are evaluating or integrating the library for sharing and collaboration features.
3+
This doc describes how **tb-solid-pod** supports applications where users share document-oriented data. It covers Solid-style sharing (pod URLs, WAC) and ad hoc peer-to-peer (export/import). For core principles (local-first, data sovereignty, interoperability), see [PRINCIPLES_AND_GOALS.md](PRINCIPLES_AND_GOALS.md). For what the library does *not* provide, see [SHORTCOMINGS.md](SHORTCOMINGS.md).
44

5-
**Terms used here:** **Solid** is the [Solid Project](https://solidproject.org/) vision: user-owned data in **pods** (personal online data stores) with **WebID** identity and **WAC** (Web Access Control) for sharing. **LDP** (Linked Data Platform) is the W3C standard for HTTP read/write of linked data; Solid pods expose LDP. **Document-oriented data** means files, folders, and metadata (title, author, description) that users create and want to share with contacts or groups. **P2P** (peer-to-peer) here means ad hoc sharing without a central server—e.g. export/import, QR, messenger, or WebRTC—as a worst-case or complement to Solid.
6-
7-
For what the library *does not* provide today (no WAC, no “shared with me,” no built-in p2p transport), see [SHORTCOMINGS.md](SHORTCOMINGS.md).
5+
**Terms:** **Document-oriented data** = files, folders, and metadata (title, author, description). **P2P** = ad hoc sharing without a server (export/import, QR, messenger).
86

97
---
108

11-
## How this library helps document-sharing apps
9+
## What enables sharing
1210

13-
The library gives you a **consistent data model** and **portable data** that work across scenarios:
11+
The library's data model supports sharing scenarios (see [PRINCIPLES_AND_GOALS.md](PRINCIPLES_AND_GOALS.md) for why):
1412

15-
| What you get | Why it helps sharing |
16-
|--------------|----------------------|
17-
| **Personas** (identity) | “Who is the author?” and “Who is the current user?”—needed for attribution and for designating share targets. |
18-
| **Contacts** (address book) | “Who can I share with?” Contacts are natural share targets; you can later map them to WebIDs when syncing to a Solid pod. |
19-
| **Groups** (org/team/group + membership) |Share with a team” or “share with this list.” Membership (contacts + your personas) defines the audience. |
20-
| **Resources** (files/folders + metadata) | Documents live in the `resources` table with title, author, description, MIME type. Author can be a persona `@id`; same shape works locally and (after transform) on an LDP server. |
21-
| **Export/import** | `exportStore()` / import produce portable JSON. Users can send a document (or full pod snapshot) to someone else; the recipient can import into their own store. |
22-
| **Vocabularies** (FOAF, vCard, Dublin Core, Schema.org) | Data is interoperable; when you sync to a Solid pod or send JSON, other Solid-aware apps can understand it. |
13+
| Data | Sharing role |
14+
|------|--------------|
15+
| **Personas** | Author attribution; designating share targets by identity. |
16+
| **Contacts** | Natural recipients; map to WebIDs when syncing to a pod. |
17+
| **Groups** | "Share with team"; membership defines the audience. |
18+
| **Resources** | Documents with metadata; same shape locally and on LDP. |
19+
| **Export/import** | Portable JSON for ad hoc sharing. |
20+
| **Vocabularies** | Interoperable data (FOAF, vCard, etc.). |
2321

24-
What the library **does not** provide (see [SHORTCOMINGS.md](SHORTCOMINGS.md)): **WAC** (per-document “share with contact/group”), **shared with me** views, **resolvable document URLs** (until you sync to an LDP server), or a **p2p transport** (WebRTC, etc.). Your app can still use the data model and export/import to implement sharing flows that work today and align with Solid later.
22+
**Not provided:** WAC, "shared with me" views, resolvable URLs (until synced), p2p transport. See [SHORTCOMINGS.md](SHORTCOMINGS.md).
2523

2624
---
2725

@@ -116,7 +114,7 @@ What the library **does not** provide (see [SHORTCOMINGS.md](SHORTCOMINGS.md)):
116114

117115
## Related docs
118116

119-
- **[USE_CASES.md](USE_CASES.md)**How to access and manage users, groups, and documents in your app (store, components, factory functions).
120-
- **[SHORTCOMINGS.md](SHORTCOMINGS.md)**What the library does *not* provide for document sharing and collaboration (WAC, “shared with me,” p2p transport, etc.).
121-
- **[SOLID_SERVER_STRATEGIES.md](SOLID_SERVER_STRATEGIES.md)**How to add a persistent Solid server as a sync target so documents get URLs and can be shared via Solid.
122-
- **[README – Limitations](../README.md#limitations--where-it-falls-short)**High-level limitations (no LDP, single-user, no WAC, etc.).
117+
- **[PRINCIPLES_AND_GOALS.md](PRINCIPLES_AND_GOALS.md)**Core principles: local-first, data sovereignty, interoperability.
118+
- **[USE_CASES.md](USE_CASES.md)**How to access and manage users, groups, and documents.
119+
- **[SHORTCOMINGS.md](SHORTCOMINGS.md)**What the library does *not* provide.
120+
- **[SOLID_SERVER_STRATEGIES.md](SOLID_SERVER_STRATEGIES.md)**How to add a sync target for resolvable URLs.

docs/INTEGRATION_GUIDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Integration Guide
22

3-
This guide explains how to integrate **tb-solid-pod** into an application you are building. It is for developers who want to add Solid-style personas, contacts, groups, type indexes, or file metadata to their app, either by installing the package from GitHub or by copying source files.
3+
This guide explains *how* to integrate **tb-solid-pod** into your app. For *why* (principles, local-first, data sovereignty), see [PRINCIPLES_AND_GOALS.md](PRINCIPLES_AND_GOALS.md). For practical "how do I…" questions, see [USE_CASES.md](USE_CASES.md).
44

5-
**Terms:** **TinyBase** is the reactive store and persistence library used by this project. **JSON-LD** (JavaScript Object Notation for Linked Data) is the data format used for personas, contacts, and groups. **CLI** (command-line interface) refers to the terminal provided by the library: in-app (browser Terminal tab) or Node (`npm run cli`).
5+
**Terms:** **TinyBase** = reactive store + persistence. **JSON-LD** = data format for personas, contacts, groups. **CLI** = terminal (browser or Node).
66

77
## Two ways to integrate
88

0 commit comments

Comments
 (0)