oneie 3.6.38 → 3.6.40
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/agents/agent-frontend.md +48 -0
- package/.claude/commands/deploy.md +187 -17
- package/.claude/commands/media-upload.md +186 -0
- package/.claude/hooks/.last-news-context +1 -1
- package/.claude/hooks/__pycache__/todo.cpython-312.pyc +0 -0
- package/README.md +28 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -1
- package/one/README.md +1 -2
- package/one/knowledge/one-protocol-ai-agents.md +892 -0
- package/one/knowledge/one-protocol-executive-report.md +617 -0
- package/one/knowledge/one-protocol-standard.md +869 -0
- package/one/knowledge/one-protocol-whitepaper.md +756 -0
- package/one/knowledge/ontology-education-game.md +1654 -0
- package/one/knowledge/ontology-v2.md +4449 -0
- package/one/knowledge/ontology.md +1 -1
- package/one/things/contracts/Move.toml +12 -0
- package/one/things/contracts/README.md +288 -0
- package/one/things/contracts/one.move +762 -0
- package/one/things/contracts/sdk.ts +578 -0
- package/one/things/crypto/FEATURES.md +78 -0
- package/one/things/crypto/ONECORE.md +62 -0
- package/one/things/crypto/ONECOREFAQ.md +22 -0
- package/one/things/crypto/ONECOREHOW.md +46 -0
- package/one/things/crypto/ONEENTERPRISE.md +64 -0
- package/one/things/crypto/ONEENTERPRISEFAQ.md +64 -0
- package/one/things/crypto/ONEENTERPRISEHOW.md +53 -0
- package/one/things/crypto/ONEPRO.md +60 -0
- package/one/things/crypto/ONEPROFAQ.md +22 -0
- package/one/things/crypto/ONEPROHOW.md +53 -0
- package/one/things/crypto/READMEAGENCY.md +64 -0
- package/one/things/crypto/VSL.md +45 -0
- package/one/things/crypto/WebsiteCopy.md +176 -0
- package/one/things/design-system.md +832 -0
- package/one/things/pay.one.ie.md +53 -0
- package/one/things/plans/ai-elements-integration.md +483 -0
- package/one/things/plans/one-protocol-and-payone-usage.md +82 -0
- package/one/things/plans/plan-connect-to-api.md +146 -0
- package/one/things/plans/video-frontend.md +146 -88
- package/one/things/plans-u.md +905 -0
- package/one/things/products/Blockchain Products.md +6278 -0
- package/one/things/scripts-clean-mac.sh +409 -0
- package/one/things/todo-release.md +654 -0
- package/one/things/todo.md +9 -642
- package/one/things/video-script-backup.md +318 -0
- package/one/things/video-script-demo.md +382 -0
- package/one/things/video-script-ontology.md +0 -1
- package/one/things/video-script.md +361 -0
- package/package.json +8 -6
- package/.claude/hooks/__pycache__/done.cpython-313.pyc +0 -0
- package/.claude/hooks/__pycache__/todo.cpython-311.pyc +0 -0
- package/llms.txt +0 -257
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Plan: Connect /u features to pay.one.ie API
|
|
2
|
+
|
|
3
|
+
Status: Draft
|
|
4
|
+
|
|
5
|
+
Summary
|
|
6
|
+
-------
|
|
7
|
+
We found that many pages under `web/src/pages/u/*` (and their components) store demo or local data in localStorage (keys like `u_wallets`, `u_tokens`, `u_products`, `u_transactions`, `u_contacts`, `u_profile`, `u_keys`, `u_payments`, etc.). The pay.one.ie API exposes a wide set of protocols for payments, wallets, identity, prices, and access control which are a natural fit to replace local/demo data and power these features.
|
|
8
|
+
|
|
9
|
+
Goal
|
|
10
|
+
----
|
|
11
|
+
Replace local/demo flows in `/u` with production API calls to `https://pay.one.ie` (or `https://api.pay.one.ie`) via a small, testable PayService + client wrappers and a migration strategy so existing local storage is respected until users opt-in.
|
|
12
|
+
|
|
13
|
+
Findings (quick)
|
|
14
|
+
----------------
|
|
15
|
+
- Pages & components using local/demo storage (non-exhaustive):
|
|
16
|
+
- UDashboard: `u_wallets`, `u_tokens`, `u_products`, `u_transactions`, `u_keys`
|
|
17
|
+
- PeoplePage: `u_profile`, `u_contacts`, `u_payment_requests`
|
|
18
|
+
- WalletsPage / WalletDetailPage: `u_wallets`, `u_keys`, `u_transactions`
|
|
19
|
+
- TokensPage: `u_tokens`
|
|
20
|
+
- ProductsPage / ProductDetailPage: `u_products`
|
|
21
|
+
- TransactionsPage: `u_transactions`
|
|
22
|
+
- ContractsPage: `u_contracts`
|
|
23
|
+
- Send/Receive: `u_recent_recipients`, `u_send_prefill`
|
|
24
|
+
- Payment tracker libraries: `u_payments` (PaymentStatusTracker)
|
|
25
|
+
|
|
26
|
+
- pay.one.ie capabilities discovered (via `GET https://pay.one.ie` and other endpoints):
|
|
27
|
+
- Wallets: `wallet_generate`, `wallet_derive`, `wallet_recover`, `faucet_request`, `faucet_list`
|
|
28
|
+
- Payments: `x402_quote`, `x402_claim`, `payment_link_create`, `payment_link_quote`, `payment_link_claim`
|
|
29
|
+
- Identity & profile: `person_create`, `person_get`, `merchant_config`, `thing_create`, `thing_list`
|
|
30
|
+
- Prices: `prices_get`, `prices_convert`
|
|
31
|
+
- Access control / gating: `gatekeeper_check`, `gatekeeper_tier`, `access_sign`, `access_verify`
|
|
32
|
+
- Subscriptions & credits: `subscription_*`, `credits_*`
|
|
33
|
+
|
|
34
|
+
Mapping: local/demo features -> pay.one protocols
|
|
35
|
+
-------------------------------------------------
|
|
36
|
+
- Wallets & keys
|
|
37
|
+
- Local: `u_wallets`, `u_keys`
|
|
38
|
+
- API: `wallet_derive` (deterministic agent wallets), `wallet_generate` (server-side generation), `wallet_recover`, `faucet_request` / `faucet_list` (testnet funding)
|
|
39
|
+
- UI change: provide option to "Store locally" or "Back up to pay.one" for cloud-backed storage (opt-in)
|
|
40
|
+
|
|
41
|
+
- Tokens & balances
|
|
42
|
+
- Local: `u_tokens`, token lists in UDashboard
|
|
43
|
+
- API: `token_history`, `prices_get`, `prices_convert` to show USD values and histories
|
|
44
|
+
|
|
45
|
+
- Products and payments
|
|
46
|
+
- Local: `u_products` used as sample shop items and local product detail
|
|
47
|
+
- API: `payment_link_create` to generate pay.one.ie payment links and Cloudflare Worker endpoints (create_url `/pay/create`), `x402_quote` for agent purchases
|
|
48
|
+
- Payment flows: product -> create payment link via PayService -> redirect to `https://pay.one.ie/pay/create` or `pay.one.ie/qr` -> listen for webhook/claim
|
|
49
|
+
|
|
50
|
+
- Transactions and payments tracking
|
|
51
|
+
- Local: `u_transactions`, `u_payments`
|
|
52
|
+
- API: use pay.one webhook & `payment_link_claim` / `x402_claim` to confirm payments; poll `https://api.pay.one.ie` (or subscribe to webhooks) and update local UI. PaymentStatusTracker should call the pay.one endpoints to reflect real status.
|
|
53
|
+
|
|
54
|
+
- People & identity
|
|
55
|
+
- Local: `u_profile`, `u_contacts`
|
|
56
|
+
- API: `person_create`, `person_get`, `person_update` to store contacts on pay.one (optionally), or mirror to local if user wants local-only
|
|
57
|
+
|
|
58
|
+
- Contracts / deployed artifacts
|
|
59
|
+
- Local: `u_contracts` used in demo
|
|
60
|
+
- API: use pay.one endpoints / agent indexing to record contract metadata, or call chain-specific tooling via pay.one's RPC and wallet services (e.g., merchant_config)
|
|
61
|
+
|
|
62
|
+
Technical Approach (high-level)
|
|
63
|
+
-------------------------------
|
|
64
|
+
1. Introduce a lightweight `PayService` client in `web/src/lib` or `web/src/components/u/lib/PayService.ts` (there is already a stub) that encapsulates:
|
|
65
|
+
- base URL(s): `https://pay.one.ie` and `https://api.pay.one.ie`
|
|
66
|
+
- auth handling (API keys / JWT) — local dev uses environment variables or a dev test API token
|
|
67
|
+
- helpers: protocolRequest(protocolName, data) → POST { protocol: "name", data }
|
|
68
|
+
- dedicated helpers: createPaymentLink, quoteX402, claimX402, walletGenerate, walletDerive, pricesGet, personCreate, etc.
|
|
69
|
+
2. Wrap existing UI to call PayService instead of localStorage for live flows; keep a local toggle or progressive migration so previously stored local records remain available.
|
|
70
|
+
3. Data modelling: map pay.one responses to our UI interfaces (Wallet, Token, Product, Transaction, Person). Add thin adapters in `components/u/adapters/*`.
|
|
71
|
+
4. Sync strategy:
|
|
72
|
+
- Read-first: if the user has local data, show it and surface a "Sync to pay.one (backup)" action
|
|
73
|
+
- For newly created data, prefer pay.one API and mirror results locally for offline UX and speed
|
|
74
|
+
- Where user privacy matters, provide explicit opt-in to upload personal keys/profile
|
|
75
|
+
5. Offline & fallback:
|
|
76
|
+
- Keep localStorage as an offline cache.
|
|
77
|
+
- Use optimistic updates in the UI and verify via pay.one responses or webhooks.
|
|
78
|
+
6. Security & keys
|
|
79
|
+
- Never send raw mnemonics or private keys to pay.one unless the user explicitly opts in and the feature is designed for cloud backup (with end-to-end encryption).
|
|
80
|
+
- For agent wallets and hosted wallets, use `wallet_derive` to produce deterministic agent wallets server-side.
|
|
81
|
+
7. Rate limiting & caching
|
|
82
|
+
- Cache price responses for 60–300s, cache small identity lookups, and use exponential back-off.
|
|
83
|
+
8. Backward-compatible API
|
|
84
|
+
- Provide a short-term polyfill layer so components can use either localStorage or PayService with minimal changes.
|
|
85
|
+
|
|
86
|
+
Implementation Plan & Milestones
|
|
87
|
+
--------------------------------
|
|
88
|
+
Phase 0 — Design & Discovery (0.5 day)
|
|
89
|
+
- Inventory all localStorage keys & flows (we've started this)
|
|
90
|
+
- Verify pay.one API contracts & auth (API tokens) for staging
|
|
91
|
+
- Create `one/things/plans/plan-connect-to-api` (this file)
|
|
92
|
+
|
|
93
|
+
Phase 1 — PayService & Adapters (1–2 days)
|
|
94
|
+
- Create `web/src/lib/PayService.ts` wrapping endpoints & discovery
|
|
95
|
+
- Add adapters for Wallet, Token, Product, Transaction, Person
|
|
96
|
+
- Add unit tests & mock responses
|
|
97
|
+
|
|
98
|
+
Phase 2 — Integrate feature-by-feature (2–4 days)
|
|
99
|
+
- Wallet flows: enable wallet_generate / wallet_derive / faucet_list
|
|
100
|
+
- Products / Payments: createPaymentLink — update ProductsPage/ProductDetailPage
|
|
101
|
+
- Prices: replace local price manipulation with prices_get
|
|
102
|
+
- Transactions & tracking: hook PaymentStatusTracker to pay.one webhooks or API polling
|
|
103
|
+
- People: add optional cloud-backed person_create / person_get
|
|
104
|
+
|
|
105
|
+
Phase 3 — Migration & QA (1–2 days)
|
|
106
|
+
- Provide in-app migration UI (Backup to pay.one / Restore from pay.one)
|
|
107
|
+
- End-to-end tests (payments and wallet flows)
|
|
108
|
+
- Observability and logging
|
|
109
|
+
|
|
110
|
+
Phase 4 — Rollout
|
|
111
|
+
- Feature flag release, beta test, full rollout. Provide admin dashboards & metrics.
|
|
112
|
+
|
|
113
|
+
Testing & QA
|
|
114
|
+
------------
|
|
115
|
+
- Unit tests for PayService request/response adapters
|
|
116
|
+
- Integration tests (mock pay.one responses via VCR or nock)
|
|
117
|
+
- End-to-end smoke test for full payment link flow (create link → simulate webhook → confirm claim)
|
|
118
|
+
|
|
119
|
+
Next actionable tasks (short)
|
|
120
|
+
----------------------------
|
|
121
|
+
1. Create `web/src/lib/PayService.ts` with a `protocolRequest(protocol, data)` wrapper and small helpers.
|
|
122
|
+
2. Replace `ProductsPage.tsx` payment-link generation to use PayService.createPaymentLink (TEST-mode first) and verify `ProductDetailPage` logic.
|
|
123
|
+
3. Add `Prices` adapter and update `EnhancedWalletCard` + `UDashboard` to call `prices_get` for USD values.
|
|
124
|
+
4. Implement `PaymentStatusTracker` integration to query pay.one and update `u_payments`.
|
|
125
|
+
5. Add a migration UI for `UDashboard` to allow exporting local data to pay.one (opt-in).
|
|
126
|
+
|
|
127
|
+
References & Useful Endpoints
|
|
128
|
+
----------------------------
|
|
129
|
+
- Discovery: POST https://pay.one.ie { protocol: "system_discovery" } or GET https://pay.one.ie (returns protocol list / info)
|
|
130
|
+
- Example agent endpoint: https://api.pay.one.ie/api/v1/agent/sync
|
|
131
|
+
- Payment pages: https://pay.one.ie/pay/create, https://pay.one.ie/qr, https://pay.one.ie/to/{address}
|
|
132
|
+
- OpenAPI / plugin manifest (if available): https://pay.one.ie/openapi.yaml, https://pay.one.ie/.well-known/ai-plugin.json
|
|
133
|
+
|
|
134
|
+
Security notes
|
|
135
|
+
--------------
|
|
136
|
+
- Ensure E2E encryption/user consent for any key uploads.
|
|
137
|
+
- Keep the default UX local-first — cloud backup only via clear opt-in.
|
|
138
|
+
|
|
139
|
+
Ownership & PR plan
|
|
140
|
+
-------------------
|
|
141
|
+
- Implement PayService + tests (owner: frontend engineer)
|
|
142
|
+
- Product/Payments integration (owner: frontend + backend for webhook support)
|
|
143
|
+
- QA & rollout (owner: product engineering)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
-- End of draft plan --
|
|
@@ -32,35 +32,32 @@ Build working video player functionality on the frontend WITHOUT requiring backe
|
|
|
32
32
|
|
|
33
33
|
---
|
|
34
34
|
|
|
35
|
-
## Dependencies
|
|
35
|
+
## Dependencies
|
|
36
36
|
|
|
37
37
|
### Required Dependencies
|
|
38
38
|
```json
|
|
39
39
|
{
|
|
40
|
-
"@astro-community/astro-embed-youtube": "^0.5.
|
|
41
|
-
"@
|
|
42
|
-
"
|
|
43
|
-
"react
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"react": "^
|
|
47
|
-
"react-dom": "^18.3.1"
|
|
40
|
+
"@astro-community/astro-embed-youtube": "^0.5.7",
|
|
41
|
+
"@mux/mux-player-react": "^3.8.0",
|
|
42
|
+
"react-h5-audio-player": "^3.10.1",
|
|
43
|
+
"lucide-react": "^0.546.0",
|
|
44
|
+
"zod": "^4.1.12",
|
|
45
|
+
"react": "^19.1.1",
|
|
46
|
+
"react-dom": "^19.1.1"
|
|
48
47
|
}
|
|
49
48
|
```
|
|
50
49
|
|
|
51
50
|
### Already Installed in web/package.json
|
|
52
|
-
- `astro`: ✅ (5.
|
|
53
|
-
- `react`: ✅ (
|
|
54
|
-
- `react-dom`: ✅ (
|
|
55
|
-
- `lucide-react`: ✅
|
|
56
|
-
- `zod`: ✅
|
|
57
|
-
- `@
|
|
51
|
+
- `astro`: ✅ (5.14.1)
|
|
52
|
+
- `react`: ✅ (19.1.1)
|
|
53
|
+
- `react-dom`: ✅ (19.1.1)
|
|
54
|
+
- `lucide-react`: ✅ (0.546.0)
|
|
55
|
+
- `zod`: ✅ (4.1.12)
|
|
56
|
+
- `@astro-community/astro-embed-youtube`: ✅ (0.5.7)
|
|
57
|
+
- `react-h5-audio-player`: ✅ (3.10.1)
|
|
58
58
|
|
|
59
59
|
### Need to Install
|
|
60
|
-
- `@
|
|
61
|
-
- `@vidstack/react`: ❌ (advanced video player)
|
|
62
|
-
- `vidstack`: ❌ (player core)
|
|
63
|
-
- `react-h5-audio-player`: ❌ (audio player for podcasts)
|
|
60
|
+
- `@mux/mux-player-react`: ❌ (Mux video player - official, production-ready)
|
|
64
61
|
|
|
65
62
|
---
|
|
66
63
|
|
|
@@ -72,22 +69,23 @@ Build working video player functionality on the frontend WITHOUT requiring backe
|
|
|
72
69
|
**Agent:** agent-frontend
|
|
73
70
|
|
|
74
71
|
✓ **Cycle 1:** Install dependencies
|
|
75
|
-
- Run `cd web && bun add @
|
|
76
|
-
- Verify
|
|
72
|
+
- Run `cd web && bun add @mux/mux-player-react`
|
|
73
|
+
- Verify installation in package.json
|
|
77
74
|
- Test imports in a simple component
|
|
78
75
|
|
|
79
76
|
✓ **Cycle 2:** Create content collection schema
|
|
80
77
|
- Create `web/src/content/videos/` directory
|
|
81
|
-
- Define Zod schema for video metadata (title, description, youtubeId, thumbnail, duration)
|
|
82
|
-
- Create sample video entries (3-4 videos
|
|
78
|
+
- Define Zod schema for video metadata (title, description, playbackId, muxAssetId, youtubeId, thumbnail, duration)
|
|
79
|
+
- Create sample video entries (3-4 videos)
|
|
83
80
|
|
|
84
81
|
### Cycle 3-6: Core Components (4 cycles)
|
|
85
82
|
**Agent:** agent-frontend
|
|
86
83
|
|
|
87
|
-
✓ **Cycle 3:**
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
84
|
+
✓ **Cycle 3:** Create VideoPlayer component
|
|
85
|
+
- Create `web/src/components/media/VideoPlayer.tsx` using @mux/mux-player-react
|
|
86
|
+
- Support both Mux (playbackId) and YouTube (youtubeId) sources
|
|
87
|
+
- Add metadata tracking (video_id, video_title, viewer_user_id)
|
|
88
|
+
- Test with sample playbackId
|
|
91
89
|
|
|
92
90
|
✓ **Cycle 4:** Port VideoEmbed component
|
|
93
91
|
- Copy `apps/bullfm/src/components/lessons/VideoEmbed.tsx` → `web/src/components/media/VideoEmbed.tsx`
|
|
@@ -140,14 +138,14 @@ Build working video player functionality on the frontend WITHOUT requiring backe
|
|
|
140
138
|
**Agent:** agent-frontend
|
|
141
139
|
**Deliverable:** Dependencies installed, content collection configured
|
|
142
140
|
|
|
143
|
-
- Cycle 1: Install
|
|
141
|
+
- Cycle 1: Install Mux player dependency (others already installed)
|
|
144
142
|
- Cycle 2: Create content collection schema + sample data
|
|
145
143
|
|
|
146
144
|
### Phase 2: Core Components (Cycles 3-6)
|
|
147
145
|
**Agent:** agent-frontend
|
|
148
146
|
**Deliverable:** Reusable video components
|
|
149
147
|
|
|
150
|
-
- Cycle 3:
|
|
148
|
+
- Cycle 3: Create VideoPlayer (Mux + YouTube support)
|
|
151
149
|
- Cycle 4: Port VideoEmbed (SSR YouTube embeds)
|
|
152
150
|
- Cycle 5: Create VideoCard (thumbnail + metadata)
|
|
153
151
|
- Cycle 6: Create VideoGallery (grid layout)
|
|
@@ -193,37 +191,41 @@ Build working video player functionality on the frontend WITHOUT requiring backe
|
|
|
193
191
|
|
|
194
192
|
---
|
|
195
193
|
|
|
196
|
-
## Component
|
|
194
|
+
## Component Structure
|
|
197
195
|
|
|
198
|
-
###
|
|
196
|
+
### New Components to Create
|
|
199
197
|
|
|
200
198
|
**Video Components:**
|
|
201
199
|
```
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
200
|
+
web/src/components/media/VideoPlayer.tsx
|
|
201
|
+
- Uses @mux/mux-player-react for Mux-hosted videos
|
|
202
|
+
- Falls back to YouTube embeds for youtubeId
|
|
203
|
+
- Metadata tracking for analytics
|
|
205
204
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
205
|
+
web/src/components/media/VideoEmbed.tsx
|
|
206
|
+
- SSR YouTube embeds using @astro-community/astro-embed-youtube
|
|
207
|
+
- Lightweight for marketing pages
|
|
209
208
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
209
|
+
web/src/components/media/VideoCard.tsx
|
|
210
|
+
- Thumbnail card with metadata
|
|
211
|
+
- Links to video detail page
|
|
212
|
+
|
|
213
|
+
web/src/components/media/VideoGallery.tsx
|
|
214
|
+
- Grid layout for video browsing
|
|
213
215
|
```
|
|
214
216
|
|
|
215
217
|
**Audio Components:**
|
|
216
218
|
```
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
219
|
+
web/src/components/media/AudioPlayer.tsx
|
|
220
|
+
- Uses react-h5-audio-player
|
|
221
|
+
- Support for podcast episodes
|
|
220
222
|
```
|
|
221
223
|
|
|
222
224
|
**Content Collections:**
|
|
223
225
|
```
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
226
|
+
web/src/content/config.ts
|
|
227
|
+
- Add videos collection schema
|
|
228
|
+
- Add podcasts collection schema
|
|
227
229
|
```
|
|
228
230
|
|
|
229
231
|
---
|
|
@@ -240,10 +242,12 @@ const videosCollection = defineCollection({
|
|
|
240
242
|
schema: z.object({
|
|
241
243
|
title: z.string(),
|
|
242
244
|
description: z.string(),
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
playbackId: z.string().optional(), // Mux playback ID (primary)
|
|
246
|
+
muxAssetId: z.string().optional(), // Mux asset ID for metadata
|
|
247
|
+
youtubeId: z.string().optional(), // YouTube fallback
|
|
248
|
+
videoUrl: z.string().optional(), // Direct URL fallback
|
|
249
|
+
thumbnail: z.string(), // Image URL or path
|
|
250
|
+
duration: z.number(), // Seconds
|
|
247
251
|
publishedAt: z.date(),
|
|
248
252
|
author: z.string().optional(),
|
|
249
253
|
categories: z.array(z.string()).default([]),
|
|
@@ -256,22 +260,43 @@ export const collections = {
|
|
|
256
260
|
};
|
|
257
261
|
```
|
|
258
262
|
|
|
259
|
-
### Sample Video
|
|
263
|
+
### Sample Video Entries
|
|
264
|
+
|
|
265
|
+
**Mux-hosted video:**
|
|
260
266
|
```markdown
|
|
261
267
|
---
|
|
262
|
-
# web/src/content/videos/
|
|
263
|
-
title: "
|
|
264
|
-
description: "
|
|
268
|
+
# web/src/content/videos/mux-example.md
|
|
269
|
+
title: "Mux Video Example"
|
|
270
|
+
description: "Example video hosted on Mux"
|
|
271
|
+
playbackId: "a4nOgmxGWg6gULfcBbAa00gXyfcwPnAFldF8RdsNyk8M"
|
|
272
|
+
muxAssetId: "video-123"
|
|
273
|
+
thumbnail: "/images/videos/mux-example-thumb.jpg"
|
|
274
|
+
duration: 300
|
|
275
|
+
publishedAt: 2025-01-15
|
|
276
|
+
author: "ONE Platform"
|
|
277
|
+
categories: ["tutorial"]
|
|
278
|
+
tags: ["mux", "video"]
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
Example video demonstrating Mux player integration...
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
**YouTube fallback:**
|
|
285
|
+
```markdown
|
|
286
|
+
---
|
|
287
|
+
# web/src/content/videos/youtube-example.md
|
|
288
|
+
title: "YouTube Video Example"
|
|
289
|
+
description: "Example video from YouTube"
|
|
265
290
|
youtubeId: "dQw4w9WgXcQ"
|
|
266
|
-
thumbnail: "/images/videos/
|
|
291
|
+
thumbnail: "/images/videos/youtube-thumb.jpg"
|
|
267
292
|
duration: 420
|
|
268
293
|
publishedAt: 2025-01-15
|
|
269
|
-
author: "
|
|
270
|
-
categories: ["
|
|
271
|
-
tags: ["
|
|
294
|
+
author: "ONE Platform"
|
|
295
|
+
categories: ["demo"]
|
|
296
|
+
tags: ["youtube"]
|
|
272
297
|
---
|
|
273
298
|
|
|
274
|
-
|
|
299
|
+
Example video using YouTube embed...
|
|
275
300
|
```
|
|
276
301
|
|
|
277
302
|
---
|
|
@@ -279,17 +304,17 @@ Deep dive into Sui's gaming capabilities...
|
|
|
279
304
|
## Technology Stack
|
|
280
305
|
|
|
281
306
|
### Frontend
|
|
282
|
-
- **Framework:** Astro 5 + React 19
|
|
283
|
-
- **Styling:** Tailwind v4
|
|
284
|
-
- **Video Player:** @
|
|
285
|
-
- **Audio Player:** react-h5-audio-player
|
|
286
|
-
- **Icons:** lucide-react
|
|
287
|
-
- **Validation:** Zod
|
|
307
|
+
- **Framework:** Astro 5.14.1 + React 19.1.1
|
|
308
|
+
- **Styling:** Tailwind v4.1.13
|
|
309
|
+
- **Video Player:** @mux/mux-player-react 3.8.0 (primary) + @astro-community/astro-embed-youtube 0.5.7 (fallback)
|
|
310
|
+
- **Audio Player:** react-h5-audio-player 3.10.1
|
|
311
|
+
- **Icons:** lucide-react 0.546.0
|
|
312
|
+
- **Validation:** Zod 4.1.12
|
|
288
313
|
|
|
289
314
|
### Deployment
|
|
290
315
|
- **Frontend:** Cloudflare Pages (web.one.ie)
|
|
291
316
|
- **Assets:** Static files in `/public/`
|
|
292
|
-
- **
|
|
317
|
+
- **Video Hosting:** Mux (production-ready CDN) or YouTube (zero cost fallback)
|
|
293
318
|
|
|
294
319
|
### No Backend Required
|
|
295
320
|
- ❌ No Convex (deferred to video-backend.md)
|
|
@@ -373,8 +398,8 @@ When ready to add multi-tenancy, analytics, and user features:
|
|
|
373
398
|
# 1. Review this plan
|
|
374
399
|
cat /Users/toc/Server/ONE/one/things/plans/video-frontend.md
|
|
375
400
|
|
|
376
|
-
# 2. Start Cycle 1
|
|
377
|
-
cd web && bun add @
|
|
401
|
+
# 2. Start Cycle 1 (most dependencies already installed!)
|
|
402
|
+
cd web && bun add @mux/mux-player-react
|
|
378
403
|
|
|
379
404
|
# 3. Execute cycles sequentially
|
|
380
405
|
/next # Advance to next cycle
|
|
@@ -402,27 +427,60 @@ cd web && bun add @astro-community/astro-embed-youtube @vidstack/react vidstack
|
|
|
402
427
|
|
|
403
428
|
---
|
|
404
429
|
|
|
405
|
-
## Appendix:
|
|
406
|
-
|
|
407
|
-
**
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
-
|
|
411
|
-
-
|
|
412
|
-
- `
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
430
|
+
## Appendix: Dependencies
|
|
431
|
+
|
|
432
|
+
**Already Installed:**
|
|
433
|
+
- `@astro-community/astro-embed-youtube`: "^0.5.7" (YouTube embeds) ✅
|
|
434
|
+
- `react-h5-audio-player`: "^3.10.1" (podcast player) ✅
|
|
435
|
+
- `lucide-react`: "^0.546.0" (icons) ✅
|
|
436
|
+
- `zod`: "^4.1.12" (validation) ✅
|
|
437
|
+
- `astro`: "^5.14.1" (static site generator) ✅
|
|
438
|
+
- `react`: "^19.1.1" (UI library - React 19!) ✅
|
|
439
|
+
- `react-dom`: "^19.1.1" (React renderer) ✅
|
|
440
|
+
|
|
441
|
+
**Need to Install:**
|
|
442
|
+
- `@mux/mux-player-react`: "^3.8.0" (Mux video player - official package) ❌
|
|
443
|
+
|
|
444
|
+
## Mux Player Features
|
|
445
|
+
|
|
446
|
+
**Official Package:** https://www.npmjs.com/package/@mux/mux-player-react
|
|
447
|
+
|
|
448
|
+
**Key Features:**
|
|
449
|
+
- Production-ready player with built-in controls
|
|
450
|
+
- Automatic quality selection and adaptive streaming
|
|
451
|
+
- Built-in metadata tracking for analytics
|
|
452
|
+
- Lazy loading support for performance
|
|
453
|
+
- Works with Mux Video CDN
|
|
454
|
+
- Fallback poster/placeholder images
|
|
455
|
+
|
|
456
|
+
**Basic Usage:**
|
|
457
|
+
```tsx
|
|
458
|
+
import MuxPlayer from '@mux/mux-player-react';
|
|
459
|
+
|
|
460
|
+
<MuxPlayer
|
|
461
|
+
playbackId="a4nOgmxGWg6gULfcBbAa00gXyfcwPnAFldF8RdsNyk8M"
|
|
462
|
+
metadata={{
|
|
463
|
+
video_id: "video-123",
|
|
464
|
+
video_title: "Example Video",
|
|
465
|
+
viewer_user_id: "user-456"
|
|
466
|
+
}}
|
|
467
|
+
/>
|
|
468
|
+
```
|
|
421
469
|
|
|
422
|
-
**
|
|
423
|
-
|
|
424
|
-
-
|
|
425
|
-
|
|
470
|
+
**Lazy Loading:**
|
|
471
|
+
```tsx
|
|
472
|
+
import MuxPlayer from '@mux/mux-player-react/lazy';
|
|
473
|
+
|
|
474
|
+
<MuxPlayer
|
|
475
|
+
loading="viewport"
|
|
476
|
+
playbackId="DS00Spx1CV902MCtPj5WknGlR102V5HFkDe"
|
|
477
|
+
metadata={{
|
|
478
|
+
video_id: 'video-id-123456',
|
|
479
|
+
video_title: 'Big Buck Bunny',
|
|
480
|
+
viewer_user_id: 'user-id-bc-789'
|
|
481
|
+
}}
|
|
482
|
+
/>
|
|
483
|
+
```
|
|
426
484
|
|
|
427
485
|
---
|
|
428
486
|
|