saas-starter
saas-starter copied to clipboard
feat: Implement credit system
This commit introduces a new credit system to the SaaS starter.
The credit system allows you to track and limit usage of premium features based on subscription plans.
Key features:
- Automatic credit granting based on Stripe subscription plans.
- Usage tracking through Stripe Billing Meters.
- Real-time credit balance and usage information.
- UI components for credit management.
- API endpoints for credit operations.
- Comprehensive logging of credit grants and usage.
The implementation includes:
- A new
credit-service.tsto handle the business logic of the credit system. - Updates to the database schema to include credit-related fields.
- A new Stripe webhook handler to grant credits on subscription payments.
- New API routes for credit management.
- New React components for displaying credit information.
- Example of how to protect API routes and frontend components with credit checks.
- Documentation for testing and deployment.
@google-labs-jules[bot] is attempting to deploy a commit to the Vercel Team on Vercel.
A member of the Team first needs to authorize it.
Completely vibed!!?
Does it even work?
No but I will have to get it working. Do you want to collaborate?
If I were you I would use redis