Stripe powers the subscription billing system in Dopamine Starter Kit, providing robust payment processing, subscription management, and per-seat billing capabilities. This guide covers the complete integration from setup to advanced features.
Architecture Overview
Billing System Components
The Dopamine billing system consists of several integrated components:
┌─────────────────┐ ┌──────────────────┐ ┌─────────────┐
│ Frontend (Web) │ ──▶ │ API Controller │ ──▶ │ Stripe API │
└─────────────────┘ └──────────────────┘ └─────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌──────────────────┐ ┌─────────────┐
│ Checkout UI │ │ Stripe Service │ │ Webhooks │
└─────────────────┘ └──────────────────┘ └─────────────┘
│
▼
┌──────────────────┐
│ Database Models │
└──────────────────┘
Database Schema
The subscription system uses these core models:
- Subscription: Main subscription records with Stripe IDs
- Workspace: Organizations that hold subscriptions
- WorkspaceMember: Per-seat billing calculation basis
- User: Subscription owners and workspace members