oneie 3.6.4 → 3.6.6
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/commands/one copy.md +565 -0
- package/.claude/hooks/README-knowledge-hooks.md +265 -0
- package/.claude/hooks/__pycache__/knowledge-post.cpython-313.pyc +0 -0
- package/.claude/hooks/__pycache__/knowledge-pre.cpython-313.pyc +0 -0
- package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
- package/.claude/hooks/check-filenames.py +40 -0
- package/.claude/hooks/clean-post.py +301 -0
- package/.claude/hooks/clean-pre.py +308 -0
- package/.claude/hooks/done.py +175 -0
- package/.claude/hooks/format-hook.sh +75 -0
- package/.claude/hooks/hook-logger.sh +59 -0
- package/.claude/hooks/knowledge-post.py +251 -0
- package/.claude/hooks/knowledge-pre.py +150 -0
- package/.claude/hooks/notification-hook.sh +112 -0
- package/.claude/hooks/security-hook.sh +157 -0
- package/.claude/hooks/tag-all-docs.py +338 -0
- package/.claude/hooks/todo.py +298 -0
- package/.claude/hooks/validate-ontology-structure.py +455 -0
- package/.claude/skills/astro/add-content-collection.md +30 -0
- package/.claude/skills/astro/check-build.md +29 -0
- package/.claude/skills/astro/create-component.md +29 -0
- package/.claude/skills/astro/create-page.md +30 -0
- package/.claude/skills/astro/optimize-performance.md +21 -0
- package/.claude/skills/convex/check-deployment.md +46 -0
- package/.claude/skills/convex/create-mutation.md +405 -0
- package/.claude/skills/convex/create-query.md +52 -0
- package/.claude/skills/convex/read-schema.md +373 -0
- package/.claude/skills/convex/test-function.md +50 -0
- package/.claude/skills/deployment/check-deployment-health.md +20 -0
- package/.claude/skills/deployment/create-release.md +21 -0
- package/.claude/skills/deployment/deploy-cloudflare.md +31 -0
- package/.claude/skills/deployment/deploy-convex.md +30 -0
- package/.claude/skills/deployment/sync-repositories.md +19 -0
- package/.claude/skills/design/check-accessibility.md +21 -0
- package/.claude/skills/design/create-component-spec.md +27 -0
- package/.claude/skills/design/generate-design-tokens.md +24 -0
- package/.claude/skills/design/generate-wireframe.md +30 -0
- package/.claude/skills/documentation/create-migration-guide.md +20 -0
- package/.claude/skills/documentation/generate-api-docs.md +27 -0
- package/.claude/skills/documentation/generate-readme.md +22 -0
- package/.claude/skills/documentation/update-knowledge.md +20 -0
- package/.claude/skills/integration/connect-external-system.md +21 -0
- package/.claude/skills/integration/implement-a2a.md +20 -0
- package/.claude/skills/integration/implement-acp.md +20 -0
- package/.claude/skills/integration/verify-integration.md +20 -0
- package/.claude/skills/ontology/README.md +255 -0
- package/.claude/skills/ontology/check-dimension.md +307 -0
- package/.claude/skills/ontology/generate-entity-type.md +339 -0
- package/.claude/skills/ontology/validate-schema.md +229 -0
- package/.claude/skills/ontology/verify-relationships.md +310 -0
- package/.claude/skills/problem-solving/analyze-test-failure.md +21 -0
- package/.claude/skills/problem-solving/identify-root-cause.md +20 -0
- package/.claude/skills/problem-solving/propose-solution.md +29 -0
- package/.claude/skills/problem-solving/verify-fix.md +21 -0
- package/.claude/skills/sales/generate-demo-script.md +21 -0
- package/.claude/skills/sales/qualify-lead.md +30 -0
- package/.claude/skills/sales/track-trial.md +20 -0
- package/.claude/skills/sales/verify-kyc.md +20 -0
- package/.claude/skills/testing/analyze-coverage.md +24 -0
- package/.claude/skills/testing/generate-tests.md +24 -0
- package/.claude/skills/testing/run-tests.md +27 -0
- package/.claude/skills/testing/validate-e2e.md +25 -0
- package/.mcp.json +30 -3
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +13 -6
- package/dist/commands/init.js.map +1 -1
- package/dist/utils/installation-setup.d.ts.map +1 -1
- package/dist/utils/installation-setup.js +9 -0
- package/dist/utils/installation-setup.js.map +1 -1
- package/dist/utils/launch-claude.d.ts +3 -2
- package/dist/utils/launch-claude.d.ts.map +1 -1
- package/dist/utils/launch-claude.js +64 -29
- package/dist/utils/launch-claude.js.map +1 -1
- package/one/.obsidian/workspace.json +22 -22
- package/one/events/CREATE-WEBSITE.md +442 -0
- package/one/events/CUSTOM-DOMAIN.md +357 -0
- package/one/events/DEPLOYMENT copy.md +426 -0
- package/one/events/ECOMMERCE-BEFORE-AFTER.md +251 -0
- package/one/events/ECOMMERCE-ENHANCEMENTS.md +576 -0
- package/one/events/ECOMMERCE-HIGH-CONVERTING-ELEMENTS.md +421 -0
- package/one/events/ECOMMERCE-REFACTOR-SUMMARY.md +196 -0
- package/one/events/ECOMMERCE-SETUP-SUMMARY.md +396 -0
- package/one/events/INSTALLATION_FOLDERS.md +516 -0
- package/one/events/INSTALLATION_FOLDERS_FILES.md +205 -0
- package/one/events/INSTALLATION_FOLDERS_SUMMARY.md +419 -0
- package/one/events/LICENSE.md +89 -0
- package/one/events/MCP-CONFIGURATION.md +336 -0
- package/one/events/MCP-SETUP-COMPLETE.md +205 -0
- package/one/events/NODE-UPGRADE.md +111 -0
- package/one/events/PACKAGE-STRUCTURE.md +310 -0
- package/one/events/PLAYBOOK-SETUP-SUMMARY.md +331 -0
- package/one/events/PROMPT_FIX_FRONTEND_ONLY.md +567 -0
- package/one/events/SIMPLE_FIX_FRONTEND_ONLY.md +262 -0
- package/one/events/STRIPE-INTEGRATION.md +414 -0
- package/one/events/STRIPE-SETUP-GUIDE.md +462 -0
- package/one/events/TRANSPARENCY-FIXES.md +275 -0
- package/package.json +4 -2
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
# ONE Platform Package Structure
|
|
2
|
+
|
|
3
|
+
**Version:** 3.6.0
|
|
4
|
+
**Date:** 2025-01-22
|
|
5
|
+
|
|
6
|
+
## Three Distribution Methods
|
|
7
|
+
|
|
8
|
+
### 1. CLI Package (npm: `oneie`)
|
|
9
|
+
|
|
10
|
+
**Purpose:** Initialization tool for creating installation folders
|
|
11
|
+
|
|
12
|
+
**What's Included:**
|
|
13
|
+
```
|
|
14
|
+
oneie@3.6.0 (2.8 MB, 653 files)
|
|
15
|
+
├── dist/ # Compiled TypeScript
|
|
16
|
+
├── one/ # Ontology documentation (41 files)
|
|
17
|
+
│ ├── connections/
|
|
18
|
+
│ ├── events/
|
|
19
|
+
│ ├── groups/
|
|
20
|
+
│ ├── knowledge/
|
|
21
|
+
│ ├── people/
|
|
22
|
+
│ └── things/
|
|
23
|
+
├── .claude/
|
|
24
|
+
│ ├── agents/ # AI agent definitions
|
|
25
|
+
│ └── commands/ # Slash commands
|
|
26
|
+
├── README.md # Platform overview ✓
|
|
27
|
+
├── LICENSE.md # Free license ✓
|
|
28
|
+
├── SECURITY.md # Security policy ✓
|
|
29
|
+
├── TESTING-ONBOARDING.md # Test guide ✓
|
|
30
|
+
├── .mcp.json # MCP servers ✓
|
|
31
|
+
├── CLAUDE.md # Claude instructions
|
|
32
|
+
├── AGENTS.md # Agent coordination
|
|
33
|
+
└── folders.yaml # Folder configuration
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Install:**
|
|
37
|
+
```bash
|
|
38
|
+
npx oneie
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**What's NOT Included:**
|
|
42
|
+
- `/web` source code (too large, 50+ MB)
|
|
43
|
+
- `/backend` source code (separate repo)
|
|
44
|
+
- `/apps` examples (separate repos)
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
### 2. Web Repository (github.com/one-ie/web)
|
|
49
|
+
|
|
50
|
+
**Purpose:** Full Astro + React 19 website source code
|
|
51
|
+
|
|
52
|
+
**What's Included:**
|
|
53
|
+
```
|
|
54
|
+
web/
|
|
55
|
+
├── src/
|
|
56
|
+
│ ├── components/ # React components + shadcn/ui
|
|
57
|
+
│ ├── pages/ # Astro pages
|
|
58
|
+
│ ├── layouts/ # Page layouts
|
|
59
|
+
│ ├── content/ # Blog posts
|
|
60
|
+
│ └── styles/ # Tailwind CSS
|
|
61
|
+
├── dist/ # Built site (after bun run build)
|
|
62
|
+
├── astro.config.mjs # Astro configuration
|
|
63
|
+
├── wrangler.toml # Cloudflare Pages config
|
|
64
|
+
├── wrangler.toml.example # Customer template ✓
|
|
65
|
+
├── package.json
|
|
66
|
+
└── AGENTS.md
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Clone:**
|
|
70
|
+
```bash
|
|
71
|
+
git clone https://github.com/one-ie/web.git
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Or sync via release script:**
|
|
75
|
+
```bash
|
|
76
|
+
./scripts/release.sh patch
|
|
77
|
+
# Syncs web/ → apps/one/web/
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
### 3. Assembly Repository (github.com/one-ie/one)
|
|
83
|
+
|
|
84
|
+
**Purpose:** Complete platform with all components
|
|
85
|
+
|
|
86
|
+
**What's Included:**
|
|
87
|
+
```
|
|
88
|
+
one/
|
|
89
|
+
├── one/ # Ontology docs (from root)
|
|
90
|
+
├── web/ # Full web app (synced)
|
|
91
|
+
├── .claude/ # AI configuration (synced)
|
|
92
|
+
├── README.md # Combined docs
|
|
93
|
+
├── CLAUDE.md
|
|
94
|
+
├── AGENTS.md
|
|
95
|
+
├── LICENSE.md
|
|
96
|
+
├── SECURITY.md
|
|
97
|
+
└── TESTING-ONBOARDING.md
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Clone:**
|
|
101
|
+
```bash
|
|
102
|
+
git clone https://github.com/one-ie/one.git
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## What Goes Where (Release Process)
|
|
108
|
+
|
|
109
|
+
### From Root → CLI
|
|
110
|
+
|
|
111
|
+
**Files synced:**
|
|
112
|
+
```bash
|
|
113
|
+
/one/ → cli/one/
|
|
114
|
+
/.claude/ → cli/.claude/
|
|
115
|
+
/README.md → cli/README.md
|
|
116
|
+
/LICENSE.md → cli/LICENSE.md
|
|
117
|
+
/SECURITY.md → cli/SECURITY.md
|
|
118
|
+
/CLAUDE.md → cli/CLAUDE.md
|
|
119
|
+
/.mcp.json → cli/.mcp.json
|
|
120
|
+
/TESTING-ONBOARDING.md → cli/TESTING-ONBOARDING.md
|
|
121
|
+
/web/AGENTS.md → cli/AGENTS.md
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Published to npm:** All of the above (package.json `files` array)
|
|
125
|
+
|
|
126
|
+
### From Root → apps/one (Assembly)
|
|
127
|
+
|
|
128
|
+
**Files synced:**
|
|
129
|
+
```bash
|
|
130
|
+
/one/ → apps/one/one/
|
|
131
|
+
/web/ → apps/one/web/ (full rsync)
|
|
132
|
+
/.claude/ → apps/one/one/.claude/
|
|
133
|
+
/README.md → apps/one/README.md
|
|
134
|
+
/LICENSE.md → apps/one/one/LICENSE.md
|
|
135
|
+
/SECURITY.md → apps/one/one/SECURITY.md
|
|
136
|
+
/CLAUDE.md → apps/one/one/CLAUDE.md
|
|
137
|
+
/.mcp.json → apps/one/one/.mcp.json
|
|
138
|
+
/TESTING-ONBOARDING.md → apps/one/one/TESTING-ONBOARDING.md
|
|
139
|
+
/web/AGENTS.md → apps/one/one/AGENTS.md
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Pushed to GitHub:** All of the above
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Package Sizes
|
|
147
|
+
|
|
148
|
+
| Package | Size (Compressed) | Size (Unpacked) | Files |
|
|
149
|
+
|---------|-------------------|-----------------|-------|
|
|
150
|
+
| **CLI (npm)** | 2.8 MB | 11.4 MB | 653 |
|
|
151
|
+
| **Web (git)** | ~15 MB | ~50 MB | 1000+ |
|
|
152
|
+
| **Assembly (git)** | ~20 MB | ~65 MB | 1700+ |
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## User Journeys
|
|
157
|
+
|
|
158
|
+
### Journey 1: Quick Start (CLI Only)
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# Install CLI
|
|
162
|
+
npx oneie
|
|
163
|
+
|
|
164
|
+
# Creates installation folder
|
|
165
|
+
# User gets: one/, .claude/, docs
|
|
166
|
+
# Total: 11.4 MB
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Perfect for:** Users who just want to create installation folders
|
|
170
|
+
|
|
171
|
+
### Journey 2: Full Platform (Clone Assembly)
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
# Clone complete platform
|
|
175
|
+
git clone https://github.com/one-ie/one.git
|
|
176
|
+
|
|
177
|
+
# User gets: one/, web/, .claude/, docs
|
|
178
|
+
# Total: ~65 MB
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**Perfect for:** Users who want everything ready to go
|
|
182
|
+
|
|
183
|
+
### Journey 3: Web Development (Clone Web)
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Clone just web app
|
|
187
|
+
git clone https://github.com/one-ie/web.git
|
|
188
|
+
|
|
189
|
+
# User gets: Full Astro + React site
|
|
190
|
+
# Total: ~50 MB
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
**Perfect for:** Users building websites only
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Why /web is NOT in CLI Package
|
|
198
|
+
|
|
199
|
+
**Reasons:**
|
|
200
|
+
1. **Size:** Web is 50+ MB, would make CLI package too large
|
|
201
|
+
2. **Use case:** CLI is for initialization, not development
|
|
202
|
+
3. **Updates:** Web changes frequently, CLI changes rarely
|
|
203
|
+
4. **Flexibility:** Users can use different frontend frameworks
|
|
204
|
+
|
|
205
|
+
**How users get /web:**
|
|
206
|
+
- Clone from github.com/one-ie/web
|
|
207
|
+
- Clone assembly repo (github.com/one-ie/one)
|
|
208
|
+
- Sync via release script
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Verification
|
|
213
|
+
|
|
214
|
+
### Check what's in CLI package:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
cd cli
|
|
218
|
+
npm pack --dry-run | grep -E "README|LICENSE|SECURITY|TESTING|\.mcp"
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**Expected output:**
|
|
222
|
+
```
|
|
223
|
+
.mcp.json ✓
|
|
224
|
+
LICENSE.md ✓
|
|
225
|
+
README.md ✓
|
|
226
|
+
SECURITY.md ✓
|
|
227
|
+
TESTING-ONBOARDING.md ✓
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Check what's in Assembly repo:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
ls -la apps/one/
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
**Expected:**
|
|
237
|
+
```
|
|
238
|
+
one/ ✓ (ontology docs)
|
|
239
|
+
web/ ✓ (full web app)
|
|
240
|
+
README.md ✓
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Release Process
|
|
246
|
+
|
|
247
|
+
### Step 1: Sync Files
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
./scripts/release.sh minor
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Syncs:**
|
|
254
|
+
- Root → cli/ (for npm)
|
|
255
|
+
- Root → apps/one/ (for github)
|
|
256
|
+
- web/ → apps/one/web/ (full rsync)
|
|
257
|
+
|
|
258
|
+
### Step 2: Publish CLI
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
cd cli
|
|
262
|
+
npm publish --access public
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
**Result:** `oneie@3.6.0` on npm with all docs
|
|
266
|
+
|
|
267
|
+
### Step 3: Push Assembly
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
cd apps/one
|
|
271
|
+
git push origin main
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
**Result:** Complete platform on github
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## Customer Experience
|
|
279
|
+
|
|
280
|
+
### What customers get from `npx oneie`:
|
|
281
|
+
|
|
282
|
+
1. **CLI tool** (2.8 MB)
|
|
283
|
+
- ✓ Ontology docs (one/)
|
|
284
|
+
- ✓ AI agents (.claude/)
|
|
285
|
+
- ✓ Core documentation
|
|
286
|
+
- ✓ MCP configuration
|
|
287
|
+
- ✗ Web source (they clone separately)
|
|
288
|
+
|
|
289
|
+
2. **Installation folder created:**
|
|
290
|
+
- /<org-name>/knowledge/
|
|
291
|
+
- /<org-name>/groups/
|
|
292
|
+
- .env.local with ORG_NAME, ORG_WEBSITE, etc.
|
|
293
|
+
|
|
294
|
+
3. **Next steps:**
|
|
295
|
+
- Clone web: `git clone https://github.com/one-ie/web.git`
|
|
296
|
+
- Or use assembly: `git clone https://github.com/one-ie/one.git`
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## Summary
|
|
301
|
+
|
|
302
|
+
✅ **CLI package** = Initialization tool (2.8 MB, all docs included)
|
|
303
|
+
✅ **Web repo** = Full website source (separate clone)
|
|
304
|
+
✅ **Assembly repo** = Everything together (one/, web/, .claude/)
|
|
305
|
+
|
|
306
|
+
**All core documentation** (README, LICENSE, SECURITY, TESTING-ONBOARDING, .mcp.json) **is now included in CLI package v3.6.0!**
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
**Status:** ✅ Package structure perfected for v3.6.0
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
# Playbook Stripe Integration - Setup Summary
|
|
2
|
+
|
|
3
|
+
Complete summary of the playbook product integration with Stripe.
|
|
4
|
+
|
|
5
|
+
## What Was Created
|
|
6
|
+
|
|
7
|
+
### 1. Stripe Product
|
|
8
|
+
|
|
9
|
+
**Product Details:**
|
|
10
|
+
- Name: `ONE Platform Playbook`
|
|
11
|
+
- Description: Complete playbook for building AI-native platforms with the 6-dimension ontology
|
|
12
|
+
- Product ID: `prod_THAlCa6tZvadtR`
|
|
13
|
+
- Price ID: `price_0SKcPaqs14Mpveu1NRULjmwD`
|
|
14
|
+
- Amount: **$47.00 USD** (one-time payment)
|
|
15
|
+
- Status: Active
|
|
16
|
+
|
|
17
|
+
### 2. Pages Created
|
|
18
|
+
|
|
19
|
+
**Pay Page** (`/pay-playbook`)
|
|
20
|
+
- File: `src/pages/pay-playbook.astro`
|
|
21
|
+
- Purpose: Creates Stripe checkout session and redirects to Stripe
|
|
22
|
+
- Features:
|
|
23
|
+
- Server-side rendering (SSR)
|
|
24
|
+
- Environment variable configuration
|
|
25
|
+
- Error handling with user-friendly messages
|
|
26
|
+
- Loading state while redirecting
|
|
27
|
+
|
|
28
|
+
**Thank You Page** (`/thankyou-playbook`)
|
|
29
|
+
- File: `src/pages/thankyou-playbook.astro`
|
|
30
|
+
- Purpose: Confirmation page after successful payment
|
|
31
|
+
- Features:
|
|
32
|
+
- Retrieves session details from Stripe
|
|
33
|
+
- Displays customer information
|
|
34
|
+
- Download button for playbook
|
|
35
|
+
- What's inside preview
|
|
36
|
+
- Lifetime access notice
|
|
37
|
+
|
|
38
|
+
### 3. Scripts Created
|
|
39
|
+
|
|
40
|
+
**Create Playbook Product** (`scripts/create-playbook-product.ts`)
|
|
41
|
+
- Creates the playbook product in Stripe
|
|
42
|
+
- Sets up pricing
|
|
43
|
+
- Updates `.stripe-config.json`
|
|
44
|
+
- Outputs environment variables
|
|
45
|
+
|
|
46
|
+
**List Products** (`scripts/list-stripe-products.ts`)
|
|
47
|
+
- Lists all products in your Stripe account
|
|
48
|
+
- Shows prices and active status
|
|
49
|
+
- Useful for finding product IDs
|
|
50
|
+
|
|
51
|
+
**Fetch Product** (`scripts/fetch-stripe-product.ts`)
|
|
52
|
+
- Fetches details for a specific product
|
|
53
|
+
- Shows all prices
|
|
54
|
+
- Outputs environment variable format
|
|
55
|
+
|
|
56
|
+
### 4. Environment Variables
|
|
57
|
+
|
|
58
|
+
Added to `.env.local`:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
STRIPE_PLAYBOOK_PRICE_ID=price_0SKcPaqs14Mpveu1NRULjmwD
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Added to `.env.example`:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
STRIPE_PLAYBOOK_PRICE_ID=price_... # Playbook price ID
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 5. Configuration Files Updated
|
|
71
|
+
|
|
72
|
+
**`.stripe-config.json`**
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"environment": "live",
|
|
76
|
+
"createdAt": "2025-10-21T09:55:43.049Z",
|
|
77
|
+
"updatedAt": "2025-10-21T10:05:12.049Z",
|
|
78
|
+
"products": [
|
|
79
|
+
{
|
|
80
|
+
"name": "ONE Platform Course",
|
|
81
|
+
"productId": "prod_THAdytWWNfieJ0",
|
|
82
|
+
"priceId": "price_0SKcI6qs14Mpveu16vIPzJbH",
|
|
83
|
+
"amount": 9700,
|
|
84
|
+
"currency": "usd"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "ONE Platform Playbook",
|
|
88
|
+
"productId": "prod_THAlCa6tZvadtR",
|
|
89
|
+
"priceId": "price_0SKcPaqs14Mpveu1NRULjmwD",
|
|
90
|
+
"amount": 4700,
|
|
91
|
+
"currency": "usd"
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**`package.json`** - Added scripts:
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"scripts": {
|
|
101
|
+
"stripe:setup": "bun run scripts/setup-stripe-products.ts",
|
|
102
|
+
"stripe:list": "bun run scripts/list-stripe-products.ts",
|
|
103
|
+
"stripe:fetch": "bun run scripts/fetch-stripe-product.ts"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Usage
|
|
109
|
+
|
|
110
|
+
### Testing the Playbook Checkout
|
|
111
|
+
|
|
112
|
+
1. **Start dev server:**
|
|
113
|
+
```bash
|
|
114
|
+
bun run dev
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
2. **Visit the pay page:**
|
|
118
|
+
```
|
|
119
|
+
http://localhost:4321/pay-playbook
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
3. **You'll be redirected to Stripe Checkout**
|
|
123
|
+
|
|
124
|
+
4. **Use test card:**
|
|
125
|
+
- Card: `4242 4242 4242 4242`
|
|
126
|
+
- Expiry: Any future date (e.g., `12/34`)
|
|
127
|
+
- CVC: Any 3 digits (e.g., `123`)
|
|
128
|
+
- ZIP: Any ZIP code (e.g., `12345`)
|
|
129
|
+
|
|
130
|
+
5. **After payment:**
|
|
131
|
+
- Redirected to `/thankyou-playbook?session_id=...`
|
|
132
|
+
- See confirmation and download button
|
|
133
|
+
|
|
134
|
+
### Managing Stripe Products
|
|
135
|
+
|
|
136
|
+
**List all products:**
|
|
137
|
+
```bash
|
|
138
|
+
bun run stripe:list
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Fetch specific product:**
|
|
142
|
+
```bash
|
|
143
|
+
bun run stripe:fetch prod_THAlCa6tZvadtR
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Create new products:**
|
|
147
|
+
Edit `scripts/setup-stripe-products.ts` and add to the `PRODUCTS` array, then:
|
|
148
|
+
```bash
|
|
149
|
+
bun run stripe:setup
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## File Structure
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
web/
|
|
156
|
+
├── src/
|
|
157
|
+
│ └── pages/
|
|
158
|
+
│ ├── pay-playbook.astro # Checkout page
|
|
159
|
+
│ └── thankyou-playbook.astro # Success page
|
|
160
|
+
├── scripts/
|
|
161
|
+
│ ├── setup-stripe-products.ts # Create products (original)
|
|
162
|
+
│ ├── create-playbook-product.ts # Create playbook (standalone)
|
|
163
|
+
│ ├── list-stripe-products.ts # List all products
|
|
164
|
+
│ ├── fetch-stripe-product.ts # Fetch product details
|
|
165
|
+
│ └── README.md # Scripts documentation
|
|
166
|
+
├── .stripe-config.json # Product configuration (git-ignored)
|
|
167
|
+
├── .env.local # Environment variables (git-ignored)
|
|
168
|
+
├── .env.example # Environment template
|
|
169
|
+
└── STRIPE-SETUP-GUIDE.md # Complete Stripe guide
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Product Comparison
|
|
173
|
+
|
|
174
|
+
| Feature | Course | Playbook |
|
|
175
|
+
|---------|--------|----------|
|
|
176
|
+
| **Price** | $97.00 | $47.00 |
|
|
177
|
+
| **Type** | One-time | One-time |
|
|
178
|
+
| **Page** | `/pay-course` | `/pay-playbook` |
|
|
179
|
+
| **Success** | `/thankyou-course` | `/thankyou-playbook` |
|
|
180
|
+
| **Cancel** | `/stripe` | `/playbook` |
|
|
181
|
+
| **Product ID** | `prod_THAdytWWNfieJ0` | `prod_THAlCa6tZvadtR` |
|
|
182
|
+
| **Price ID** | `price_0SKcI6qs14Mpveu16vIPzJbH` | `price_0SKcPaqs14Mpveu1NRULjmwD` |
|
|
183
|
+
|
|
184
|
+
## Key Differences from Course
|
|
185
|
+
|
|
186
|
+
**Playbook-Specific Features:**
|
|
187
|
+
|
|
188
|
+
1. **Instant Download** (vs. Course start date)
|
|
189
|
+
2. **Lifetime Updates** (vs. Fixed course content)
|
|
190
|
+
3. **Money-Back Guarantee** badge
|
|
191
|
+
4. **Download button** on thank you page
|
|
192
|
+
5. **Different benefits** displayed:
|
|
193
|
+
- Instant Download
|
|
194
|
+
- Lifetime Updates
|
|
195
|
+
- Money-Back Guarantee
|
|
196
|
+
|
|
197
|
+
**Course-Specific Features:**
|
|
198
|
+
|
|
199
|
+
1. **Start Date** (June 1st, 2025)
|
|
200
|
+
2. **Calendar integration** messaging
|
|
201
|
+
3. **Login credentials** mention
|
|
202
|
+
4. **Different benefits** displayed:
|
|
203
|
+
- Instant Access
|
|
204
|
+
- Premium Support
|
|
205
|
+
- Cancel Anytime
|
|
206
|
+
|
|
207
|
+
## API Version Update
|
|
208
|
+
|
|
209
|
+
Fixed TypeScript error by updating Stripe API version across all files:
|
|
210
|
+
|
|
211
|
+
**Before:**
|
|
212
|
+
```typescript
|
|
213
|
+
apiVersion: '2025-02-24.acacia' // ❌ Type error
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
**After:**
|
|
217
|
+
```typescript
|
|
218
|
+
apiVersion: '2025-09-30.clover' // ✅ Correct
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**Updated Files:**
|
|
222
|
+
- `src/pages/pay-course.astro`
|
|
223
|
+
- `src/pages/pay-playbook.astro`
|
|
224
|
+
- `scripts/setup-stripe-products.ts`
|
|
225
|
+
- `scripts/create-playbook-product.ts`
|
|
226
|
+
- `scripts/list-stripe-products.ts`
|
|
227
|
+
- `scripts/fetch-stripe-product.ts`
|
|
228
|
+
|
|
229
|
+
## Next Steps
|
|
230
|
+
|
|
231
|
+
### 1. Add Playbook Download Functionality
|
|
232
|
+
|
|
233
|
+
Currently, the download button is a placeholder. Implement actual download:
|
|
234
|
+
|
|
235
|
+
```typescript
|
|
236
|
+
// Option 1: Store file in Convex
|
|
237
|
+
// Option 2: Use Cloudflare R2
|
|
238
|
+
// Option 3: Send download link via email
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### 2. Add Webhook Handler
|
|
242
|
+
|
|
243
|
+
For production, verify payments via webhooks:
|
|
244
|
+
|
|
245
|
+
```typescript
|
|
246
|
+
// src/pages/api/webhooks/stripe.ts
|
|
247
|
+
export const POST: APIRoute = async ({ request }) => {
|
|
248
|
+
const event = await stripe.webhooks.constructEvent(
|
|
249
|
+
await request.text(),
|
|
250
|
+
request.headers.get('stripe-signature')!,
|
|
251
|
+
import.meta.env.STRIPE_WEBHOOK_SECRET!
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
if (event.type === 'checkout.session.completed') {
|
|
255
|
+
// Grant access to playbook
|
|
256
|
+
// Send download email
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### 3. Track Purchases in Convex
|
|
262
|
+
|
|
263
|
+
Store purchase records:
|
|
264
|
+
|
|
265
|
+
```typescript
|
|
266
|
+
// backend/convex/mutations/purchases.ts
|
|
267
|
+
export const recordPlaybookPurchase = mutation({
|
|
268
|
+
args: {
|
|
269
|
+
sessionId: v.string(),
|
|
270
|
+
email: v.string(),
|
|
271
|
+
amount: v.number(),
|
|
272
|
+
},
|
|
273
|
+
handler: async (ctx, args) => {
|
|
274
|
+
await ctx.db.insert('purchases', {
|
|
275
|
+
productType: 'playbook',
|
|
276
|
+
stripeSessionId: args.sessionId,
|
|
277
|
+
customerEmail: args.email,
|
|
278
|
+
amountPaid: args.amount,
|
|
279
|
+
purchasedAt: Date.now(),
|
|
280
|
+
});
|
|
281
|
+
},
|
|
282
|
+
});
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### 4. Email Integration
|
|
286
|
+
|
|
287
|
+
Send download link via Resend:
|
|
288
|
+
|
|
289
|
+
```typescript
|
|
290
|
+
import { Resend } from 'resend';
|
|
291
|
+
|
|
292
|
+
const resend = new Resend(process.env.RESEND_API_KEY);
|
|
293
|
+
|
|
294
|
+
await resend.emails.send({
|
|
295
|
+
from: 'ONE Platform <noreply@one.ie>',
|
|
296
|
+
to: customerEmail,
|
|
297
|
+
subject: 'Your ONE Platform Playbook',
|
|
298
|
+
html: `<a href="${downloadUrl}">Download Playbook</a>`,
|
|
299
|
+
});
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### 5. Add to Main Navigation
|
|
303
|
+
|
|
304
|
+
Link to `/playbook` page from your main navigation to drive traffic.
|
|
305
|
+
|
|
306
|
+
## Testing Checklist
|
|
307
|
+
|
|
308
|
+
- [x] Stripe product created
|
|
309
|
+
- [x] Environment variables configured
|
|
310
|
+
- [x] Pay page redirects to Stripe
|
|
311
|
+
- [x] Thank you page displays after payment
|
|
312
|
+
- [x] Test card payment succeeds
|
|
313
|
+
- [ ] Download button works
|
|
314
|
+
- [ ] Webhook receives events
|
|
315
|
+
- [ ] Purchase recorded in Convex
|
|
316
|
+
- [ ] Email sent with download link
|
|
317
|
+
- [ ] Live mode tested with real card
|
|
318
|
+
|
|
319
|
+
## Support
|
|
320
|
+
|
|
321
|
+
For issues or questions:
|
|
322
|
+
|
|
323
|
+
- **Stripe Dashboard**: https://dashboard.stripe.com
|
|
324
|
+
- **Documentation**: See `STRIPE-SETUP-GUIDE.md`
|
|
325
|
+
- **Scripts Help**: See `scripts/README.md`
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
**Setup completed successfully!** 🎉
|
|
330
|
+
|
|
331
|
+
You can now sell the ONE Platform Playbook at `http://localhost:4321/pay-playbook`
|