{"repo":"FareedKhan-dev/saas-payment-guide","free":true,"listed":false,"github":"https://github.com/FareedKhan-dev/saas-payment-guide","clone":"git clone https://github.com/FareedKhan-dev/saas-payment-guide.git","description":"A Beginner's Guide to Monetizing Your Python AI Chatbot","language":"Python","stars":19,"topics":["ai-chatbot","flask","monetization","payment-gateway","python","sass"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"Building a Subscription Plan Payment System for AI Webapp We are going to create a simple AI Chatbot web app from scratch (Frontend + Backend + Payment System) that will include three subscription plans: Free Plan (2 messages/hour) Standard Plan (100 messages/month = 5 USD) Pro Plan (Unlimited messages/month = 20 USD) Here is the architecture of our web app: Bored? Scroll to the final result: link We will be using Supabase as the backend and the LemonSqueezy payment system API to integrate the payment gateway. LemonSqueezy is a free platform, but they charge (5% + a small fixed fee) for every transaction (amount transferred to your bank account). You can use the Paddle platform, but they have recently started restricting AI products, so your web app might get rejected. Here is our complete stack: Flask (Python Web Framework) OpenAI / Nebius / Ollama for web chat with LLM Supabase (Free plan database for backend) LemonSqueezy (as the payment gateway for handling our subscription plans) ngrok (To test payment system) Table of Content - Getting Started - SupaBase Database Setup - Lemon Squeezy Configuration - LLM API Configuration - Setup and Preparation - Creating a Lemon Squeezy Customer - User Signup Route - User Login Route - User Logout Route - Data Fetching \\& Monthly Reset - Determine Plan Info \\& Limits - Processing Allowed Messages - Checkout Link \\& Rendering - Lemon Squeezy Webhook Handler - Creating the Frontend Templates - Creating Webhook Event - Testing Webapp - W","default_branch":null,"files":null,"tree":[],"storefront":"/r/FareedKhan-dev","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/FareedKhan-dev/saas-payment-guide/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}