Skip to content

Local Setup

Prerequisites

  • Node.js 20+ (download)
  • pnpm 9+ (npm install -g pnpm)
  • Docker (download) — for PostgreSQL

First-Time Setup

bash
git clone https://github.com/sohaibfaroukh/derma-consent.git
cd derma-consent
make dev

make dev is an all-in-one command that runs make setup (install, DB, migrations) and starts both dev servers.

What make setup Does

  1. Creates .env from .env.example if it doesn't exist
  2. Runs pnpm install --recursive
  3. Starts PostgreSQL via docker compose up -d
  4. Pushes the Prisma schema to the database (prisma db push)
  5. Generates the Prisma client (prisma generate)

Makefile Targets

TargetDescription
make devFull setup + start dev servers
make setupInstall deps, start DB, run migrations
make dbStart PostgreSQL only
make db-stopStop PostgreSQL
make migratePush Prisma schema to DB
make generateRegenerate Prisma client
make seedSeed DB with test data
make testRun all tests
make test-backendRun backend tests (Jest)
make test-frontendRun frontend tests (Vitest)
make buildProduction build
make cleanRemove node_modules, dist, .next, Docker volumes
make kill-portsFree ports 3000 and 3001
make docsStart documentation dev server

Running Individual Packages

bash
# Backend only
pnpm --filter @derma-consent/backend dev

# Frontend only
pnpm --filter @derma-consent/frontend dev

Ports

ServicePort
Frontend3000
Backend3001
PostgreSQL5433 (mapped from Docker)

Seed Data

After running make seed, you get two test practices with users, patients, and consent forms. All passwords are Test1234!. See docs/TEST-CREDENTIALS.md for the full list.

DSGVO-konforme digitale Einwilligungen