rubis/apps/api/.env.example
ordinarthur ff8fe64be2
All checks were successful
Build & Deploy Web / build-and-deploy (push) Successful in 1m1s
Build & Deploy API / build-and-deploy (push) Successful in 2m3s
feat(mail): templates HTML React Email + brand "Rubis sur l'ongle"
Templates HTML stylés DA Rubis pour les 2 emails sortants — fini le
plain text moche.

apps/api/app/mails/
  ├── _brand.ts          : tokens couleur + spacing partagés
  ├── _layout.tsx        : squelette commun (header rubis-deep + footer)
  ├── checkin_email.tsx  : email envoyé À L'USER avec 2 boutons CTA
  │                        Oui (rubis primary) / Non (outlined)
  └── relance_email.tsx  : email envoyé AU CLIENT, body texte du plan
                           + card récap (numéro, montant, échéance,
                           badge retard rubis-deep)

Stack :
  - @react-email/components + @react-email/render
  - Tous les styles inline (compatible Gmail / Outlook / Apple Mail)
  - HTML + plain text en fallback (anti-spam, accessibility)

mail_dispatcher.ts :
  - sendRelanceEmail : .html(rendered) + .text(body)
  - sendCheckinEmail : .html(rendered) + .text(body)
  - daysLate calculé via clock.now (démo-aware)

send_test_email :
  - Nouveau flag --template=checkin (default) | relance | plain pour
    tester chaque rendu via Mailpit sans créer de vraie facture.

Brand & landing :
  - "Rubis Sur l'Ongle" → "Rubis sur l'ongle" partout (config, mail,
    PDF, Stripe appInfo)
  - Nouvelle env var LANDING_URL (default https://rubis.arthurbarre.fr)
  - Footer email rend "Rubis sur l'ongle" comme <a> rubis cliquable
    vers la landing — l'user qui reçoit le mail connaît la marque
    derrière l'envoi
  - .env.example mis à jour avec LANDING_URL pour les autres devs

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:10:27 +02:00

111 lines
4.0 KiB
Plaintext

# Node
TZ=UTC
PORT=3333
HOST=0.0.0.0
NODE_ENV=development
# App
LOG_LEVEL=info
APP_KEY=
# APP_URL est l'URL publique (utilisée dans les emails check-in/relance,
# les redirects, etc.). Volontairement découplée de HOST : on bind sur
# 0.0.0.0 mais on expose `localhost` (en dev) ou le vrai domaine (en prod).
APP_URL=http://localhost:3333
# Session
SESSION_DRIVER=cookie
#--------------------------------------------------------------------
# CORS (configure allowed origins for API access)
#--------------------------------------------------------------------
# CORS_ORIGIN=http://localhost:5173,http://localhost:3000
#--------------------------------------------------------------------
# Database (Postgres via docker-compose.dev.yml)
#--------------------------------------------------------------------
DB_CONNECTION=postgres
PG_HOST=localhost
PG_PORT=5433
PG_USER=rubis
PG_PASSWORD=rubis
PG_DB_NAME=rubis_dev
#--------------------------------------------------------------------
# Redis (BullMQ + cache)
#--------------------------------------------------------------------
REDIS_HOST=localhost
REDIS_PORT=6380
REDIS_PASSWORD=
#--------------------------------------------------------------------
# Storage (MinIO via S3 driver)
#--------------------------------------------------------------------
DRIVE_DISK=s3
S3_ENDPOINT=http://localhost:9100
S3_REGION=fr-par
S3_BUCKET=rubis-invoices
S3_ACCESS_KEY=rubis
S3_SECRET_KEY=rubis-dev-secret
S3_FORCE_PATH_STYLE=true
#--------------------------------------------------------------------
# Mail (Resend par défaut, Mailpit en fallback dev via MAIL_DRIVER=smtp)
#--------------------------------------------------------------------
MAIL_FROM_ADDRESS=rubis@arthurbarre.fr
MAIL_FROM_NAME=Rubis sur l'ongle
MAIL_DRIVER=resend
RESEND_API_KEY=
# Fallback Mailpit (si MAIL_DRIVER=smtp)
SMTP_HOST=localhost
SMTP_PORT=1025
#--------------------------------------------------------------------
# OCR (Mistral)
#--------------------------------------------------------------------
OCR_PROVIDER=mistral
MISTRAL_API_KEY=
#--------------------------------------------------------------------
# Web (URL du SPA, utilisée pour les redirects post-checkin)
#--------------------------------------------------------------------
WEB_URL=http://localhost:5173
#--------------------------------------------------------------------
# Landing publique — lien dans le footer des emails ("Rubis sur l'ongle"
# pointe vers ce domaine).
#--------------------------------------------------------------------
LANDING_URL=https://rubis.arthurbarre.fr
#--------------------------------------------------------------------
# Auth (refresh tokens)
#--------------------------------------------------------------------
ACCESS_TOKEN_TTL_MINUTES=30
REFRESH_TOKEN_TTL_DAYS=30
COOKIE_DOMAIN=
COOKIE_SECURE=false
#--------------------------------------------------------------------
# Google SSO (Ally) — créer un OAuth Client ID web sur Google Cloud
# Console, puis ajouter les redirect URIs :
# - http://localhost:3333/api/v1/auth/google/callback (dev)
# - https://app.rubis.arthurbarre.fr/api/v1/auth/google/callback (prod)
#--------------------------------------------------------------------
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_CALLBACK_URL=http://localhost:3333/api/v1/auth/google/callback
#--------------------------------------------------------------------
# Microsoft SSO (Ally) — App registration sur https://portal.azure.com
# (Microsoft Entra ID → App registrations → New registration → Web),
# redirect URIs à enregistrer :
# - http://localhost:3333/api/v1/auth/microsoft/callback (dev)
# - https://app.rubis.arthurbarre.fr/api/v1/auth/microsoft/callback (prod)
# Tenant : 'common' (work + perso), 'organizations' (M365 only) ou un GUID.
#--------------------------------------------------------------------
MICROSOFT_CLIENT_ID=
MICROSOFT_CLIENT_SECRET=
MICROSOFT_TENANT=common
MICROSOFT_CALLBACK_URL=http://localhost:3333/api/v1/auth/microsoft/callback
LIMITER_STORE=redis