Skip to content

chelbapolandaa/Subscription-Billing-System-with-Stripe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Subscription Billing System with Stripe

A complete, production-ready subscription billing system with Stripe integration.

✨ Live Demo

  • API: https://your-deployment.railway.app (deploy dengan Railway/Render)
  • Test Credentials: test@example.com / password123
  • Test Card: 4242 4242 4242 4242

🛠️ Tech Stack

  • Backend: Node.js, Express, SQLite, Sequelize
  • Frontend: React.js, Vite, Tailwind
  • Payment: Stripe API (Full Integration)
  • Auth: JWT, bcrypt
  • Webhooks: Stripe Webhook Signature Verification

✅ Features Implemented

  • ✅ User Authentication (Register/Login with JWT)
  • ✅ Product & Price Management (Sync from Stripe)
  • ✅ Stripe Checkout Integration
  • ✅ Subscription Management (Create/Read/Update)
  • ✅ Webhook Handling with Signature Verification
  • ✅ Customer Portal Integration
  • ✅ Invoice Tracking
  • ✅ Database Models (User, Product, Subscription, Invoice)

🚀 Quick Start

1. Clone & Setup

git clone https://github.com/chelbapolandaa/Subscription-Billing-System-with-Stripe.git
cd backend
npm install
cp .env.example .env

2. Configure Stripe

  • Get API keys from Stripe Dashboard
  • Update .env with your keys
  • Run npm run stripe:sync to sync products

3. Run Development

npm run db:sync
npm run dev

4. Test API

# Register user
curl -X POST http://localhost:5000/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{"email":"test@example.com","password":"password123"}'

# Create checkout
curl -X POST http://localhost:5000/api/subscriptions/create-checkout-session \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"priceId":"price_XXXX"}'

🔧 Webhook

  1. Run stripe listen --forward-to localhost:5000/api/webhook
  2. Copy webhook secret to .env
  3. Restart server

📸 Screenshots

Home

Home

Pricing

Pricing

Checkout to Stripe

Checkout to Stripe

Dashboard

Dashboard

Manage Subscription on Stripe

Manage Subsricption

Register

Register

Login

Login

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Built with Hardcore Mode

About

A complete, production-ready subscription billing system with Stripe integration.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors