Skip to content

Developer Onboarding & Environment Setup ​

1. System Requirements & Prerequisites ​

Before setting up the SML Web codebase locally, ensure your development workstation meets the following minimum requirements:

  • Operating System: macOS 12+, Linux (Ubuntu 22.04+), or Windows 11 with WSL2 (Ubuntu).
  • Node.js Runtime: v20.10.0 or v22.x LTS (Verify with node -v).
  • Package Manager: npm v10.x+ (bundled with Node) or pnpm v9.x+.
  • Database Engine: PostgreSQL v15.0+ (local service or Docker container).
  • Git: v2.38+.

2. Step-by-Step Local Workspace Initialization ​

Step 1: Clone Repository & Install Dependencies ​

bash
git clone https://github.com/eyd-v-skill/satenyamamaloesyeweb.git
cd satenyamamaloesyeweb
npm install

Step 2: Configure Environment Variables ​

Copy the example environment file and adjust keys for your local environment:

bash
cp .env.example .env

3. Comprehensive Environment Variables Dictionary ​

Variable NameTypeDefault / Example ValueDescription & Security Context
NODE_ENVstringdevelopmentRuntime mode: development, production, or test.
PORTnumber3000HTTP port for the Hono backend server.
FRONTEND_URLstringhttp://localhost:5173Canonical URL of the frontend (used for CORS & magic links).
DATABASE_URLstringpostgresql://user:pass@localhost:5432/smlweb_dbPostgreSQL TCP connection string for Prisma ORM.
JWT_SECRETstringsuper_secret_jwt_key_min32charsSecret key used to sign and verify JWT authentication tokens.
WADENO_API_KEYstringwadeno_dev_secret_keyAPI key for authenticating with Wadeno WhatsApp Gateway.
WHATSAPP_API_URLstringhttp://localhost:8080Base URL of the Wadeno / GoWA WhatsApp Gateway service.
WHATSAPP_PROVIDERstringHONOWAWhatsApp provider engine mode (HONOWA or GOWA).
TURNSTILE_SECRETstring0x4AAAAAA...Cloudflare Turnstile secret key for captcha siteverify calls.
QBIZ_ENABLEDbooleanfalseEnable/Disable automated QBiz Dynamic QRIS payment gateway.
QBIZ_BASE_URLstringhttp://localhost:8000Base API URL for QBiz payment service.
QBIZ_API_KEYstringqbiz_api_key_xxxMerchant API key issued by QBiz Gateway.
QBIZ_WEBHOOK_SECRETstringqbiz_wh_sec_yyyHMAC secret for verifying incoming payment callback webhooks.
STORAGE_TYPEstringlocalMedia storage driver: local (disk storage) or r2 (Cloudflare R2).
R2_ENDPOINTstringhttps://<account-id>.r2.cloudflarestorage.comCloudflare R2 S3-compatible API endpoint URL.
R2_BUCKETstringsmlweb-mediaTarget bucket name in Cloudflare R2 storage.
R2_PUBLIC_URLstringhttps://assets.[DOMAIN_PRODUKSI]Public CDN base URL for serving uploaded R2 assets.
VAPID_PUBLIC_KEYstringBEl62...Public VAPID key for Web Push browser subscriptions.
VAPID_PRIVATE_KEYstring3K8z...Private VAPID key for signing web push payloads.

4. Local Database Setup via Docker Compose ​

To quickly spin up a isolated PostgreSQL database instance locally:

bash
# Launch PostgreSQL in detached container
docker-compose up -d postgres

# Run Prisma migrations to construct database schema
npx prisma migrate dev --name init

# Seed database with initial categories, settings, and default admin user
npx prisma db seed

5. Developer Command Reference ​

CommandActionOutput / Behavior
npm run devStarts Hono backend & Vite dev server concurrentlyLive reload server on localhost:3000 & localhost:5173
npm run buildCompiles TypeScript backend & bundles React frontendOutputs built assets to dist/ and frontend/dist/
npx prisma studioOpens Prisma Studio GUI in browserInteractive database inspection UI at localhost:5555
npx prisma migrate devGenerates & executes new migrationApplies incremental schema changes to local PostgreSQL
npx prisma db seedExecutes prisma/seed.ts scriptInjects initial categories, menus, and system settings