Skip to content

Local Development

Local mode differs from Compose in two ways: there is no nginx (each app uses its own port) and the database defaults to SQLite (no Postgres needed). Everything else is the same — especially NATS, which is not optional.

RequirementVersionCheck
Go1.25+go version
Node.js22+node -v
pnpm10+pnpm -v
NATS Server2.10+, JetStream enablednats-server --version

Docker works for NATS too:

终端窗口
docker run --rm -p 4222:4222 -p 8222:8222 nats:2.10-alpine -js -m 8222
终端窗口
# Run from the repository root
pnpm install

The backend reads .env and .env.<env> from app/server/, with the latter overriding.

PORT=8080
DB_TYPE=sqlite
NATS_URL=nats://127.0.0.1:4222
LOG_LEVEL=debug
LOG_FORMAT=text
  • Empty DB_DSN puts SQLite at app/server/db/app.db
  • For Postgres: DB_TYPE=postgres and DB_DSN="host=127.0.0.1 user=… dbname=… port=5432 sslmode=disable"
  • The first boot seeds an admin; set ADMIN_PASSWORD=admin123 to know it up front
终端窗口
cd app/server
go run main.go -e dev

A healthy start looks like:

level=info msg="seeded 61 permissions"
level=info msg="permission cache loaded"
level=info msg="server listening" port=8080

go run main.go dev fails with unknown command — the environment is selected only via -e.

In a second terminal, from the repository root:

终端窗口
pnpm dev:web

The frontend talks to http://localhost:8080 by default. Open the URL printed by vinext (usually http://localhost:3000) and sign in as admin with the password from step 2.

CheckExpected
curl -s localhost:8080/api/v1/healthcode: 0
Open the frontend timelinePosts render
Sign in → /adminDashboard renders
Publish a postIt appears immediately (async moderation)
终端窗口
pnpm dev:server # backend
pnpm dev:web # frontend and workspace packages
pnpm dev:docs # this documentation site
bash feedchamber_test.sh -all # API regression, backend must be running
pnpm check # format, lint, and type checks
终端窗口
rm -f app/server/db/app.db

The next boot re-seeds roles, permissions, spaces, tags, and the admin account.

SymptomCauseFix
NATS_URL is requiredNATS is not runningStart nats-server -js first
failed to initialize databaseBad DSN or Postgres is downTest the connection with psql
Frontend loops on 401Backend down or wrong portCheck /api/v1 responses in the browser
Cookie not storedNot using localhostUse localhost, or set MASTER_COOKIE_SECURE=false
Port already in use8080 or 3000 takenPORT=8081; check vinext’s output for the frontend

More in Troubleshooting.