Add Stripe subscription billing integration

- Add stripe_customer_id and stripe_subscription_id fields to User model
- Add Stripe config settings (secret key, publishable key, price ID, webhook secret)
- Create billing API endpoints: checkout session, webhook handler, portal, status
- Add frontend Billing page with upgrade/manage subscription UI
- Add billing route and Pro nav link
- Add stripe dependency to requirements
This commit is contained in:
root
2026-03-30 21:38:40 -05:00
parent 58c17498be
commit b97955d004
7 changed files with 360 additions and 1 deletions

View File

@@ -18,6 +18,10 @@ class User(Base):
DateTime(timezone=True), default=lambda: datetime.now(timezone.utc)
)
# Stripe
stripe_customer_id: Mapped[str | None] = mapped_column(String(255), nullable=True, unique=True)
stripe_subscription_id: Mapped[str | None] = mapped_column(String(255), nullable=True)
# Spotify OAuth
spotify_id: Mapped[str | None] = mapped_column(String(255), nullable=True, unique=True)
spotify_access_token: Mapped[str | None] = mapped_column(Text, nullable=True)