Skip to content
On this page

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:

  1. A Nuxt SSR bundle that runs as a Node process on the dev/prod server.
  2. 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:

VariableDev valueProd value
BUNNYCDN_STORAGE_ZONE(set by Abdel)(set by Abdel)
BUNNYCDN_STORAGE_KEY(set by Abdel)(set by Abdel)
BUNNYCDN_PATH_PREFIXsouksouk
BUNNYCDN_PURGE_URLhttps://themes.storeino.worldhttps://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.json

And 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:

bash
ssh dev-server
cd /path/to/souk-theme
git pull
npm run deploy        # rebuild + upload
pm2 restart souk-theme

The 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:

  1. BunnyCDN edge cache — upload-cdn.mjs already purges this if BUNNYCDN_PURGE_* env vars are set.
  2. theme-manager cache — 120-second TTL on the theme document per subdomain. To force a refresh:
bash
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:

  1. Drop a screenshot at souk-theme/public/sections/<Type>/preview.png (recommended size: 800x500, PNG).
  2. Re-deploy. The file uploads as part of the public/ tree.
  3. 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:3001 URLs in your manifest preview or component.
  • console.log debug 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.

Released under the MIT License.