Appearance
Initial setup
Prerequisites
- Node.js 20 or later
- PostgreSQL 14 or later
- A terminal with access to the server where IDVIZE will run
Environment variables
Create a .env file in the idvize-api directory. The minimum required variables:
| Variable | Purpose | Example |
|---|---|---|
DATABASE_URL | PostgreSQL connection string | postgresql://idvize:secret@localhost:5432/idvize |
JWT_SECRET | Secret for signing authentication tokens (HS256, min 32 chars) | A random string |
JWT_SIGNING_SECRET | Secret for signing plan approval hashes (HMAC-SHA-256) | A different random string |
API_KEY | Key for API-key-authenticated endpoints | A random string |
SEED_MODE | production (empty database), demo or development (sample data) | production |
Optional but recommended:
| Variable | Purpose |
|---|---|
ANTHROPIC_API_KEY | Enables AI-assisted cost analysis and plan review. Without it, AI features degrade gracefully. |
PORT | API server port. Defaults to 3001. |
CORS_ORIGINS | Comma-separated list of allowed frontend origins. |
CONTINUOUS_ASSESSMENT_INTERVAL_MINUTES | How often the assessment sweep runs. Default 60. Set to 0 to disable. |
WARNING
Never commit .env files to source control. The .gitignore already excludes them.
Database setup
IDVIZE manages its own schema. On first start the API creates all tables, indexes and row-level security policies automatically.
bash
# Create the database and two roles
psql -U postgres -c "CREATE ROLE idvize_owner WITH LOGIN PASSWORD 'owner-secret';"
psql -U postgres -c "CREATE ROLE idvize_app WITH LOGIN PASSWORD 'app-secret';"
psql -U postgres -c "CREATE DATABASE idvize OWNER idvize_owner;"Set DATABASE_URL to the owner connection (used for migrations) and DATABASE_APP_URL to the app connection (used at runtime, with RLS enforced). If only DATABASE_URL is set, both pools use the same connection.
First start
bash
cd idvize-api
npm install
npm run devThe server:
- Runs schema migrations (creates or updates all 37 tables).
- Applies row-level security policies and grants.
- If
SEED_MODE=demo, loads sample tenants, users and applications. - Starts listening on the configured port.
First tenant (production mode)
In production mode, no data is loaded. Create the first tenant through the API:
bash
curl -X POST http://localhost:3001/v1/tenants \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{
"name": "Acme Corp",
"domain": "acme.com",
"plan": "enterprise"
}'Then create the first PlatformAdmin user. See Users and roles.
Frontend
bash
cd idvize
npm install
npm run devThe frontend starts on port 5173 by default and connects to the API at http://localhost:3001. To change the API URL, set VITE_API_BASE_URL in idvize/.env.
Health check
GET /healthReturns the running commit, branch, server start time and uptime. Unauthenticated — suitable for load balancer probes.