- stripe_service: checkout sessions, webhook handling, subscription CRUD
- tier_manager: feature matrix (4 tiers), quota enforcement, rate limits
- routes: checkout, webhook (no auth), subscription, tier query, features
- Traefik header auth (X-User-Id) replaces get_current_user dependency
- /tier/{user_id} endpoint for internal service-to-service lookups
- /features and /features/{tier} for feature matrix queries
- Dockerfile: single worker, 30s timeout (lightweight service)
Billing Service
Owns: Stripe integration, tier management, subscription CRUD.
Tables owned (write)
subscriptions
Endpoints
POST /billing/checkoutPOST /billing/webhook(Stripe, no JWT auth)GET /billing/subscriptionDELETE /billing/subscription
Redis channels
- Publish:
tier:changed:{user_id}on tier change