This guide walks you through everything you need to get HDB Service running on your local machine. By the end you’ll have a fully functional development environment connected to a PostgreSQL database, seeded with a sample client hierarchy, and ready to log in as an ADMIN user. The entire process should take less than 10 minutes.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/GianlucaBessone/HDB-Service/llms.txt
Use this file to discover all available pages before exploring further.
Clone the repository
Clone the HDB Service repository from GitHub and navigate into the project directory:
Install dependencies
Install all Node.js dependencies using your preferred package manager. The
postinstall script automatically runs prisma generate so the Prisma Client is ready immediately after install.Configure environment variables
Copy the example environment file to create your local configuration:Then open
.env.local and fill in the values for your environment. Below is a description of every variable:PostgreSQL connection string used by Prisma at runtime (via PgBouncer/pooled connection in Supabase). Format:
postgresql://user:password@host:5432/hdb_service?sslmode=requireThe canonical URL of your application. Set to
http://localhost:3000 for local development. In production, use your full domain, e.g. https://hdb.yourdomain.com.A random secret used to sign session tokens. Must be at least 32 characters. Generate one with
openssl rand -base64 32.Your OneSignal application ID, found in the OneSignal dashboard under Settings → Keys & IDs. Required for push notifications.
Your OneSignal REST API key. Used server-side to send push notifications to users. Found alongside the App ID in the OneSignal dashboard.
The public base URL of the application. Used to construct absolute links in emails and notifications. Set to
http://localhost:3000 locally.The direct (non-pooled) PostgreSQL connection string, required by Prisma Migrate to run DDL statements that PgBouncer cannot handle. Use the direct connection string from Supabase → Project Settings → Database (port
5432). Format: postgresql://postgres.[ref]:[password]@db.[ref].supabase.co:5432/postgresA secret token that must be included in requests to
/api/cron to prevent unauthorised triggering of scheduled jobs. Generate a strong random string with openssl rand -hex 32.Run Prisma migrations and seed
Generate the Prisma Client and push the schema to your database:Then seed the database with a sample client hierarchy, dispenser data, and the material catalog:
First login
The seed script (prisma/seed.ts) creates several users automatically, all with the initial password password123. The primary ADMIN account is:
| Field | Value |
|---|---|
gbessone.hdb@gmail.com | |
| Password | password123 |
| Role | ADMIN |
supervisor@hdb.com (SUPERVISOR) and tech1@hdb.com (TECHNICIAN), all sharing the same initial password.
The User model includes a mustChangePassword boolean flag. When this flag is true, users are redirected to a password-change screen after login before they can access any other part of the application. Any user account created by an admin through the UI will have this flag set to true by default, prompting the new user to set their own password on first access.
The seed data includes a fully configured Arcor S.A. client with multiple plants, sectors, locations, dispensers, and SLA configuration — giving you a realistic dataset to explore every feature of the platform immediately after setup.
Next steps
Business Hierarchy
Understand how Clients, Plants, Sectors, Locations, and Dispensers are structured and how to navigate between them.
Roles & Permissions
A deep dive into the five user roles and the fine-grained permission matrix that controls what each role can see and do.
SLA Configuration
Learn how per-client SLA configs drive response and resolution deadlines, near-breach alerts, and breach tracking.
Environment Reference
Complete reference for all environment variables, including optional OneSignal and cron settings.