|
1 | | -# @objectstack/spec |
| 1 | +# ObjectStack Protocol |
2 | 2 |
|
| 3 | + |
3 | 4 | [](https://www.typescriptlang.org/) |
4 | 5 | [](https://opensource.org/licenses/MIT) |
5 | 6 |
|
6 | | -> ObjectStack Protocol & Specification - The Constitution of the ObjectStack Ecosystem |
| 7 | +> **The "Constitution" of the Post-SaaS Operating System.** |
7 | 8 |
|
8 | | -## 📜 Overview |
| 9 | +This repository contains the core specifications, schemas, and protocols that power the ObjectStack ecosystem. It defines how data, UI, and system configurations are expressed as code. |
9 | 10 |
|
10 | | -This monorepo contains the **core interfaces, schemas, and conventions** for the ObjectStack ecosystem. It serves as the "Constitution" - the shared language that ObjectOS, ObjectStudio, ObjectCloud, and all third-party plugins use to communicate. |
| 11 | +## 📚 Documentation |
11 | 12 |
|
12 | | -**Guiding Principle:** *"Strict Types, No Logic"* |
| 13 | +The official documentation is co-located in this repository. |
13 | 14 |
|
14 | | -## 📦 Packages |
| 15 | +* **[Concepts](./content/docs/concepts/):** Architecture, Manifesto, and Core Values. |
| 16 | +* **[Specifications](./packages/spec/json-schema/):** Auto-generated JSON Schemas. |
| 17 | +* **[API Reference](./content/docs/references/):** Detailed property references generated from code. |
15 | 18 |
|
16 | | -This repository is organized as a monorepo with the following packages: |
| 19 | +## 📦 Monorepo Structure |
17 | 20 |
|
18 | | -### Core Packages |
| 21 | +| Package | Description | Status | |
| 22 | +| :--- | :--- | :--- | |
| 23 | +| **[`@objectstack/spec`](packages/spec)** | **THE PROTOCOL**. Contains all Zod definitions, Types, and JSON Schemas. | 🟢 **Active** | |
| 24 | +| `content/docs` | The documentation site source. | 🟢 **Active** | |
| 25 | +| *Other packages* | *Legacy/Migration in progress* | 🟡 *Legacy* | |
19 | 26 |
|
20 | | -- **[@objectstack/spec](./packages/spec)** - Main package that re-exports everything (use this for convenience) |
21 | | -- **[@objectstack/spec-meta](./packages/meta)** - Metamodel type definitions (ObjectEntity, ObjectField, ObjectView) |
22 | | -- **[@objectstack/spec-plugin](./packages/plugin)** - Plugin runtime interfaces (ObjectStackPlugin, PluginContext) |
23 | | -- **[@objectstack/spec-schemas](./packages/schemas)** - Zod validation schemas (ManifestSchema, MenuItemSchema) |
24 | | -- **[@objectstack/spec-constants](./packages/constants)** - Convention constants (PKG_CONVENTIONS) |
| 27 | +## 🛠️ The Protocol Architecture |
25 | 28 |
|
26 | | -## 🚀 Installation |
| 29 | +The ObjectStack Protocol (`@objectstack/spec`) is divided into three layers: |
27 | 30 |
|
28 | | -### Install the main package (recommended) |
| 31 | +### 1. Data Protocol (ObjectQL) |
| 32 | +Defines the "Shape of Data". |
| 33 | +- **Schema:** Objects, Fields, Validation. |
| 34 | +- **Logic:** Formulas, Rollups. |
| 35 | +- **Security:** Permissions, Sharing Rules. |
| 36 | +- **Query:** Abstract Syntax Tree (AST) for unified data access. |
29 | 37 |
|
30 | | -```bash |
31 | | -pnpm install @objectstack/spec |
32 | | -``` |
33 | | - |
34 | | -### Install individual packages (for smaller bundle sizes) |
35 | | - |
36 | | -```bash |
37 | | -pnpm install @objectstack/spec-meta |
38 | | -pnpm install @objectstack/spec-plugin |
39 | | -pnpm install @objectstack/spec-schemas |
40 | | -pnpm install @objectstack/spec-constants |
41 | | -``` |
| 38 | +### 2. UI Protocol (ObjectUI) |
| 39 | +Defines the "Shape of Interaction". |
| 40 | +- **Views:** Grids, Kanbans, Calendars. |
| 41 | +- **Pages:** FlexiPage layouts (Regions & Components). |
| 42 | +- **Navigation:** Apps, Menus. |
| 43 | +- **Analytics:** Reports, Dashboards. |
42 | 44 |
|
43 | | -## 📚 Usage |
| 45 | +### 3. System Protocol (ObjectOS) |
| 46 | +Defines the "Runtime Environment". |
| 47 | +- **Manifest:** Application packaging (`objectstack.config.ts`). |
| 48 | +- **Identity:** Auth, Roles, Territories. |
| 49 | +- **Integration:** Webhooks, ETL Mappings. |
44 | 50 |
|
45 | | -### Using the main package |
| 51 | +## 🚀 Development |
46 | 52 |
|
47 | | -```typescript |
48 | | -import { |
49 | | - ObjectEntity, |
50 | | - ObjectStackPlugin, |
51 | | - ManifestSchema, |
52 | | - PKG_CONVENTIONS |
53 | | -} from '@objectstack/spec'; |
54 | | -``` |
55 | | - |
56 | | -### Using individual packages |
| 53 | +This project uses **PNPM** workspaces. |
57 | 54 |
|
58 | | -```typescript |
59 | | -import { ObjectEntity } from '@objectstack/spec-meta'; |
60 | | -import { ObjectStackPlugin } from '@objectstack/spec-plugin'; |
61 | | -import { ManifestSchema } from '@objectstack/spec-schemas'; |
62 | | -import { PKG_CONVENTIONS } from '@objectstack/spec-constants'; |
63 | | -``` |
| 55 | +### Prerequisites |
| 56 | +- Node.js >= 18 |
| 57 | +- PNPM >= 8 |
64 | 58 |
|
65 | | -## 🏗️ Development |
| 59 | +### Quick Start |
66 | 60 |
|
67 | 61 | ```bash |
68 | | -# Install dependencies |
| 62 | +# 1. Install dependencies |
69 | 63 | pnpm install |
70 | 64 |
|
71 | | -# Build all packages |
72 | | -pnpm run build |
| 65 | +# 2. Build the Protocol (Generates Schemas & Docs) |
| 66 | +pnpm --filter @objectstack/spec build |
| 67 | +# Output: |
| 68 | +# - packages/spec/dist/ (Compiled TS) |
| 69 | +# - packages/spec/json-schema/ (JSON Schemas) |
| 70 | +# - content/docs/references/ (Markdown Docs) |
73 | 71 |
|
74 | | -# Watch mode for development (all packages) |
75 | | -pnpm run dev |
76 | | - |
77 | | -# Clean build artifacts |
78 | | -pnpm run clean |
| 72 | +# 3. Start Documentation Site (Optional) |
| 73 | +# (Assuming a doc site runner is configured) |
| 74 | +pnpm dev |
79 | 75 | ``` |
80 | 76 |
|
81 | | -### Building Individual Packages |
| 77 | +## 🤝 Contribution |
82 | 78 |
|
83 | | -```bash |
84 | | -# Build a specific package |
85 | | -cd packages/meta && pnpm run build |
86 | | -``` |
| 79 | +1. **Code First**: Always start by defining the Zod Schema in `packages/spec/src`. |
| 80 | +2. **Generate**: Run `pnpm build` to update JSON Schemas and Documentation. |
| 81 | +3. **Commit**: Submit PR with updated Code + Schemas + Docs. |
87 | 82 |
|
88 | 83 | ## 📄 License |
89 | 84 |
|
90 | | -MIT |
| 85 | +MIT © ObjectStack |
0 commit comments