Skip to content

Setup ​

Prerequisites ​

  • Docker & Docker Compose
  • Go 1.25+
  • Node.js 22+

1. Infrastructure ​

From project root:

bash
cd infra
docker compose up -d

PostgreSQL and ScyllaDB run init scripts on first start. Wait for ScyllaDB healthy (or run the scylla-init service once).

2. Backend ​

bash
cd backend
cp .env.example .env
go run ./cmd/server

Env (see .env.example): SERVER_PORT, POSTGRES_DSN, SCYLLA_HOSTS, SCYLLA_KEYSPACE, REDIS_ADDR, REDIS_PASSWORD, JWT_SECRET. Optional: STATIC_DIR to serve the built frontend (single-origin); ALLOWED_ORIGINS (comma-separated list of allowed Origin headers for the WebSocket upgrade — required for cross-origin dev, e.g. http://localhost:5173,http://localhost:4500).

API: http://localhost:4500 (dev)

3. Frontend ​

No env needed (single-origin: relative /api and /ws).

bash
cd frontend
npm install
npm run dev

App: http://localhost:5173. Vite proxies /api and /ws to the backend.

E2EE setup / restore (dev) ​

On first visit to /chat per browser profile, the app will require an E2EE key:

  • If the account has an encrypted backup on the server, it will prompt to restore it.
  • Otherwise it will prompt to set a passphrase and upload an encrypted backup.

Single-origin production ​

Build frontend, then serve from backend:

bash
cd frontend && npm run build
cd ../backend && cp -r ../frontend/dist web
# set STATIC_DIR=web in .env, or: STATIC_DIR=web go run ./cmd/server

One origin (prod-style): open http://localhost:4500 to start the chat 😄