mirror of
https://github.com/Dvorinka/Bookra.git
synced 2026-06-03 20:13:00 +00:00
feat(core): consolidate auth service into backend and implement stripe billing
This commit performs a major architectural refactor by migrating the standalone `auth-service` into the main `backend` application, enabling a unified codebase and simplified deployment. It also introduces comprehensive Stripe billing support and a new administrative dashboard.
Key changes:
- **Architecture**: Deleted `apps/auth-service` and integrated its functionality (JWT, magic links, OAuth, user management) into `apps/backend`.
- **Billing**: Added Stripe integration to `backend`, supporting both monthly and yearly subscription cycles with automatic plan entitlement enforcement (e.g., location limits).
- **Admin Dashboard**: Implemented a new administrative service and API endpoints to manage tenants, users, and view platform-wide statistics.
- **Frontend**:
- Added a new pricing page with monthly/yearly toggle and comparison table.
- Integrated Stripe and Sentry for payments and error tracking.
- Improved dashboard UX/UI and added i18n support for new features.
- Enhanced the public booking flow with better validation and contact form integration.
- **Database**: Added migrations for users, magic links, password resets, OAuth states, admin audit logs, and refresh tokens.
- **DevOps**: Updated environment configurations for Railway and Vercel, and streamlined the project's `package.json` scripts.
This commit is contained in:
@@ -639,9 +639,16 @@ components:
|
||||
planCode:
|
||||
type: string
|
||||
enum: [starter, pro, business]
|
||||
description: The plan to subscribe to
|
||||
currency:
|
||||
type: string
|
||||
enum: [czk, usd]
|
||||
description: Currency for the subscription
|
||||
billingInterval:
|
||||
type: string
|
||||
enum: [monthly, yearly]
|
||||
default: monthly
|
||||
description: Billing interval. Yearly gets 17% discount.
|
||||
PlanDisplayPrice:
|
||||
type: object
|
||||
required: [currency, amountCents, formatted]
|
||||
@@ -651,29 +658,56 @@ components:
|
||||
enum: [czk, usd]
|
||||
amountCents:
|
||||
type: integer
|
||||
description: Monthly price in cents
|
||||
formatted:
|
||||
type: string
|
||||
description: Formatted monthly price string
|
||||
yearlyAmountCents:
|
||||
type: integer
|
||||
description: Yearly price in cents (17% discount)
|
||||
yearlyFormatted:
|
||||
type: string
|
||||
description: Formatted yearly price string
|
||||
yearlySavings:
|
||||
type: string
|
||||
description: Description of yearly savings
|
||||
yearlySavingsPercent:
|
||||
type: integer
|
||||
description: Percentage saved with yearly billing
|
||||
CheckoutLaunchResponse:
|
||||
type: object
|
||||
required: [priceId, successRedirectUrl, cancelRedirectUrl, customData]
|
||||
description: |
|
||||
Checkout launch response supporting both Stripe and Paddle providers.
|
||||
For Stripe: checkoutUrl is returned (redirect-based checkout).
|
||||
For Paddle: priceId, customerId, customerEmail, customData are returned (client-side checkout).
|
||||
properties:
|
||||
checkoutUrl:
|
||||
type: string
|
||||
format: uri
|
||||
description: Stripe checkout URL (redirect the user to this URL)
|
||||
priceId:
|
||||
type: string
|
||||
description: Paddle price ID for client-side checkout
|
||||
customerId:
|
||||
type: string
|
||||
description: Paddle customer ID
|
||||
customerEmail:
|
||||
type: string
|
||||
format: email
|
||||
description: Customer email for Paddle checkout
|
||||
successRedirectUrl:
|
||||
type: string
|
||||
format: uri
|
||||
description: URL to redirect after successful checkout
|
||||
cancelRedirectUrl:
|
||||
type: string
|
||||
format: uri
|
||||
description: URL to redirect after cancelled checkout
|
||||
customData:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Custom metadata for Paddle checkout
|
||||
PortalSessionResponse:
|
||||
type: object
|
||||
required: [url]
|
||||
|
||||
Reference in New Issue
Block a user