Hallo Stroke

Local Development

Running frontend and backend without Docker for development.

Backend (Go)

cd Hallo-Stroke-Backend
go mod download
cp .env.example .env
# fill DATABASE_URI, JWT secrets, API keys, WhatsApp creds, AES key, VAPID keys

Either install Postgres 18 locally or start just the db service:

docker compose up -d db
go run cmd/main.go

AutoMigrate runs on startup. The scheduler goroutine starts automatically.

Open http://localhost:3001/swagger for interactive API docs.

Regenerating Swagger

Swagger artifacts live in docs/ (docs.go, swagger.json, swagger.yaml). Regenerate with swag init after annotating handlers.

Frontend (React)

cd hallo-stroke-bunny
npm install
cp .env.development .env
# set REACT_APP_API_BASE_URL to your local backend (default :3001/api)
npm start   # CRA, http://localhost:3000

The dev server proxies nothing — it calls the backend directly via REACT_APP_API_BASE_URL. Make sure the backend CORS allowlist includes http://localhost:3000 (it does by default).

Debugging tips

  • 401 loop: the axios interceptor retries once then redirects. Check that /api/refresh works and that JWT_REFRESH_SECRET matches between sessions.
  • Images not loading: confirm REACT_APP_MEDIA_BASE points to the backend host serving /uploads/*.
  • Push not working: service workers are unregistered on load (src/index.js) — this is intentional cache-clearing, but it makes web push fragile in dev.
  • Reminders not firing: the scheduler ticks every 20s; check logs/app.log and that the user's timezone is set (default Asia/Makassar).

On this page