Before you start
You need Node.js 20.9 or newer and npm. Nothing else: the database is a SQLite file created inside the project. See Requirements for production servers and PostgreSQL.
1. Install the packages
npm install
2. Create your settings file
cp .env.example .env
Open .env and change at least these two lines:
AUTH_SECRET: a long random string that signs the sign-in cookies. Generate one withnode -e "console.log(require('crypto').randomBytes(32).toString('hex'))".OWNER_PASSWORD: the password of the first owner account (OWNER_EMAIL).
All variables are explained in Environment variables.
3. Create the database and the sample store
npm run setup
This runs three steps: prisma generate (the database client), prisma db push (creates prisma/souq.db with all tables) and node prisma/seed.mjs (the sample store and the owner account). Running the seed again is safe: it only fills what is empty.
4. Start
npm run dev
- Store: http://localhost:3302 (redirects to
/ar; English is at/en) - Dashboard: http://localhost:3302/en/dashboard (sign in with
OWNER_EMAIL/OWNER_PASSWORD) - Docs: http://localhost:3302/en/docs
The port is 3302. To change it, edit the dev and start scripts in package.json and SITE_URL in .env.
5. Check that everything works
npm test # unit tests of pricing, filters, order rules and permissions
npm run build && npm start # production build on port 3302
python scripts/e2e_api.py # end-to-end API test against the running server
python scripts/check_pages.py # every page in both languages, and every docs link
e2e_api.py places a few test orders. Run it on a fresh demo database, not on a live store.
Starting over
To return to the sample store, stop the server, delete prisma/souq.db and run npm run setup again.
Demo mode
For a public demo, set DEMO_HINT="1" (shows the owner login on the sign-in page) and SEED_DEMO_SHOPPER="1" (creates a shopper account with orders and a wishlist). Never use either on a real store.