Deploying
Once your section works locally and inside the builder, it has to ship to the CDN so real merchants can use it.
For most stagiaires: you will not run the deploy yourself yet. Push your section to a branch, open a PR, and Abdel will deploy. The rest of this page is for context so you understand what happens.
What "deploying souk-theme" actually means
souk-theme is not a single server. It's:
- A Nuxt SSR bundle that runs as a Node process on the dev/prod server.
- A pile of static assets uploaded to BunnyCDN (CSS, JS, fonts, section preview images, manifest index, template catalog).
Both must be updated together. The npm run deploy script handles both, but it expects env variables to be set.
The deploy pipeline
npm run deploy
↓
1. npm run build (Nuxt builds .output/{public,server})
↓
2. npm run upload-cdn (uploads .output/public/* to BunnyCDN)
↓
3. npm run seed-registry (writes the manifest list back to api-stores)Step 1 — npm run build
Standard Nuxt build. Produces:
.output/server/— the SSR bundle (deployed to the dev/prod Node server)..output/public/— static assets (uploaded to BunnyCDN).
This step also runs npm run manifest first, which regenerates public/sections/manifest-index.json from every components/sections/*/manifest.json. Your new section's manifest gets included automatically.
Step 2 — npm run upload-cdn
Reads .output/public/ and PUTs every file to BunnyCDN. Required env vars:
| Variable | Dev value | Prod value |
|---|---|---|
BUNNYCDN_STORAGE_ZONE | (set by Abdel) | (set by Abdel) |
BUNNYCDN_STORAGE_KEY | (set by Abdel) | (set by Abdel) |
BUNNYCDN_PATH_PREFIX | souk | souk |
BUNNYCDN_PURGE_URL | https://themes.storeino.world | https://themes.storeino.com |
BUNNYCDN_PURGE_KEY | (set by Abdel) | (set by Abdel) |
The script uploads under {zone}/{prefix}/, so files end up at https://themes.storeino.{world,com}/souk/.... It also purges the CDN cache so the new files are served immediately.
After this step, your manifest-index.json is at:
https://themes.storeino.world/souk/sections/manifest-index.jsonAnd the api-stores sections endpoint can read it — which is how the builder discovers your section.
Step 3 — npm run seed-registry
Writes the section list back to api-stores so internal tooling (analytics, validation) knows what types exist. This step is dev-team only; you almost never need to think about it.
Deploying the Node server side
The SSR bundle in .output/server/ runs on a Node process at the dev box. Restarting that process is a separate operation, usually via:
ssh dev-server
cd /path/to/souk-theme
git pull
npm run deploy # rebuild + upload
pm2 restart souk-themeThe pm2 restart (or whatever process manager is in use — ask Abdel) is what makes the new SSR bundle live.
Cache invalidation
Even after deploy, you may still see old content because of two cache layers:
- BunnyCDN edge cache —
upload-cdn.mjsalready purges this ifBUNNYCDN_PURGE_*env vars are set. - theme-manager cache — 120-second TTL on the theme document per subdomain. To force a refresh:
curl -X POST http://theme-manager-host:7070/api/cache/clear \
-H 'x-auth-token: <secret>' \
-H 'Content-Type: application/json' \
-d '{"subdomain":"fixpro"}'Ask Abdel for <secret> and the host. Or just wait 2 minutes.
Section preview images
The manifest references a preview image at https://themes.storeino.{world,com}/souk/sections/<Type>/preview.png. To make sure it shows up:
- Drop a screenshot at
souk-theme/public/sections/<Type>/preview.png(recommended size: 800x500, PNG). - Re-deploy. The file uploads as part of the
public/tree. - Hard-refresh the builder.
Until the preview lands, the library card shows a generic placeholder. Not a blocker, but worth doing before merge.
Don't ship these things
- Hard-coded
localhost:3001URLs in your manifest preview or component. console.logdebug calls left in component code.- Imports of files outside
souk-theme/(those won't resolve in prod). - Test data baked into
defaults("lorem ipsum" titles, your own dev email in a newsletter field).
The npm run build will surface most of these as warnings. Read its output before opening a PR.
What's next
That's the whole guide. Read Introduction through Deploying once in order, then keep this site open as a reference while you work.
Welcome to the team.