mirror of
https://github.com/temetro/temetro.git
synced 2026-07-28 20:58:57 +00:00
ef76afc3ca
Devices no longer connect to the backend directly. The /wallet Socket.io namespace is removed from realtime.ts; a new services/relay-client.ts connects to the standalone Temetro Network relay's /hub namespace (RELAY_TOKEN-auth), emitToWallet delegates to its sendToWallet, and device responses + wallet:online replay are handled there via the same wallet-share/wallet-updates services. - Add RELAY_URL + RELAY_TOKEN env (env.ts, .env.example, docker-compose.yml); the wallet-import QR (resolveRelayUrl) now points at RELAY_URL. - Add socket.io-client dependency. - Document the Temetro Network folder/service in root + backend CLAUDE.md. - Bump root/backend/frontend to 0.7.0; CHANGELOG entry. The relay service itself lives in github.com/temetro/temetro-network. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
57 lines
2.6 KiB
Bash
57 lines
2.6 KiB
Bash
# --- Database -------------------------------------------------------------
|
|
# When running via docker compose, "db" is the Postgres service hostname.
|
|
# For running the backend directly on your host, use localhost:5432.
|
|
DATABASE_URL=postgres://temetro:temetro@db:5432/temetro
|
|
|
|
# --- Better Auth ----------------------------------------------------------
|
|
# Generate a strong secret (min 32 chars): openssl rand -base64 32
|
|
BETTER_AUTH_SECRET=replace-me-with-openssl-rand-base64-32
|
|
# Public base URL of THIS backend (used for auth callbacks & cookies).
|
|
BETTER_AUTH_URL=http://localhost:4000
|
|
|
|
# Directory for uploaded patient/lab files. Defaults to ./uploads in local dev;
|
|
# in Docker it's a persistent volume (see docker-compose.yml).
|
|
UPLOAD_DIR=./uploads
|
|
|
|
# --- AI ------------------------------------------------------------------
|
|
# Key used to encrypt at-rest AI provider API keys (per-user, set in the app's
|
|
# Settings → AI). Generate one: openssl rand -base64 32. Rotating it forces
|
|
# users to re-enter their provider keys.
|
|
AI_CREDENTIALS_KEY=replace-me-with-openssl-rand-base64-32
|
|
|
|
# --- App ------------------------------------------------------------------
|
|
# The frontend origin — used for CORS, Better Auth trustedOrigins, and the
|
|
# links embedded in verification / reset / invitation emails.
|
|
FRONTEND_URL=http://localhost:3000
|
|
PORT=4000
|
|
NODE_ENV=development
|
|
|
|
# Host ports docker compose publishes. Change any that are already in use on
|
|
# this machine (the services still talk to each other on their internal ports).
|
|
POSTGRES_PORT=5432
|
|
BACKEND_PORT=4000
|
|
FRONTEND_PORT=3000
|
|
|
|
# --- Temetro Network relay ------------------------------------------------
|
|
# The standalone relay (github.com/temetro/temetro-network) that connects this
|
|
# backend to patient phones. Deploy it (e.g. on Railway) and point both this
|
|
# backend and the wallet app at it. RELAY_URL is the relay's public URL (also
|
|
# baked into the QR a patient scans); RELAY_TOKEN is a shared secret this
|
|
# backend presents on the relay's /hub namespace — set the SAME value here and
|
|
# on the relay. Generate one with: openssl rand -base64 32
|
|
RELAY_URL=http://localhost:8080
|
|
RELAY_TOKEN=
|
|
|
|
# (Legacy, pre-relay self-hosting.) A phone-reachable URL for the QR when NOT
|
|
# using the Temetro Network relay. RELAY_URL takes precedence over this.
|
|
# PUBLIC_RELAY_URL=http://192.168.1.20:4000
|
|
|
|
# --- Email (optional) -----------------------------------------------------
|
|
# If SMTP_HOST is unset, emails (verify/reset/invite) are printed to the
|
|
# server console instead of being sent — zero setup for local development.
|
|
# SMTP_HOST=smtp.example.com
|
|
# SMTP_PORT=587
|
|
# SMTP_USER=
|
|
# SMTP_PASS=
|
|
# SMTP_FROM="temetro <no-reply@temetro.local>"
|