Production API

AbyFlow

SaaS Billing & Subscription API

A production-deployed Flask backend demonstrating secure authentication, Stripe payments, signed webhooks, asynchronous processing and AI-powered backend capabilities.

Capabilities

Backend built like a real SaaS service.

The project focuses on the backend systems required for authentication, billing, AI services and reliable asynchronous processing.

Authentication

JWT-secured registration, login and protected dashboard endpoints with password hashing and validation.

Stripe Payments

Stripe Checkout integration for payment creation, success handling and cancellation flows.

Webhook Processing

Stripe webhook signatures are verified and events are handled using idempotent database processing.

Asynchronous Jobs

Celery workers process background tasks through Redis without blocking the main Flask application. Celery Beat schedules recurring jobs.

PostgreSQL

Persistent application data and payment state are stored in PostgreSQL, with pgvector enabled for vector storage and retrieval.

Docker Infrastructure

Flask, PostgreSQL, Redis, Celery Worker and Celery Beat run as isolated services using Docker Compose.

Gemini AI Assistant

Google Gemini powers the AI assistant, with provider-native function calling for application tools and AI usage tracking.

RAG & Vector Search

Gemini embeddings are stored as 1,536-dimensional vectors in PostgreSQL pgvector to support tenant-scoped knowledge retrieval.

Outbox Processing

A scheduled Celery task checks the billing outbox and processes queued events asynchronously, with processing results tracked by the backend.

Endpoints

API surface

The landing page documents the main publicly accessible endpoints while the application continues to expose the complete backend API.

GET /abyflow/health
POST /abyflow/api/auth/register
POST /abyflow/api/auth/login
GET /abyflow/api/auth/dashboard
POST /abyflow/api/subscriptions/create-checkout
GET /abyflow/api/subscriptions/success
POST /abyflow/api/webhooks/stripe
Payment Lifecycle

How a payment moves through AbyFlow

01

Authenticated Client

A JWT-authenticated user requests a checkout session.

02

Stripe Checkout

The user completes payment through Stripe Checkout.

03

Signed Webhook

Stripe sends a signed payment event to AbyFlow.

04

Celery Worker

The event is queued through Redis and processed asynchronously by a Celery worker.

05

Database Update

PostgreSQL stores the resulting payment and subscription state.

Infrastructure

System architecture

Containerized backend deployed on AWS EC2 behind Nginx.

                         ┌────────────────────────┐
                         │         Client         │
                         └────────────┬───────────┘
                                      │
                                      ▼
                         ┌────────────────────────┐
                         │         Nginx          │
                         │     HTTPS / Proxy      │
                         └────────────┬───────────┘
                                      │
                                      ▼
                         ┌────────────────────────┐
                         │   Flask + Gunicorn     │
                         │      AbyFlow API       │
                         └──────┬──────┬──────┬───┘
                                │      │      │
                    ┌───────────┘      │      └─────────────┐
                    ▼                  ▼                    ▼
          ┌─────────────────┐  ┌─────────────────┐  ┌─────────────────┐
          │   PostgreSQL    │  │      Redis      │  │  Google Gemini  │
          │  + pgvector     │  │   Task Broker   │  │    AI API       │
          └─────────────────┘  └────────┬────────┘  └─────────────────┘
                                        │
                              ┌─────────┴─────────┐
                              ▼                   ▼
                    ┌─────────────────┐ ┌─────────────────┐
                    │  Celery Worker  │ │   Celery Beat   │
                    │ Async Processing│ │ Task Scheduler  │
                    └────────┬────────┘ └─────────────────┘
                             │
                             ▼
                    ┌─────────────────┐
                    │   PostgreSQL    │
                    │ State / Outbox  │
                    └─────────────────┘

          Stripe Checkout and signed webhooks integrate with the API.