Files
cloud/LOCAL_NO_DOCKER.md
Первов Артем 123bd97018 cloud creation
2026-06-17 09:36:58 +03:00

2.4 KiB

Local Run Without Docker

You can run the API without Docker. The application only needs Node.js and a PostgreSQL database with the TimescaleDB extension installed.

Requirements

  • Node.js 22+
  • PostgreSQL 17 or 18
  • TimescaleDB extension installed into that PostgreSQL instance
  • psql available in your terminal

Official TimescaleDB docs for Windows describe installing PostgreSQL, running the TimescaleDB installer, restarting the PostgreSQL service, and enabling the extension with:

CREATE EXTENSION IF NOT EXISTS timescaledb;

Docs: https://docs.tigerdata.com/self-hosted/latest/install/installation-windows/

1. Create local database

Open PowerShell and run:

createdb -h localhost -p 5432 -U postgres drill_cloud_v2

If createdb is not in PATH, add your PostgreSQL bin directory, for example:

$env:Path += ";C:\Program Files\PostgreSQL\17\bin"

2. Enable TimescaleDB

psql -h localhost -p 5432 -U postgres -d drill_cloud_v2 -c "CREATE EXTENSION IF NOT EXISTS timescaledb;"

Check it:

psql -h localhost -p 5432 -U postgres -d drill_cloud_v2 -c "\dx"

You should see timescaledb in the extension list.

3. Configure app env

Copy-Item .env.local.example .env

Edit .env if your local PostgreSQL password, port, or database name differs:

DATABASE_URL=postgres://postgres:postgres@localhost:5432/drill_cloud_v2

4. Install and migrate

npm install
npm run migrate

5. Start API

npm run start:dev

The API starts on:

http://localhost:3100

Health check:

Invoke-RestMethod http://localhost:3100/health

Useful local checks

Send one point:

Invoke-RestMethod `
  -Method Post `
  -Uri http://localhost:3100/ingest `
  -Headers @{ "x-api-key" = "dev-local-key" } `
  -ContentType "application/json" `
  -Body '[{"edge":"roman","tag":"test_tag","time":"2026-06-15T12:00:00Z","value":42}]'

Read current:

Invoke-RestMethod "http://localhost:3100/current?edge=roman"

Read chart data:

Invoke-RestMethod "http://localhost:3100/history?edge=roman&tags=test_tag&from=2026-06-15T00:00:00Z&to=2026-06-16T00:00:00Z"

Note

The old remote database you gave me does not currently have TimescaleDB enabled. To run this v2 schema there, an admin user must install/allowlist TimescaleDB and run the migrations.