saas-starter icon indicating copy to clipboard operation
saas-starter copied to clipboard

feat: Implement credit system

Open ngoiyaeric opened this issue 5 months ago • 5 comments

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.ts to 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.

ngoiyaeric avatar Jul 23 '25 14:07 ngoiyaeric

@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.

vercel[bot] avatar Jul 23 '25 14:07 vercel[bot]

Completely vibed!!?

brrock avatar Aug 25 '25 16:08 brrock

Does it even work?

brrock avatar Aug 25 '25 16:08 brrock

No but I will have to get it working. Do you want to collaborate?

ngoiyaeric avatar Aug 25 '25 18:08 ngoiyaeric

If I were you I would use redis

brrock avatar Aug 25 '25 18:08 brrock