feat: account-based subscription tiers (Free/Pro/Team) #32

Merged
chihlasm merged 5 commits from feat/subscription-tiers into main 2026-02-07 08:18:39 +00:00
chihlasm commented 2026-02-07 07:41:09 +00:00 (Migrated from github.com)

Summary

  • Transition from team-based to account-based multi-tenancy with subscription tiers (Free/Pro/Team)
  • 5 database migrations (016-020) create accounts, subscriptions, plan_limits, account_invites tables and migrate all existing data
  • Registration now atomically creates User + Account + free Subscription; account_invite_code bypasses the platform invite gate
  • All endpoints, schemas, permissions, and frontend updated: team_id → account_id, is_team_admin → account_role (owner/engineer/viewer)
  • New endpoints: /accounts/me/* (8 routes), /webhooks/stripe (stub)
  • New frontend: AccountSettingsPage, UpgradePrompt, CheckoutButton, useSubscription hook
  • Stripe SDK installed (backend + frontend) with optional config — webhook handler stubbed
  • Old team_id/is_team_admin columns kept in DB for safe coexistence (cleaned up in follow-up PR B)
  • Fix: folder sidebar now refreshes after tree deletion

Test plan

  • 82 backend tests passing (18 new: accounts, subscriptions, permissions)
  • Frontend TypeScript build clean (zero errors)
  • Manual smoke test: register → login → create trees → hit free limit (402) → account settings page
  • Verify migrations apply cleanly on fresh DB (alembic upgrade head)
  • Verify account invite flow: owner creates invite → new user registers with code → joins account

🤖 Generated with Claude Code

## Summary - Transition from team-based to account-based multi-tenancy with subscription tiers (Free/Pro/Team) - 5 database migrations (016-020) create accounts, subscriptions, plan_limits, account_invites tables and migrate all existing data - Registration now atomically creates User + Account + free Subscription; account_invite_code bypasses the platform invite gate - All endpoints, schemas, permissions, and frontend updated: team_id → account_id, is_team_admin → account_role (owner/engineer/viewer) - New endpoints: `/accounts/me/*` (8 routes), `/webhooks/stripe` (stub) - New frontend: AccountSettingsPage, UpgradePrompt, CheckoutButton, useSubscription hook - Stripe SDK installed (backend + frontend) with optional config — webhook handler stubbed - Old team_id/is_team_admin columns kept in DB for safe coexistence (cleaned up in follow-up PR B) - Fix: folder sidebar now refreshes after tree deletion ## Test plan - [x] 82 backend tests passing (18 new: accounts, subscriptions, permissions) - [x] Frontend TypeScript build clean (zero errors) - [ ] Manual smoke test: register → login → create trees → hit free limit (402) → account settings page - [ ] Verify migrations apply cleanly on fresh DB (`alembic upgrade head`) - [ ] Verify account invite flow: owner creates invite → new user registers with code → joins account 🤖 Generated with [Claude Code](https://claude.com/claude-code)
railway-app[bot] commented 2026-02-07 07:41:25 +00:00 (Migrated from github.com)

🚅 Deployed to the patherly-pr-32 environment in selfless-grace

Service Status Web Updated (UTC)
hopeful-liberation Success (View Logs) Web Feb 7, 2026 at 8:07 am
patherly Success (View Logs) Web Feb 7, 2026 at 8:07 am
<!-- railway-bot-comment-version=2 --> <!-- railway-project-id="22b9b58c-271b-42e5-a10e-6fdec8d00134" railway-project-name="selfless-grace" --> 🚅 Deployed to the [patherly-pr-32](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134?environmentId=7b0cc9ee-f9b0-4e91-80ca-ac93e1e32507) environment in **[selfless-grace](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134)** | **Service** | **Status** | **Web** | **Updated** (UTC) | | :--- | :--- | :--- | :--- | | hopeful-liberation | ✅ Success ([View Logs](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134/service/e1db2ee3-d241-4f45-abe4-c9c5fdf483d5?id=39a90993-aa2e-4121-9cd8-05b24c27d015&environmentId=7b0cc9ee-f9b0-4e91-80ca-ac93e1e32507)) | [Web](https://hopeful-liberation-patherly-pr-32.up.railway.app) | Feb 7, 2026 at 8:07 am | | patherly | ✅ Success ([View Logs](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134/service/95f556ff-5264-4116-a0c2-618a2fc53ba4?id=3e90e1ff-eb49-449c-86ed-4e0fc58a0324&environmentId=7b0cc9ee-f9b0-4e91-80ca-ac93e1e32507)) | [Web](https://patherly-patherly-pr-32.up.railway.app) | Feb 7, 2026 at 8:07 am |
Sign in to join this conversation.