Local development & environments
Running the theme locally and understanding the staging and production environments.
Local development & environments
🛠 Dev
Prerequisites
- Node.js (see
README.mdfor the supported version) - Shopify CLI, authenticated against the
car-battery-prostore
See README.md for the canonical setup steps.
Common commands
| Command | What it does |
|---|---|
npm run dev | shopify theme dev -e dev — local preview with hot reload. |
npm run pull | shopify theme pull — pull theme files down from Shopify. |
npm run push | shopify theme push — push local files to a theme. |
npm run deploy | Custom versioned deploy — see Deployment. |
The Shopify environments are defined in shopify.theme.toml (default and dev, both pointing at
the car-battery-pro store, with theme-editor sync enabled).
Two environments: staging vs production
CBP runs across two backend environments, owned separately (see Who owns what):
| Environment | Backend API | Owner | Used for |
|---|---|---|---|
| Production | api_base_url theme setting | Car Battery Pro | The live store. |
| Staging / dev | api_dev_base_url theme setting | Conversion Kings | Development and testing. |
Which API the store talks to is controlled by the debug mode theme setting — see Debug mode. With debug on, the theme uses the dev/staging API; with it off, production.
The separation is intentional so CBP can change agencies without losing production access. A future maintainer taking over should plan to own or re-create the staging environment, which currently belongs to Conversion Kings.
Branches
The live store syncs to the production branch (the automated theme-pull workflow commits
there — see Deployment). Treat production as a reflection of what's live.