2026-02-17 09:07:15 -06:00
|
|
|
# Developing
|
|
|
|
|
|
|
|
|
|
This project can run fully in local dev without setting up PostgreSQL manually.
|
|
|
|
|
|
|
|
|
|
## Prerequisites
|
|
|
|
|
|
|
|
|
|
- Node.js 20+
|
|
|
|
|
- pnpm 9+
|
|
|
|
|
|
|
|
|
|
## Start Dev
|
|
|
|
|
|
|
|
|
|
From repo root:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
pnpm install
|
|
|
|
|
pnpm dev
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
This starts:
|
|
|
|
|
|
|
|
|
|
- API server: `http://localhost:3100`
|
2026-02-18 11:45:43 -06:00
|
|
|
- UI: served by the API server in dev middleware mode (same origin as API)
|
2026-02-17 09:07:15 -06:00
|
|
|
|
|
|
|
|
## Database in Dev (Auto-Handled)
|
|
|
|
|
|
|
|
|
|
For local development, leave `DATABASE_URL` unset.
|
2026-02-18 11:45:43 -06:00
|
|
|
The server will automatically use embedded PostgreSQL and persist data at:
|
2026-02-17 09:07:15 -06:00
|
|
|
|
2026-02-18 11:45:43 -06:00
|
|
|
- `./data/embedded-postgres`
|
2026-02-17 09:07:15 -06:00
|
|
|
|
|
|
|
|
No Docker or external database is required for this mode.
|
|
|
|
|
|
|
|
|
|
## Quick Health Checks
|
|
|
|
|
|
|
|
|
|
In another terminal:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
curl http://localhost:3100/api/health
|
|
|
|
|
curl http://localhost:3100/api/companies
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Expected:
|
|
|
|
|
|
|
|
|
|
- `/api/health` returns `{"status":"ok"}`
|
|
|
|
|
- `/api/companies` returns a JSON array
|
|
|
|
|
|
|
|
|
|
## Reset Local Dev Database
|
|
|
|
|
|
|
|
|
|
To wipe local dev data and start fresh:
|
|
|
|
|
|
|
|
|
|
```sh
|
2026-02-18 11:45:43 -06:00
|
|
|
rm -rf server/data/embedded-postgres
|
2026-02-17 09:07:15 -06:00
|
|
|
pnpm dev
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Optional: Use External Postgres
|
|
|
|
|
|
2026-02-18 11:45:43 -06:00
|
|
|
If you set `DATABASE_URL`, the server will use that instead of embedded PostgreSQL.
|