Manual Installation (Developers)
Use this method if you want to run POSVelo directly with npm — for
development, debugging or customising the source. If you just want to run the
product, use the much simpler Docker setup instead.
You run the backend and frontend as two separate processes. You can provide PostgreSQL and Redis either with Docker (easiest) or by installing them natively.
Step 1 — Provide PostgreSQL & Redis
Easiest: Docker for the databases only
Run PostgreSQL and Redis as two standalone containers (any password you choose; the data survives restarts in the named volumes):
docker run -d --name posvelo-postgres \
-e POSTGRES_DB=posvelo -e POSTGRES_USER=posvelo \
-e POSTGRES_PASSWORD=change-me \
-p 5432:5432 -v posvelo_pg_data:/var/lib/postgresql/data \
postgres:16-alpine
docker run -d --name posvelo-redis \
-p 6379:6379 -v posvelo_redis_data:/data \
redis:7-alpine
This starts PostgreSQL on 5432 and Redis on 6379. (On Windows PowerShell,
paste each command on one line without the \ continuations.) Later you can
stop/start them with docker stop posvelo-postgres posvelo-redis and
docker start posvelo-postgres posvelo-redis.
Or: install them natively
- PostgreSQL 16 — create a database:
psql -U postgres CREATE DATABASE posvelo; \q - Redis 7:
# Ubuntu/Debian sudo apt install redis-server && sudo systemctl start redis # macOS (Homebrew) brew install redis && brew services start redis
Step 2 — Configure & start the Backend
cd Backend
cp .env.example .env # Windows: copy .env.example .env
Open .env and set at least:
NODE_ENV=development
PORT=5000
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/posvelo?schema=public
REDIS_URL=redis://localhost:6379
JWT_ACCESS_SECRET=<random 64-char string>
JWT_REFRESH_SECRET=<different random 64-char string>
MASTER_ENCRYPTION_KEY=<run: openssl rand -hex 32>
CORS_ORIGINS=http://localhost:3000
SETUP_ACCESS_CODE=<any secret code you choose>
Match
DATABASE_URLto your database. If you used the twodocker runcommands from Step 1, the database isposvelowith userposveloonlocalhost:5432, and the password is whatever you set asPOSTGRES_PASSWORD. So the URL ispostgresql://posvelo:<POSTGRES_PASSWORD>@localhost:5432/posvelo?schema=public.
Generate secrets with:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
Install dependencies, apply migrations and start:
npm install
npx prisma generate
npx prisma migrate deploy
npm run dev # starts on http://localhost:5000
npm run dev:worker # in a second terminal: scheduled reports and nightly jobs
Optional demo data:
npm run db:seedloads a fully populated sample shop (see First-Time Setup for the demo logins). Skip it for a clean install and use the setup wizard.
Keep this terminal open.
Step 3 — Configure & start the Frontend
Open a second terminal:
cd Frontend
cp .env.example .env # Windows: copy .env.example .env
Set in Frontend/.env:
NEXT_PUBLIC_TEST_MODE=false
NEXT_PUBLIC_API_URL=http://localhost:5000/api/v1
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=<your cloudinary cloud name>
NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET=<your unsigned upload preset>
CLOUDINARY_API_KEY=<your cloudinary api key>
CLOUDINARY_API_SECRET=<your cloudinary api secret>
Cloudinary fields may be left blank to start (uploads disabled). See Configuration.
Install and start:
npm install
npm run dev # starts on http://localhost:3000
Step 4 — Open and set up
Go to http://localhost:3000 and complete the first-run wizard (First-Time Setup).
Useful backend scripts
| Command | Purpose |
|---|---|
npm run dev | Start the API with hot reload |
npm run build | Compile to dist/ |
npm start | Run the compiled production build |
npm run worker / npm run dev:worker | Run the background jobs (scheduled reports, ledger posting, loyalty expiry, HR sweeps) |
npm run db:migrate | Create/apply a migration (dev) |
npm run db:migrate:prod | Apply migrations (production) |
npm run db:seed | Load demo data |
npm run db:studio | Open Prisma Studio (visual DB browser) |
npm test | Run the test suite |
npm run lint / npm run typecheck | Quality checks |