Run the store locally
Install and start each app with Node.js and Yarn, one terminal per app.
For the Full Stack package
Before you start: install Node.js 22 or newer and run corepack enable once. No database server is needed.
Open every terminal where the commands below expect it: inside e-commerce-1 for the full stack, or next to the app's folder for a single-app package.
| App | Folder | Address |
|---|---|---|
| API | back-end | localhost:8000Local |
| Storefront | storefront | localhost:3030Local |
| Admin dashboard | admin-dashboard | localhost:3031Local |
Start the API first: both frontends read all of their data from it.
Start the API
Install and configure
.env.exampleworks as it is for local development.Having trouble?Terminalcorepack enable cd back-end yarn install cp .env.example .envCreate the database
yarn seedcreatesdatabase.sqlite, its tables and the demo store. Running it again adds only what is missing.Terminalinback-endyarn seedStart the server
Terminalinback-endyarn devExpected result: localhost:8000/api/healthLocal answers
Having trouble?{"status":"ok"}.
Start the storefront
In a second terminal:
Install and configure
The copied
.envpoints the storefront at the API on port8000.Terminalcd storefront yarn install cp .env.example .envStart it
Terminalinstorefrontyarn devExpected result: localhost:3030Local opens the shop in English; Arabic is at
Having trouble?/ar.
Start the storefront
The API is not part of this package. Do not create a .env file yet: without one, the storefront runs on its built-in sample store.
Start it
Terminalinstorefrontyarn devExpected result: localhost:3030Local opens the shop with a "Sample data" notice. Any email and password sign you in as the sample shopper, and what you change is kept in the browser.
When you have the template's API running, create .env from .env.example and set NEXT_PUBLIC_API_BASE_URL to its address. That is what switches the sample store off.
Start the admin dashboard
In a third terminal:
Install and configure
Terminalcd admin-dashboard yarn install cp .env.example .envStart it and sign in
Terminalinadmin-dashboardyarn devExpected result: localhost:3031Local opens the sign-in form, prefilled with the Super Admin:
Having trouble?admin@example.comwith the passwordAdmin@123.
Start the admin dashboard
The API is not part of this package. Do not create a .env file yet: without one, the dashboard runs on its built-in sample store.
Start it and sign in
Terminalinadmin-dashboardyarn devExpected result: localhost:3031Local opens the sign-in form, prefilled with
admin@example.comandAdmin@123. On the sample store any valid email with a password of at least 6 characters signs you in as the Super Admin, and your changes are kept in the browser.
The AI assistant and the AI studio stay unavailable on the sample store, because both need the API's keys. Everything else works.
ConfigurationProduction build
The same folders, built once and then started. First set back-end/.env for production: with NODE_ENV=production the API creates no tables on start, and it refuses to start while JWT_SECRET is empty or still the example value, or while CORS_ORIGIN is empty.
NODE_ENV=production
JWT_SECRET=<a long random string>
CORS_ORIGIN=http://localhost:3030,http://localhost:3031
FRONTEND_URL=http://localhost:3031Generate the secret with node -e "console.log(require('crypto').randomBytes(48).toString('hex'))". Then build the API, create its tables once, and start it. yarn db:sync:prod creates empty tables; yarn seed:prod in its place adds the demo store and its accounts.
back-endyarn build
yarn db:sync:prod
yarn start:prodEach frontend, the storefront on 3030 and the admin on 3031 (the same two commands in admin-dashboard):
storefrontyarn build
yarn startThe frontends compile their .env in at build time, so run yarn build again after changing it. Before you deploy anywhere public, read the production checklist.
Start over with fresh demo data
Stop the API, then delete the database file and seed it again. This deletes everything you created.
back-endrm -f database.sqlite* && yarn seedIn PowerShell:
back-endRemove-Item database.sqlite*; yarn seed