oneie 2.0.3 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +220 -29
- package/LICENSE.md +84 -0
- package/README.md +489 -931
- package/folders.yaml +78 -17
- package/one/.obsidian/workspace.json +6 -6
- package/one/events/CASCADE-2-BACKEND-AGNOSTIC.md +412 -0
- package/one/events/FEATURE-2-4-COMPLETE.md +302 -0
- package/one/events/FEATURE_2_3_COMPLETE.md +575 -0
- package/one/events/GROUPS-MIGRATION.md +625 -0
- package/one/events/INSTALL-TESTS.md +293 -0
- package/one/events/INTEGRATION-ARCHITECTURE.md +561 -0
- package/one/events/INTEGRATION-CHECKLIST.md +1234 -0
- package/one/events/INTEGRATION-ORCHESTRATION.md +2623 -0
- package/one/events/INTEGRATION-SUMMARY.md +653 -0
- package/one/events/MIGRATION-REPORT.md +435 -0
- package/one/events/MIGRATION.md +69 -0
- package/one/events/README-archived.md +519 -0
- package/one/events/TEST-SUMMARY.md +393 -0
- package/one/events/TESTS-QUICK-REF.md +262 -0
- package/one/groups/groups.md +543 -0
- package/one/knowledge/CLOUDFLARE_ENV_SETUP.md +49 -0
- package/one/knowledge/architecture-any-backend.md +1366 -0
- package/one/knowledge/docs/flow.md +0 -0
- package/one/knowledge/ontology-documentation.md +18 -18
- package/one/knowledge/ontology.md +154 -143
- package/one/knowledge/ontology.md.backup +2822 -0
- package/one/knowledge/ontology.yaml +87 -87
- package/one/knowledge/provider-creation-guide.md +1064 -0
- package/one/knowledge/todo.md +251 -0
- package/one/license.md +84 -0
- package/one/things/CHECKLIST.md +356 -0
- package/one/things/ONE.md +510 -0
- package/one/things/{cli.md → cli/cli.md} +27 -4
- package/one/things/features/2-1-dataprovider-interface.md +2358 -0
- package/one/things/features/2-2-config-system.md +3075 -0
- package/one/things/features/2-3-effectts-services.md +1498 -0
- package/one/things/features/2-4-react-hooks.md +2120 -0
- package/one/things/features/2-5-auth-migration.md +2046 -0
- package/one/things/features/2-6-dashboard-migration.md +1985 -0
- package/one/things/features/2-7-alternative-providers.md +2505 -0
- package/one/things/features/2-7-implementation-report.md +680 -0
- package/one/things/features/2-cli.md +39 -39
- package/one/things/features/2-design.md +1738 -0
- package/one/things/features/2-tests.md +520 -0
- package/one/things/features/AUTH_HOOKS_IMPLEMENTATION.md +521 -0
- package/one/things/features/DECOUPLING.md +272 -0
- package/one/things/features/DEPLOYMENT.md +452 -0
- package/one/things/features/IMPLEMENTATION_SUMMARY.md +316 -0
- package/one/things/features/dataprovider-interface/1-tests.md +1522 -0
- package/one/things/features/improve.md +843 -0
- package/one/things/features/remove-convex-deps.md +45 -0
- package/one/things/features/top-features.md +79 -0
- package/one/things/ideas/2-backend-agnostic-frontend.md +384 -0
- package/one/things/plans/2-backend-agnostic-frontend.md +543 -0
- package/one/things/plans/3-groups.md +502 -0
- package/one/things/plans/backend-agnostic-frontend.md +323 -0
- package/one/things/plans/deploy-to-cloudflare.md +581 -0
- package/one/things/plans/organizations-to-groups.md +705 -0
- package/one/things/plans/release.md +432 -0
- package/one/things/products/ontology.md +1 -1
- package/one/things/system.md +600 -0
- package/one/things/tests/2-1-dataprovider-interface.md +1144 -0
- package/one/things/tests/2-1-test-analysis.md +496 -0
- package/one/things/vision/elegant-interface.md +214 -0
- package/package.json +1 -1
- package/one/organisation/organisation.md +0 -438
- package/one/repomix-output.md +0 -92634
- /package/one/{things → connections}/agentkit.md +0 -0
- /package/one/{things → connections}/copilotkit.md +0 -0
- /package/one/{organisation → groups}/one.md +0 -0
- /package/one/{organisation → groups}/revenue.md +0 -0
- /package/one/{organisation → groups}/strategy.md +0 -0
- /package/one/{organisation → groups}/vision.md +0 -0
- /package/one/things/{cli-code.md → cli/cli-code.md} +0 -0
- /package/one/things/{cli-compiler-code.md → cli/cli-compiler-code.md} +0 -0
|
@@ -0,0 +1,519 @@
|
|
|
1
|
+
# ONE
|
|
2
|
+
|
|
3
|
+
██████╗ ███╗ ██╗███████╗
|
|
4
|
+
██╔═══██╗████╗ ██║██╔════╝
|
|
5
|
+
██║ ██║██╔██╗ ██║█████╗
|
|
6
|
+
██║ ██║██║╚██╗██║██╔══╝
|
|
7
|
+
╚██████╔╝██║ ╚████║███████╗
|
|
8
|
+
╚═════╝ ╚═╝ ╚═══╝╚══════╝
|
|
9
|
+
|
|
10
|
+
Make Your Ideas Real
|
|
11
|
+
https://one.ie
|
|
12
|
+
type
|
|
13
|
+
npx oneie
|
|
14
|
+
/claude
|
|
15
|
+
/one
|
|
16
|
+
start
|
|
17
|
+
|
|
18
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
19
|
+
/now /next /todo /done /build /design /deploy /see
|
|
20
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
21
|
+
|
|
22
|
+
Build apps, websites and AI agents in English and deploy at the edge. Free! ██████╗ ███╗ ██╗███████╗
|
|
23
|
+
██╔═══██╗████╗ ██║██╔════╝
|
|
24
|
+
██║ ██║██╔██╗ ██║█████╗
|
|
25
|
+
██║ ██║██║╚██╗██║██╔══╝
|
|
26
|
+
╚██████╔╝██║ ╚████║███████╗
|
|
27
|
+
╚═════╝ ╚═╝ ╚═══╝╚══════╝
|
|
28
|
+
|
|
29
|
+
Make Your Ideas Real
|
|
30
|
+
https://one.ie
|
|
31
|
+
type
|
|
32
|
+
npx oneie
|
|
33
|
+
/claude
|
|
34
|
+
/one
|
|
35
|
+
start
|
|
36
|
+
|
|
37
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
38
|
+
/now /next /todo /done /build /design /deploy /see
|
|
39
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
40
|
+
|
|
41
|
+
Build apps, websites and AI agents in English and deploy at the edge. Free!
|
|
42
|
+
|
|
43
|
+
██████╗ ███╗ ██╗███████╗
|
|
44
|
+
██╔═══██╗████╗ ██║██╔════╝
|
|
45
|
+
██║ ██║██╔██╗ ██║█████╗
|
|
46
|
+
██║ ██║██║╚██╗██║██╔══╝
|
|
47
|
+
╚██████╔╝██║ ╚████║███████╗
|
|
48
|
+
╚═════╝ ╚═╝ ╚═══╝╚══════╝
|
|
49
|
+
|
|
50
|
+
Make Your Ideas Real
|
|
51
|
+
https://one.ie
|
|
52
|
+
type
|
|
53
|
+
npx oneie
|
|
54
|
+
/claude
|
|
55
|
+
/one
|
|
56
|
+
start
|
|
57
|
+
|
|
58
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
59
|
+
/now /next /todo /done /build /design /deploy /see
|
|
60
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
61
|
+
|
|
62
|
+
Build apps, websites and AI agents in English and deploy at the edge. Free!
|
|
63
|
+
|
|
64
|
+
# ONE Ontology
|
|
65
|
+
|
|
66
|
+
**6 Dimensions = Complete Reality Model:**
|
|
67
|
+
|
|
68
|
+
1. **Organizations** - Multi-tenant isolation (who owns what at org level)
|
|
69
|
+
2. **People** - Authorization & governance (who can do what)
|
|
70
|
+
3. **Things** - Entities (what exists)
|
|
71
|
+
4. **Connections** - Relationships (how they relate)
|
|
72
|
+
5. **Events** - Actions (what happened)
|
|
73
|
+
6. **Knowledge** - Intelligence (what it means)
|
|
74
|
+
|
|
75
|
+
**Why 6 Dimensions?**
|
|
76
|
+
|
|
77
|
+
Other platforms create tables for features, pollute schemas with temporary concepts, and end up with hundreds of entities nobody understands.
|
|
78
|
+
|
|
79
|
+
ONE models reality in six dimensions, and maps everything to them.
|
|
80
|
+
|
|
81
|
+
Simple enough for children. Powerful enough for enterprises.
|
|
82
|
+
|
|
83
|
+
## For Children
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
// Your lemonade stand = organization
|
|
87
|
+
// You = person (owner)
|
|
88
|
+
// Lemonade = thing
|
|
89
|
+
// Customer buys it = connection
|
|
90
|
+
// Sale happens = event
|
|
91
|
+
// AI learns = knowledge
|
|
92
|
+
|
|
93
|
+
// 1. Create your lemonade stand
|
|
94
|
+
const myStand = await createOrganization({
|
|
95
|
+
name: "Emma's Lemonade Stand",
|
|
96
|
+
owner: "Emma",
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
// 2. You are the owner!
|
|
100
|
+
const me = await createPerson({
|
|
101
|
+
name: "Emma",
|
|
102
|
+
role: "org_owner",
|
|
103
|
+
organizationId: myStand._id,
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
// 3. Create lemonade
|
|
107
|
+
const lemonade = await createThing({
|
|
108
|
+
type: "product",
|
|
109
|
+
name: "Fresh Lemonade",
|
|
110
|
+
organizationId: myStand._id,
|
|
111
|
+
properties: {
|
|
112
|
+
price: 1.0, // $1 per cup
|
|
113
|
+
inventory: 20, // 20 cups ready
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
// 4. Customer buys lemonade
|
|
118
|
+
const customer = await createPerson({
|
|
119
|
+
name: "Alex",
|
|
120
|
+
role: "customer",
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
await createConnection({
|
|
124
|
+
from: customer._id,
|
|
125
|
+
to: lemonade._id,
|
|
126
|
+
type: "purchased",
|
|
127
|
+
organizationId: myStand._id,
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
// 5. Log the sale
|
|
131
|
+
await createEvent({
|
|
132
|
+
type: "tokens_purchased",
|
|
133
|
+
actor: customer._id,
|
|
134
|
+
target: lemonade._id,
|
|
135
|
+
organizationId: myStand._id,
|
|
136
|
+
metadata: {
|
|
137
|
+
amount: 1.0,
|
|
138
|
+
weather: "sunny",
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
// 6. AI learns!
|
|
143
|
+
// The AI notices: sunny days = more sales
|
|
144
|
+
// Next sunny day, AI suggests: "Make more lemonade today!"
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**What the AI Learned:**
|
|
148
|
+
|
|
149
|
+
- Sunny days → more customers
|
|
150
|
+
- Sweet lemonade → happier customers (higher ratings)
|
|
151
|
+
- After school time (3pm-5pm) → busiest time
|
|
152
|
+
|
|
153
|
+
**Your AI can now help:**
|
|
154
|
+
|
|
155
|
+
- "It's going to be sunny tomorrow - prepare 30 cups instead of 20!"
|
|
156
|
+
- "Customer reviews say lemonade is too sour - add more sugar"
|
|
157
|
+
- "You're running low on lemons - order more before the weekend rush"
|
|
158
|
+
|
|
159
|
+
This is how the 6 dimensions work together to make your lemonade stand smart!
|
|
160
|
+
|
|
161
|
+
## For Enterprises
|
|
162
|
+
|
|
163
|
+
```typescript
|
|
164
|
+
// Multi-tenant SaaS = organizations (perfect isolation)
|
|
165
|
+
// Users & roles = people (authorization & governance)
|
|
166
|
+
// Domain entities = things (customers, products, agents)
|
|
167
|
+
// Business relationships = connections (ownership, permissions)
|
|
168
|
+
// Audit trail = events (who did what when)
|
|
169
|
+
// AI intelligence = knowledge (RAG, vectors, learning)
|
|
170
|
+
|
|
171
|
+
// 1. Customer signs up
|
|
172
|
+
const acmeCorp = await createOrganization({
|
|
173
|
+
name: "Acme Corporation",
|
|
174
|
+
plan: "enterprise",
|
|
175
|
+
limits: {
|
|
176
|
+
users: 100,
|
|
177
|
+
storage: 1000, // GB
|
|
178
|
+
apiCalls: 1000000,
|
|
179
|
+
inference: 500000,
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
// 2. Org owner gets admin access
|
|
184
|
+
const ceo = await createPerson({
|
|
185
|
+
name: "Jane CEO",
|
|
186
|
+
email: "jane@acme.com",
|
|
187
|
+
role: "org_owner",
|
|
188
|
+
organizationId: acmeCorp._id,
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
// 3. Create CRM entities
|
|
192
|
+
const salesAgent = await createThing({
|
|
193
|
+
type: "sales_agent",
|
|
194
|
+
name: "Acme Sales AI",
|
|
195
|
+
organizationId: acmeCorp._id,
|
|
196
|
+
properties: {
|
|
197
|
+
systemPrompt: "You are a friendly sales assistant...",
|
|
198
|
+
temperature: 0.7,
|
|
199
|
+
},
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
const lead = await createThing({
|
|
203
|
+
type: "lead",
|
|
204
|
+
name: "John Smith - Enterprise Lead",
|
|
205
|
+
organizationId: acmeCorp._id,
|
|
206
|
+
properties: {
|
|
207
|
+
email: "john@enterprise.com",
|
|
208
|
+
company: "Enterprise Inc",
|
|
209
|
+
budget: 100000,
|
|
210
|
+
status: "qualified",
|
|
211
|
+
},
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
// 4. AI agent follows up
|
|
215
|
+
await createConnection({
|
|
216
|
+
from: salesAgent._id,
|
|
217
|
+
to: lead._id,
|
|
218
|
+
type: "communicated",
|
|
219
|
+
organizationId: acmeCorp._id,
|
|
220
|
+
metadata: {
|
|
221
|
+
protocol: "email",
|
|
222
|
+
subject: "Following up on our conversation",
|
|
223
|
+
},
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
// 5. Log all interactions
|
|
227
|
+
await createEvent({
|
|
228
|
+
type: "communication_event",
|
|
229
|
+
actor: salesAgent._id,
|
|
230
|
+
target: lead._id,
|
|
231
|
+
organizationId: acmeCorp._id,
|
|
232
|
+
metadata: {
|
|
233
|
+
protocol: "email",
|
|
234
|
+
messageType: "follow_up",
|
|
235
|
+
sentiment: "positive",
|
|
236
|
+
},
|
|
237
|
+
timestamp: Date.now(),
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
// 6. AI learns from all sales interactions
|
|
241
|
+
const relevantContext = await queryKnowledge({
|
|
242
|
+
organizationId: acmeCorp._id,
|
|
243
|
+
query: "enterprise software objections pricing",
|
|
244
|
+
k: 10, // top 10 results
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
const aiResponse = await generateResponse({
|
|
248
|
+
context: relevantContext,
|
|
249
|
+
prompt: "Craft a response addressing pricing concerns",
|
|
250
|
+
});
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Multi-Tenancy:**
|
|
254
|
+
|
|
255
|
+
1. **Data Isolation** - Acme Corp cannot see Enterprise Inc's data
|
|
256
|
+
2. **Independent Scaling** - Each org has separate quotas and limits
|
|
257
|
+
3. **Customization** - Each org can customize their AI agents
|
|
258
|
+
4. **Platform Revenue** - Clear revenue attribution via events
|
|
259
|
+
|
|
260
|
+
## Documentation
|
|
261
|
+
|
|
262
|
+
**Start Here:**
|
|
263
|
+
|
|
264
|
+
- [6-Dimension Ontology](/one/knowledge/ontology.md) - Complete specification
|
|
265
|
+
- [Architecture](/one/knowledge/architecture.md) - How everything fits together
|
|
266
|
+
- [Frontend Guide](/one/things/frontend.md) - Building user interfaces
|
|
267
|
+
- [Backend Guide](/one/things/hono.md) - API and business logic
|
|
268
|
+
|
|
269
|
+
**Core Dimensions:**
|
|
270
|
+
|
|
271
|
+
- [Organizations](/one/connections/organisation.md) - Multi-tenant architecture
|
|
272
|
+
- [People](/one/connections/people.md) - Authorization & roles
|
|
273
|
+
- [Things](/one/connections/things.md) - 66 entity types
|
|
274
|
+
- [Connections](/one/connections/connections.md) - 25 relationship types
|
|
275
|
+
- [Events](/one/connections/events.md) - 67 event types
|
|
276
|
+
- [Knowledge](/one/connections/knowledge.md) - RAG & intelligence
|
|
277
|
+
|
|
278
|
+
**Learn by Example:**
|
|
279
|
+
|
|
280
|
+
- [Implementation Examples](/one/things/implementation-examples.md) - Real-world patterns
|
|
281
|
+
- [Workflow Guide](/one/connections/workflow.md) - Development workflow
|
|
282
|
+
- [API Documentation](/one/connections/api.md) - Complete API reference
|
|
283
|
+
|
|
284
|
+
## Quick Start
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
# 1. Clone the repository
|
|
288
|
+
git clone https://github.com/one-platform/one
|
|
289
|
+
cd ONE
|
|
290
|
+
|
|
291
|
+
# 2. Install dependencies (using pnpm)
|
|
292
|
+
pnpm install
|
|
293
|
+
|
|
294
|
+
# 3. Set up environment
|
|
295
|
+
cp .env.example .env
|
|
296
|
+
# Add your Convex URL and other keys
|
|
297
|
+
|
|
298
|
+
# 4. Run development server
|
|
299
|
+
pnpm dev
|
|
300
|
+
|
|
301
|
+
# 5. Build your first app!
|
|
302
|
+
# See examples in one/things/implementation-examples.md
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
## Technology Stack
|
|
306
|
+
|
|
307
|
+
**Frontend Layer:**
|
|
308
|
+
|
|
309
|
+
- **Astro 5.10+**: Lightning-fast static site generation with SSR
|
|
310
|
+
- **React 18**: Interactive components and islands architecture
|
|
311
|
+
- **TypeScript**: Full type safety throughout
|
|
312
|
+
- **Shadcn/UI**: Beautiful, accessible UI components
|
|
313
|
+
- **Tailwind CSS 4.1**: Utility-first styling
|
|
314
|
+
|
|
315
|
+
**Backend Layer:**
|
|
316
|
+
|
|
317
|
+
- **Hono**: REST API routes (Cloudflare Workers compatible)
|
|
318
|
+
- **Convex**: Real-time database with typed functions
|
|
319
|
+
- **Better Auth**: Authentication with Convex adapter
|
|
320
|
+
- **Effect.ts**: Functional error handling and dependency injection
|
|
321
|
+
|
|
322
|
+
**AI Layer:**
|
|
323
|
+
|
|
324
|
+
- **Vercel AI SDK**: Multi-provider AI integration
|
|
325
|
+
- **OpenAI**: GPT-4, GPT-3.5, and other models
|
|
326
|
+
- **Anthropic**: Claude 3.5 Sonnet, Claude 3 Haiku
|
|
327
|
+
- **OpenRouter**: Access to 100+ models
|
|
328
|
+
|
|
329
|
+
**Infrastructure:**
|
|
330
|
+
|
|
331
|
+
- **Cloudflare**: Edge computing and livestreaming
|
|
332
|
+
- **Stripe**: Payment processing (fiat only)
|
|
333
|
+
- **Multi-Chain**: Sui, Base, Solana (blockchain providers)
|
|
334
|
+
|
|
335
|
+
## The Philosophy
|
|
336
|
+
|
|
337
|
+
**Simplicity is the ultimate sophistication.**
|
|
338
|
+
|
|
339
|
+
This ontology proves that you don't need hundreds of tables or complex schemas to build a complete AI-native platform. You need:
|
|
340
|
+
|
|
341
|
+
1. **6 dimensions** (organizations, people, things, connections, events, knowledge)
|
|
342
|
+
2. **66 thing types** (every "thing")
|
|
343
|
+
3. **25 connection types** (every relationship)
|
|
344
|
+
4. **67 event types** (every action)
|
|
345
|
+
5. **Metadata** (for protocol identity via metadata.protocol)
|
|
346
|
+
|
|
347
|
+
That's it. Everything else is just data.
|
|
348
|
+
|
|
349
|
+
### Why This Works
|
|
350
|
+
|
|
351
|
+
**Other systems:**
|
|
352
|
+
|
|
353
|
+
- Create new tables for every feature
|
|
354
|
+
- Add protocol-specific columns
|
|
355
|
+
- Pollute schema with temporary concepts
|
|
356
|
+
- End up with 50+ tables, 200+ columns
|
|
357
|
+
- Become unmaintainable nightmares
|
|
358
|
+
|
|
359
|
+
**ONE's approach:**
|
|
360
|
+
|
|
361
|
+
- Map every feature to 6 dimensions
|
|
362
|
+
- Organizations partition the space
|
|
363
|
+
- People authorize and govern
|
|
364
|
+
- Things, connections, events flow from there
|
|
365
|
+
- Knowledge understands it all
|
|
366
|
+
- Scale infinitely without schema changes
|
|
367
|
+
- Stay simple, clean, beautiful
|
|
368
|
+
|
|
369
|
+
### The Result
|
|
370
|
+
|
|
371
|
+
A database schema that:
|
|
372
|
+
|
|
373
|
+
- Scales from lemonade stands to global enterprises
|
|
374
|
+
- Children can understand: "I own (org), I'm the boss (person), I sell lemonade (things)"
|
|
375
|
+
- Enterprises can rely on: Multi-tenant isolation, clear governance, infinite scale
|
|
376
|
+
- AI agents can reason about completely
|
|
377
|
+
- Never needs breaking changes
|
|
378
|
+
- Grows more powerful as it grows larger
|
|
379
|
+
|
|
380
|
+
**This is what happens when you design for clarity first.**
|
|
381
|
+
|
|
382
|
+
## Project Structure
|
|
383
|
+
|
|
384
|
+
```
|
|
385
|
+
ONE/
|
|
386
|
+
├── apps/
|
|
387
|
+
│ ├── oneie/ # Main Astro application
|
|
388
|
+
│ ├── stack/ # Stack Auth integration
|
|
389
|
+
│ └── eliza/ # Eliza AI agent
|
|
390
|
+
├── one/ # Core documentation
|
|
391
|
+
│ ├── connections/ # Ontology & relationships
|
|
392
|
+
│ ├── things/ # Architecture & patterns
|
|
393
|
+
│ ├── events/ # Event specifications
|
|
394
|
+
│ └── knowledge/ # RAG & intelligence
|
|
395
|
+
├── frontend/ # React components & UI
|
|
396
|
+
├── convex/ # Convex database functions
|
|
397
|
+
└── README.md # This file
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
## Applications
|
|
401
|
+
|
|
402
|
+
### ONE IE (apps/oneie)
|
|
403
|
+
|
|
404
|
+
Modern Astro-based AI-powered web application with:
|
|
405
|
+
|
|
406
|
+
- AI chat interfaces with multiple providers
|
|
407
|
+
- Professional book generation (EPUB/PDF)
|
|
408
|
+
- Comprehensive content management
|
|
409
|
+
- Real-time streaming responses
|
|
410
|
+
|
|
411
|
+
See [apps/oneie/README.md](/apps/oneie/README.md) for details.
|
|
412
|
+
|
|
413
|
+
## Development
|
|
414
|
+
|
|
415
|
+
### Prerequisites
|
|
416
|
+
|
|
417
|
+
- Node.js 20 or higher
|
|
418
|
+
- pnpm package manager (`npm install -g pnpm`)
|
|
419
|
+
- Pandoc (for book generation): `brew install pandoc` (macOS)
|
|
420
|
+
|
|
421
|
+
### Commands
|
|
422
|
+
|
|
423
|
+
```bash
|
|
424
|
+
# Start development server
|
|
425
|
+
pnpm dev
|
|
426
|
+
|
|
427
|
+
# Build for production
|
|
428
|
+
pnpm build
|
|
429
|
+
|
|
430
|
+
# Run tests
|
|
431
|
+
pnpm test
|
|
432
|
+
|
|
433
|
+
# Run auth tests (frontend)
|
|
434
|
+
cd frontend && bun test test/auth
|
|
435
|
+
|
|
436
|
+
# Type checking
|
|
437
|
+
pnpm astro check
|
|
438
|
+
|
|
439
|
+
# Generate EPUB book
|
|
440
|
+
pnpm generate:epub
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
## Testing
|
|
444
|
+
|
|
445
|
+
### Authentication System Tests
|
|
446
|
+
|
|
447
|
+
Comprehensive test suite for the auth system at `/frontend/test/auth/`:
|
|
448
|
+
|
|
449
|
+
**6 Authentication Methods Tested:**
|
|
450
|
+
|
|
451
|
+
1. ✅ Email & Password (signup, signin, validation)
|
|
452
|
+
2. ✅ OAuth (GitHub, Google, account linking)
|
|
453
|
+
3. ✅ Magic Links (passwordless, one-time use)
|
|
454
|
+
4. ✅ Password Reset (secure recovery, token expiry)
|
|
455
|
+
5. ✅ Email Verification (24-hour expiry)
|
|
456
|
+
6. ✅ 2FA (TOTP, backup codes, enable/disable)
|
|
457
|
+
|
|
458
|
+
**Run Auth Tests:**
|
|
459
|
+
|
|
460
|
+
```bash
|
|
461
|
+
cd frontend
|
|
462
|
+
|
|
463
|
+
# Run all auth tests
|
|
464
|
+
bun test test/auth
|
|
465
|
+
|
|
466
|
+
# Run specific test
|
|
467
|
+
bun test test/auth/email-password.test.ts
|
|
468
|
+
|
|
469
|
+
# Watch mode
|
|
470
|
+
bun test --watch test/auth
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
**Backend Connection:**
|
|
474
|
+
|
|
475
|
+
- Frontend: `http://localhost:4321`
|
|
476
|
+
- Backend: `https://shocking-falcon-870.convex.cloud`
|
|
477
|
+
- Tests verify frontend → backend auth flows
|
|
478
|
+
|
|
479
|
+
**Test Coverage:**
|
|
480
|
+
|
|
481
|
+
- 50+ test cases across 7 files
|
|
482
|
+
- Security features (rate limiting, token expiry, session management)
|
|
483
|
+
- OAuth provider integration
|
|
484
|
+
- Email delivery (via Resend)
|
|
485
|
+
- Complete auth flow validation
|
|
486
|
+
|
|
487
|
+
See `/frontend/test/auth/README.md` for detailed documentation.
|
|
488
|
+
|
|
489
|
+
## Security & Compliance
|
|
490
|
+
|
|
491
|
+
- **Multi-Tenant Isolation**: Organizations partition ALL data
|
|
492
|
+
- **Role-Based Access Control**: Platform owner, org owners, org users, customers
|
|
493
|
+
- **Audit Trail**: Events table provides complete history
|
|
494
|
+
- **GDPR Compliance**: Delete all org data with single organizationId filter
|
|
495
|
+
- **Encryption**: Org-scoped encryption keys for sensitive data
|
|
496
|
+
|
|
497
|
+
## Contributing
|
|
498
|
+
|
|
499
|
+
1. Fork the repository
|
|
500
|
+
2. Create a feature branch
|
|
501
|
+
3. Map your feature to the 6 dimensions
|
|
502
|
+
4. Add tests if applicable
|
|
503
|
+
5. Submit a pull request
|
|
504
|
+
|
|
505
|
+
**Golden Rule:** If you can't map your feature to these 6 dimensions, you're thinking about it wrong.
|
|
506
|
+
|
|
507
|
+
## License
|
|
508
|
+
|
|
509
|
+
MIT License - see LICENSE file for details.
|
|
510
|
+
|
|
511
|
+
---
|
|
512
|
+
|
|
513
|
+
**ONE Platform** - Where reality meets AI.
|
|
514
|
+
|
|
515
|
+
Built with simplicity, clarity, and infinite scale in mind.
|
|
516
|
+
|
|
517
|
+
Organizations partition. People authorize. Things exist. Connections relate. Events record. Knowledge understands.
|
|
518
|
+
|
|
519
|
+
**Everything else is just data.**
|