# PostgreSQL API Mode

Sprint 3 introduces a dual-mode server.

## Local mode

```bash
DATA_MODE=local npm start
```

Uses:

```text
server-local.js
data/db.json
```

This is for local demo only.

## PostgreSQL mode

```bash
DATA_MODE=postgres DATABASE_URL=postgresql://... npm start
```

Uses:

```text
server-postgres.js
PostgreSQL database
```

This is the online/shared data mode. All browsers and admins use the same database.

## Setup

```bash
npm install
npm run db:migrate
npm run db:seed
DATA_MODE=postgres npm start
```

## Production safety

If `NODE_ENV=production`, local mode is blocked.

