My App

Environnements

Dev, staging, production — configuration et déploiement

Environnements

EnvURLDBUsage
devlocalhost:3001 (web) / localhost:3000 (api)Docker localDéveloppement
stagingstaging.wcare.frPostgreSQL dédiéTests avant prod
productionapp.wcare.frPostgreSQL prodUtilisateurs réels

Variables d'environnement

Server (apps/server/.env)

VariableDevProdDescription
DATABASE_URLpostgresql://postgres:password@localhost:5432/wcareSecretConnexion PostgreSQL
BETTER_AUTH_SECRETGénéré localementSecret (32+ chars)Secret de session
BETTER_AUTH_URLhttp://localhost:3000https://api.wcare.frURL du serveur auth
CORS_ORIGINhttp://localhost:3001https://app.wcare.frOrigine autorisée
RESEND_API_KEYKey de testKey de prodAPI Resend pour emails
WHATSAPP_TOKENSecretToken WhatsApp Business API
WHATSAPP_PHONE_IDSecretPhone number ID Meta

Web (apps/web/.env)

VariableDevProd
NEXT_PUBLIC_SERVER_URLhttp://localhost:3000https://api.wcare.fr

Déploiement

Infrastructure cible

Dokploy (Proxmox VM)
├── Traefik (reverse proxy, SSL auto)
├── wcare-web (Next.js, port 3001)
├── wcare-api (Elysia/Bun, port 3000)
└── wcare-db (PostgreSQL, port 5432)

Scripts

bun dev              # Web + Server en parallèle
bun build            # Build tous les packages
bun db:start         # Docker up PostgreSQL
bun db:push          # Push schema Drizzle
bun db:studio        # Drizzle Studio (GUI)
bun db:migrate       # Run migrations

CI/CD (GitHub Actions)

À mettre en place.

Pipeline cible :

  1. Lintbiome check
  2. Type-checkbun run check-types
  3. Buildbun run build
  4. Deploy — Push vers Dokploy (staging ou prod selon la branche)

On this page