Project background
Back to Projects

AI Imagen Telegram Bot

Micro-SaaS

Description

A production‑ready micro‑SaaS Telegram bot for AI image generation powered by Replicate. It supports secure payments via PayPal and LemonSqueezy (one‑off or subscription), cryptographically verified webhooks, and persistence in Supabase. Built for reliability and scale with webhook mode for production (Gunicorn/WSGI, Render) and polling mode for local development.

Problem Solved

Delivers AI image generation directly in Telegram with a micro‑SaaS model, robust payment processing, template control, and reference management on a scalable infrastructure.

Technical Highlights

Single shared Telegram Application under WSGI; PayPal signature verification (auth_algo, cert_url, transmission_id, signature, timestamp) and LemonSqueezy HMAC validation; support for subscriptions (micro‑SaaS); inline template selection from templates.json; persistent references stored in Supabase; temporary references scoped to job; async Replicate integration with on‑disk media persistence and delivery; HTTP health checks; structured logging and retries.

Frontend Workflow

  • User selects a template from the catalog (templates.json)
  • User uploads references: persistent (profile‑level, reusable) and/or temporary (single job)
  • User edits settings (prompt, template, seed/params) and requests preview
  • Optional image editing (re‑roll, variations, upscale, overlays)
  • Payment (PayPal/LemonSqueezy, one‑off/subscription)
  • Webhook validates signature and confirms
  • Replicate job runs asynchronously with chosen template and references
  • Final image delivered and logged in Supabase

Backend Workflow

  • WSGI + Flask for health/webhooks; /telegram/webhook handles Updates, template selections, and reference commands; /webhook/paypal and /webhook/lemonsqueezy verify signatures and map events (including subscriptions); Replicate client executes jobs with selected template and references; Supabase persists user profiles, subscriptions/transactions, references, job metadata, and delivery logs.

Tech Stack

PythonFlaskTelegramAsyncIOReplicateSupabasePayPalLemonSqueezyGunicornRender
Contact background

Let's connect and build something amazing together

I'm always open to discussing new projects, creative ideas or opportunities to be part of your visions.

AI Imagen Telegram Bot | Denis Vlas Portfolio | Denis Vlas