Skip to content

Getting Started (Developer)

Guide for setting up a local development environment.

TIP

For end-user login instructions, see User Guides › Getting Started.

Prerequisites

  • Node.js 22+
  • pnpm 10+
  • Docker & Docker Compose

Quick Setup

bash
make setup    # Install deps + start DB + run migrations + seed data
make dev      # Start all development servers

Manual Setup

bash
# 1. Install dependencies
pnpm install

# 2. Configure environment
cp .env.example .env
# Edit .env with your credentials

# 3. Start infrastructure
make db-start    # PostgreSQL + Redis + pgAdmin

# 4. Build packages
pnpm build

# 5. Run migrations and seed data
make db-migrate
make db-seed
# Optional: seed demo hospital data for sales demos
make db-seed-demo

# 6. Start development
pnpm dev

Development Services

ServiceURL
API Serverhttp://localhost:3000/trpc
HR Systemhttp://localhost:4000
Admin Panelhttp://localhost:4001
Employee Apphttp://localhost:4002
Nurse Schedulerhttp://localhost:4003
Internal Approvalhttp://localhost:4004
General Affairshttp://localhost:4005
Management Dashboardhttp://localhost:4006
Inventoryhttp://localhost:4007
Module Managerhttp://localhost:4010
System Admin APIhttp://localhost:4100
System Admin UIhttp://localhost:4101
PostgreSQLlocalhost:5432
pgAdminhttp://localhost:5050 (admin@hereby.platform / admin123)
Redislocalhost:6379

Test Credentials

After make db-seed:

RoleEmailPassword
Adminadmin@hereby.comadmin123
Developerdev.lee@hereby.comdev123
HR Managerhr.kim@hereby.comhr123
Salessales.park@hereby.comsales123

After make db-seed-demo:

Demo hospital organization DEMO_HOSP with nurses, PTs, admin — all passwords demo1234!.

Common Commands

bash
# Development
pnpm dev                              # All servers
pnpm --filter @hereby/api dev         # API only
pnpm --filter @hereby/hr-system dev   # HR system only

# Build
pnpm build                            # All packages + apps

# Code Quality
pnpm lint:check                       # Check lint
pnpm lint:fix                         # Auto-fix lint issues
pnpm format                           # Format with Biome

# Testing
pnpm test                             # All tests
pnpm test:integration                 # Integration tests

# Database
make db-start / db-stop / db-restart
make db-migrate / db-seed / db-seed-demo / db-shell
make db-generate name=MigrationName    # generate a migration from the entity diff (wrapper)

# Migrations via raw TypeORM CLI (note the -d data-source flag)
pnpm --filter @hereby/database typeorm migration:create -- src/migrations/<Name>       # hand-written (empty) migration
pnpm --filter @hereby/database typeorm migration:show   -d src/config/data-source.ts   # list migrations ([ ] = pending)
pnpm --filter @hereby/database typeorm migration:revert -d src/config/data-source.ts   # undo the last migration

# Documentation
make docs-dev                         # Start docs dev server
make docs-build                       # Build docs site

Environment Variables

Key variables (see .env.example for full list):

bash
# Database
DB_HOST=localhost          DB_PORT=5432
DB_NAME=hereby_platform    DB_USERNAME=hereby_admin
DB_PASSWORD=<secure>
DB_SSL=false               # Enable for production

# Redis
REDIS_HOST=localhost       REDIS_PORT=6379

# JWT
JWT_SECRET=<long-secure>   JWT_EXPIRES_IN=24h

# API
API_PORT=3000

# Timezone
TZ=Asia/Seoul

# Notifications (optional)
FCM_SERVICE_ACCOUNT_KEY=<path>
WEB_PUSH_PUBLIC_KEY=<vapid-public>
WEB_PUSH_PRIVATE_KEY=<vapid-private>

# System Admin Tool — login uses an operator account (platformRole=OPERATOR)
# on the target endpoint; there is no env-based console account.
SYSADMIN_PORT=4100
SYSADMIN_JWT_SECRET=<secure>          # Signs console session tokens; required in prod
SYSADMIN_ALLOWED_IPS=                 # Comma-separated exact IPs (no CIDR); empty = localhost only

Running a Specific App

bash
# Web apps (standard)
pnpm --filter @hereby/hr-system dev
pnpm --filter @hereby/admin dev
pnpm --filter @hereby/employee-app dev

# Importer (CLI)
pnpm --filter @hereby/importer import --sheet=employees
pnpm --filter @hereby/importer import --sheet=payroll

# System Admin Tool (server + UI concurrently)
pnpm --filter @hereby/system-admin dev

# Employee App — Capacitor native builds
pnpm --filter @hereby/employee-app cap:sync
pnpm --filter @hereby/employee-app cap:ios
pnpm --filter @hereby/employee-app cap:android

Troubleshooting

Database connection fails

bash
docker-compose ps           # Check containers are running
make db-logs               # View PostgreSQL logs
make db-restart            # Restart everything

Build cache issues

bash
pnpm clean && pnpm install && pnpm build

Docs site warnings about missing deps

bash
pnpm --filter @hereby/docs install