Local Development
Run all five Nova Print apps on one machine against a local Django API. Local defaults use SQLite and disk uploads when DATABASE_URL and R2_BUCKET_NAME are empty (.env.example, docs/DEPLOYMENT.md).
For architecture context, see Architecture overview. Auth token endpoints are summarized in Authentication.
Prerequisites
- Python 3 with
venv(backend) - Node.js + npm (all frontends ship
package-lock.json; usenpm install) - Copy env templates before starting apps (details in Environment variables)
Default local ports
| App | Folder | Dev command | Port / URL |
|---|---|---|---|
| API | backend-main/ | python manage.py runserver | http://localhost:8000 (/api/) |
| Admin | frontend-admin-dashboard/ | npm run dev | http://localhost:3000 (vite.config.ts) |
| POS | frontend-pos/ | npm run dev | http://localhost:3001 |
| Checkout | printbazar-checkout/ | npm run dev | http://localhost:3002 (README (printbazar-checkout/README.md)) |
| Store | frontend-ecommerce/ | npm run dev | http://localhost:3003 (next dev -p 3003) |
Backend URL helpers that mint POS / checkout links use matching defaults: POS_FRONTEND_BASE_URL=http://localhost:3001, CHECKOUT_FRONTEND_BASE_URL=http://localhost:3002 (backend-main/.env.example). POS builds customer-link URLs via VITE_CHECKOUT_BASE_URL and frontend-pos/src/lib/publicUrls.ts. Admin builds POS open URLs via VITE_POS_BASE_URL and frontend-admin-dashboard/src/lib/publicUrls.ts.
1. Backend (backend-main/)
From AGENTS.md and the root / backend env examples:
cd backend-main
python3 -m venv env # or .venv — activate whatever you create
source env/bin/activate
pip install -r requirements.txt
Env file:
- Prefer copying
.env.exampleorbackend-main/.env.exampletobackend-main/.env. - Set
SECRET_KEY. LeaveDATABASE_URLandR2_BUCKET_NAMEempty for SQLite + local media. - With
DEBUG=Trueand emptyCORS_ALLOWED_ORIGINS, Django already allows the local frontend origins (3000–3003).
Database and admin user:
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
Optional local archive scheduler (separate process, not inside gunicorn):
python manage.py runapscheduler
See docs/ARCHIVE_SCHEDULER_DEPLOY.md § Local.
Tests: python manage.py test (or a single test path as in AGENTS.md).
2. Admin dashboard (frontend-admin-dashboard/)
cd frontend-admin-dashboard
npm install
npm run dev
Dev env is checked in as frontend-admin-dashboard/.env.development (VITE_API_BASE_URL, VITE_POS_BASE_URL, VITE_STOREFRONT_URL).
- Sign in with the Django superuser / staff account (JWT — see Authentication).
- Superuser-only SQL editor: open
/sql-editorby URL (no sidebar link). Details:docs/SQL_EDITOR.md.
Tests: npm run test / npx vitest.
3. POS (frontend-pos/)
cd frontend-pos
npm install
npm run dev
Uses frontend-pos/.env.development: VITE_API_BASE_URL, VITE_CHECKOUT_BASE_URL=http://localhost:3002. Create a POS terminal in Admin, then open the POS URL built from the slug (buildPosUrl).
4. Checkout (printbazar-checkout/)
cd printbazar-checkout
npm install
npm run dev
Requires VITE_API_BASE_URL=http://localhost:8000/api (README (printbazar-checkout/README.md), printbazar-checkout/.env.development). Open a customer or catalog link copied from POS (host must be the checkout app on port 3002, not a catalog path under the store).
5. Ecommerce storefront (frontend-ecommerce/)
cd frontend-ecommerce
npm install
npm run dev
Uses frontend-ecommerce/.env.development: NEXT_PUBLIC_API_BASE_URL, NEXT_PUBLIC_SITE_URL=http://localhost:3003.
Razorpay (optional for COD-only): keys live in the backend .env; enable methods in Admin → Ecommerce → Payment Options. Local webhooks need a tunnel — see docs/RAZORPAY_SETUP.md.
Suggested startup order
- Backend (
runserver) - Admin (create POS / products / settings)
- POS + Checkout (link flows)
- Storefront (ecommerce cart / COD / Razorpay)
Related
- Environment variables
- Deployment notes
- Full production runbook:
docs/DEPLOYMENT.md