HomeCare

Complete Bun-native monorepo foundation for a home-care platform.

Runtime apps

  • apps/api — Bun + Elysia REST/WebSocket API
  • apps/patient — Expo/React Native patient app
  • apps/caregiver — Expo/React Native caregiver app

Shared packages

  • packages/api-client — Elysia Eden client
  • packages/contracts — Zod contracts
  • packages/db — Drizzle/PostgreSQL
  • packages/auth — Better Auth boundary
  • packages/permissions — Cerbos boundary
  • packages/realtime — WebSocket event contracts
  • packages/storage — S3/MinIO
  • packages/domain — domain types

Development infrastructure

The main Compose stack includes:

  • PostgreSQL + PostGIS
  • Redis
  • NATS JetStream
  • Meilisearch
  • MinIO + automatic bucket initialization
  • ClickHouse
  • Cerbos
  • Valhalla
  • LiveKit
  • Coturn
  • OpenTelemetry Collector
  • Prometheus
  • Grafana
  • Jaeger
  • Loki

Temporal is included separately under infra/temporal/ because it is a substantial workflow subsystem with its own persistence. Start it only when you actually need durable workflows.

Start

cp .env.example .env
pnpm install

./scripts/dev-infra.sh
pnpm dev

Optional Temporal:

./scripts/dev-temporal.sh

Stop infrastructure:

./scripts/stop-infra.sh
./scripts/stop-temporal.sh

Mobile

The caregiver app already includes the Expo modules needed as a starting point for:

  • background location
  • camera
  • notifications
  • secure storage
  • SQLite

Production iOS/Android configuration still needs real bundle IDs, signing, APNs/FCM credentials, background-location configuration, CallKit/Android Telecom integration, and your privacy/consent policies.

WebRTC

LiveKit is configured for local development and Coturn is included as a separate TURN service. The LiveKit and Coturn networking configuration is intentionally development-oriented.

For production, put LiveKit/TURN on appropriate publicly reachable infrastructure and configure TLS, public IPs, firewall rules, DNS, and a proper relay port range.

Recording

LiveKit recording/Egress should write to MinIO/S3. Add the Egress service/config when implementing recording. Keep recording metadata and consent state in PostgreSQL; authorize access through Cerbos and issue short-lived signed storage URLs.

Security

All credentials in .env.example are development credentials. Replace them before any shared or production deployment.