Studio API Local Runtime Slice
Date: 2026-05-05
Objective
Make the imported legacy studio-api reproducible locally without touching blinkin-2-platform.
This is the first service-level proof for the Hetzner rebuild. It does not yet mean the full platform is running end to end.
What Was Added
configs/local/studio-api.env.exampleLocal-only placeholder values for Postgres, Redis, Studio URLs, Houston URLs, and optional external services.scripts/studio-api-local.mjsSmall helper for install, build, migration, start, and health checks.package.jsonscripts:studio-api:installstudio-api:buildstudio-api:migratestudio-api:startstudio-api:health
The helper prefers Homebrew node@20 when available, because the legacy Dockerfile uses node:20-slim.
Local Commands
Start the shared local infrastructure first:
npm run legacy:infra:up
Install Studio API dependencies:
npm run studio-api:install
Build Studio API:
npm run studio-api:build
Run Studio API migrations:
npm run studio-api:migrate
Start Studio API:
npm run studio-api:start
In another terminal, check health:
npm run studio-api:health
Expected health response:
{"statusCode":200,"message":null,"data":{"status":"Ok"}}
Verification Evidence
PUPPETEER_SKIP_DOWNLOAD=1 HUSKY=0 npm cicompleted insidelegacy-src/studio-api.npm run studio-api:buildpassed.- The first
studio-apimigration run applied 84 pending legacy migrations to the localstudio_apiPostgres database. - A second
npm run studio-api:migratereturnedNo migrations are pending. npm run studio-api:startlaunched the API onlocalhost:18000.npm run studio-api:healthreturned HTTP 200 withdata.statusset toOk.npm run legacy:verifystill passes after the local build artifacts were created.
Important Findings
The global machine default is Node v25.4.0. The built API does not start on Node 25 because a legacy dependency chain reaches buffer-equal-constant-time, which expects SlowBuffer.prototype.
The legacy Dockerfile uses:
FROM node:20-slim AS builder
So the local helper uses Homebrew node@20 when it exists. On this machine that is:
/opt/homebrew/opt/node@20/bin/node
Security And Cleanup Notes
- No real
.envfile was created forstudio-api. - The local env template contains placeholders only.
- Real local override files matching
configs/local/*.envare ignored by.gitignore. npm cireported 87 vulnerabilities in the legacy dependency tree. This is expected legacy risk and needs a later dependency-hardening slice before production.
Not Yet Done
- Auth0-backed login was not tested locally.
- Protected Studio and Houston routes were not exercised.
- Media upload/storage is not wired to a Hetzner-ready replacement yet.
- Studio API is not containerized in the new project yet.
- Picasso FE and Zweistein are not wired to this local API yet.