Skip to content

Commit 827b3de

Browse files
authored
Merge pull request #12 from UrumiAI/chore/claude-md-deploy-docs
Add CLAUDE.md with deployment workflow and platform docs
2 parents 0eccd12 + 13acd91 commit 827b3de

1 file changed

Lines changed: 100 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Demo Store — Claude Code Instructions
2+
3+
## Platform: Urumi (myscalablesite.com)
4+
5+
This repo runs on the Urumi hosting platform. Each tenant has multiple **workspaces** (dev, staging, prod) accessible via SSH and MCP tools.
6+
7+
### Tenant slug
8+
9+
`demo-kkzi5m`
10+
11+
### Site URLs
12+
13+
| Workspace | URL | SSH user |
14+
|-----------|-----|----------|
15+
| dev-1 | `https://demo-kkzi5m-dev-1.myscalablesite.com` | `demo-kkzi5m-workspace-1` |
16+
| dev-2 | `https://demo-kkzi5m-dev-2.myscalablesite.com` | `demo-kkzi5m-workspace-2` |
17+
| prod | `https://demo-kkzi5m-prod.myscalablesite.com` | (use MCP tools) |
18+
19+
Use `wp option get siteurl` via SSH to confirm which URL a workspace serves.
20+
21+
## Deployment
22+
23+
### Key facts
24+
25+
- **No git repo on the workspace.** The WordPress install at `html/` is not a git checkout. You cannot `git pull` on the workspace.
26+
- **No Node.js on the workspace.** You cannot run `npm run build` there.
27+
- **Build locally, deploy via SCP.** Build the Vite bundle on your machine, then SCP the `dist/` files to the workspace.
28+
29+
### Deployment workflow (SCP)
30+
31+
1. **Build locally:**
32+
```bash
33+
cd themes/demo-store-headless && npm run build
34+
```
35+
36+
2. **Get the workspace absolute path** (do this once — it varies by workspace index):
37+
```bash
38+
ssh demo-kkzi5m-workspace-1@ssh.myscalablesite.com "pwd"
39+
# Returns: /var/www/html/workspaces/1
40+
```
41+
42+
3. **SCP the built files:**
43+
```bash
44+
THEME_DIR="/var/www/html/workspaces/1/html/wp-content/themes/demo-store-headless"
45+
46+
# Upload new dist files
47+
scp dist/index.html demo-kkzi5m-workspace-1@ssh.myscalablesite.com:${THEME_DIR}/dist/index.html
48+
scp dist/assets/index-NEWHASH.js demo-kkzi5m-workspace-1@ssh.myscalablesite.com:${THEME_DIR}/dist/assets/
49+
scp dist/assets/style-NEWHASH.css demo-kkzi5m-workspace-1@ssh.myscalablesite.com:${THEME_DIR}/dist/assets/
50+
```
51+
52+
4. **Remove old hashed assets and flush cache:**
53+
```bash
54+
ssh demo-kkzi5m-workspace-1@ssh.myscalablesite.com \
55+
"rm ${THEME_DIR}/dist/assets/index-OLDHASH.js ${THEME_DIR}/dist/assets/style-OLDHASH.css && wp cache flush"
56+
```
57+
58+
Vite produces content-hashed filenames. Always remove the old files after deploying new ones, otherwise stale assets accumulate.
59+
60+
### Important: workspace path structure
61+
62+
```
63+
/var/www/html/workspaces/{index}/ # SSH home directory (pwd)
64+
html/ # WordPress root
65+
wp-content/
66+
themes/demo-store-headless/
67+
dist/ # Built Vite output (deploy here)
68+
index.html
69+
assets/
70+
index-{hash}.js
71+
style-{hash}.css
72+
src/ # Source (not served directly)
73+
```
74+
75+
## MCP Tools
76+
77+
### When to use MCP vs SSH vs local
78+
79+
| Task | Use |
80+
|------|-----|
81+
| Read/edit code | **Local git** (fastest) |
82+
| Run wp-cli, test changes | **SSH** to workspace |
83+
| Query analytics, metrics, APM | **MCP** (woocommerce, apm servers) — only way |
84+
| Deploy code | **SCP** from local to workspace via SSH |
85+
| Write files to workspace repo | **MCP** `write_files` (slow fallback, can't handle large files >100KB) |
86+
87+
### MCP workspace tools limitations
88+
89+
- `write_files` does atomic git commits on the workspace repo at `/var/www/html/workspaces/{index}/repo/` — this is a **separate path** from the live WordPress install at `html/`.
90+
- `write_files` cannot handle large files (e.g., 225KB minified JS bundles). Use SCP for built assets.
91+
- `git_create_branch` creates branches prefixed `urumi/ai/{index}/{slug}`.
92+
93+
## Headless Theme (demo-store-headless)
94+
95+
- **Stack:** React 18 + Vite + React Router 7
96+
- **No external UI libraries** — plain CSS with design tokens in `src/styles/tokens.css`
97+
- **Design system:** "Salve" cosmetics theme — sage accent (#5F6F52), warm neutrals, serif display font (EB Garamond), sans body (Inter)
98+
- **SYNC comments:** Files marked with `SYNC:` header mirror `UrumiAI/base-headless`. Port changes both ways.
99+
- **Demo mode:** When `window.wpData` is absent (local `npm run dev`), the app uses fixture data from `docs/sample-products.json`. Live mode hits the WooCommerce Store API.
100+
- **Store API:** `wc/store/v1/` — supports `products`, `cart`, `checkout` endpoints. Currency and price units come from the API response (`prices.currency_code`, `prices.currency_minor_unit`).

0 commit comments

Comments
 (0)