Own products & experimentsOwnerDec 2024 – Oct 2026

VisaAgent: AI and RPA visa-form automation platform

TL;DR

A product I built solo over about 22 months: AI document import, Playwright automation of five visa forms, local-first sync to Supabase, multi-tenant billing, code-signed releases and a WhatsApp bot.

Period
Dec 2024 – Oct 2026
My role
Sole designer and developer
Technologies
10
Diagrams
4
Reading time
8 min

PlaywrightLLM integrationPythonFastAPI / FlaskElectronReactSupabase / PostgresSQLiteOCR / computer visionDocker / CI/CD

5 chapter(s) collapsed in quick read

Executive Summary

A multi-generation SaaS-style product the owner built solo over ~22 months.

  • Gen 1 (Dec 2024): a Python prototype that fills the India e-Visa form (fillVisaForm.py → v1 app with pages + backend, captcha OCR).
  • Gen 2 (Jan–Feb 2026), the desktop product:
  • an Electron desktop app (React client UI) with a bundled FastAPI local backend (PyInstaller) and a SQLite local-first store synced to Supabase
  • AI document import (Gemini via an edge function) and Playwright automation of all 5 India e-Visa forms, with real-time progress over WebSocket + Supabase Realtime
  • multi-tenant companies / users / roles, credentials and presets, a pricing engine (prepaid / postpaid, volume tiers, reuse detection to avoid double charging), invoices and balances
  • an admin app, versioned releases (v25+) with code signing, browser install / selection logic, and fixes for antivirus / network issues
  • Gen 3 (May–Oct 2026), the cloud and agent era:
  • a web platform (React monorepo with a shared @visaagent/cloud-client package) and a Chrome extension (with MediaPipe vision for photo checks)
  • an AI agent worker (Playwright + Supabase job queue, captcha client, OpenCV face-based photo cropping, PyMuPDF document prep, a dev control UI)
  • China visa support (AI extraction, application versions, fill runs with events, persistent browser profile)
  • an n8n automation “brain”
  • a WhatsApp bot on Supabase edge functions (wa-webhook, wa-send, wa-prepare, wa-job-event, wa-staff-action) with cases, ledgers, templates, link codes, automation settings and staff actions in the admin app
  • captcha solving and AI health edge functions, document-review findings, clarification requests, prompt management (system / company / service prompts), data-retention policies, and a credential access log

Portfolio Blurb + Resume Bullets

Blurb:

Founded and built VisaAgent, an AI + RPA platform that cuts travel agencies’ visa form filling from 30–45 to 5–10 minutes. Gemini extracts passport and document data, and Playwright agents fill India / China government forms with captcha solving and photo processing. It runs as an Electron + FastAPI desktop app (local-first SQLite, Supabase sync), a React web platform with a Chrome extension, and a WhatsApp bot, with multi-tenant billing (credits, prepaid / postpaid, reuse detection), an admin console, code-signed releases and 181 Postgres migrations.

Bullets:

  • Built AI document extraction with Google Gemini (edge functions gemini-extract, cn-ai-extract, ai-health) behind prompt management (system / company / service prompts, prompt logs, usage logs and costing).
  • Built Playwright automation for the 5-step India e-Visa and the China online visa forms, with real-time progress, resume after failure (resume code flow), confirmation capture, captcha solving (captcha-solve + captcha_client.py), and OpenCV face-detected photo cropping.
  • Shipped a desktop product: Electron + React UI + FastAPI backend bundled with PyInstaller, SQLite local-first with Supabase sync, a dynamic-port architecture, browser installation / selection, code signing, and a release pipeline (v25+); fixed an antivirus-blocking connectivity issue (post-mortem doc).
  • Designed a multi-tenant billing system in Postgres: companies, credit pools and scopes, balances, pricing tiers, reuse pricing (no double charge for re-runs), invoices / line items, limit-change history, payments, through RPC functions and triggers.
  • Built the cloud generation: a React web platform + shared cloud client package, a Chrome extension (MediaPipe tasks-vision), and an AI agent worker consuming agent_jobs from Supabase.
  • Built a WhatsApp bot (Supabase edge functions + Postgres: conversations, messages, contacts, cases, case ledger, templates, link codes, automation settings, audit events) for document collection, family / group cases, payment prompts and staff actions, with admin views.
  • Added governance: data-retention policies, credential access logs, encryption guide, doc-review findings, clarification requests.
  • Built a Sri Lanka ETA Chrome extension (Manifest V3, eta.gov.lk) with a country mapper, date pickers and chat.

Business Domain

Concept Meaning
Company (agency) Tenant; users, roles, services, credits / balance, prompt overrides
User Agency staff (permissions per service), presets, credentials (government portal logins, access-logged), settings, WhatsApp numbers, client pool
Service Visa service (India e-Visa types, China visa…) with categories, prompts, pricing
Visa application / group Applicant data (from AI extraction + review), group / family members, files, versions (China)
Automation attempt / fill run One browser run with events (progress, errors, screenshots), resumable
AI extraction Gemini output + debug / usage logs; doc-review findings; clarification requests to the customer
Billing Credits / pools / scopes, pricing tiers, reuse pricing, balance transactions, invoices + line items, payments
WhatsApp case Customer conversation → case (documents, family members, questions) → ledger / pricing → job to the agent worker → result / payment

Technology Stack

6.1 Desktop local backend (requirements.txt)

FastAPI 0.104.1, uvicorn 0.24, httpx 0.27, SQLAlchemy 2.0.23, pydantic 2.10.4, Playwright 1.40, Selenium 4.15 + webdriver-manager (fallback), Pillow 10.1, pandas 2.1.3, openpyxl 3.1.2, psycopg2-binary, supabase 2.10, PyInstaller 6.3, BeautifulSoup 4.12, google-genai ≥ 1.0 (Gemini), PyMuPDF, opencv-python-headless, python-docx, pdf-orientation-corrector, pytesseract, pypdf, pip-system-certs, python-dotenv.

6.2 Agent worker

Playwright ≥ 1.48, supabase ≥ 2.10, httpx, pydantic, SQLAlchemy, Pillow, OpenCV < 5 (CascadeClassifier face detection for photo cropping), PyMuPDF, pypdf, tenacity (retries), structlog (structured logs).

6.3 Frontends

  • Desktop client-ui and web app: React (TS), Radix UI set, @tanstack/react-table 8, tsparticles, date-fns, CVA / clsx, supabase-js 2.89, @visaagent/cloud-client (web).
  • Admin app: React + shadcn / Radix, react-hook-form + @hookform/resolvers + zod, @monaco-editor/react (prompt editing), Turnstile.
  • Extension: React 19 / Preact 10, @mediapipe/tasks-vision 0.10.17, supabase-js, cloud client.

6.4 Cloud

Supabase Postgres (RPC functions, triggers, RLS), Auth (JWT), Realtime, Storage, Edge Functions (Deno/TS); Gemini model family (2.5-flash / -lite / -pro and newer flash variants referenced); WhatsApp Cloud API (wa-* functions); Firebase (version sync); n8n (Docker) workflows.

6.5 Runtime

Windows + PowerShell, Python 3.11.3, Node 22.18, npm 10.8 (run guide).


Architecture

7.1 Generations

7.1 Generations
Diagram as text
flowchart LR
 G1[Gen1 2024: fillVisaForm.py → v1 pages+backend + captcha OCR] --> G2[Gen2 Jan–Feb 2026: Electron + FastAPI + SQLite + Playwright desktop, Supabase sync, admin, billing]
 G2 --> G3[Gen3 May–Oct 2026: Web platform + Chrome extension + AI agent worker + China + n8n + WhatsApp bot]

7.2 Desktop product (Gen 2)

7.2 Desktop product (Gen 2)
Diagram as text
flowchart TB
 subgraph Desktop[Electron desktop app]
 UI[React UI: import, review, apps list, settings, presets, credentials] <--> API[FastAPI local backend:dynamic port]
 API <--> SQL[(SQLite app.db)]
 API --> PW[Playwright Chromium/Edge]
 end
 PW --> GOV[(India e-Visa portal: forms 1–5)]
 API -->|HTTPS| SB[(Supabase: auth, Postgres, edge functions)]
 API <-->|WebSocket progress| UI
 SB -->|Realtime| UI
 SB --> GEM[(Gemini via gemini-extract)]
 ADMIN[Admin app] --> SB

7.3 Cloud / agent / WhatsApp (Gen 3)

7.3 Cloud / agent / WhatsApp (Gen 3)
Diagram as text
flowchart LR
 CUST([Customer on WhatsApp]) -->|messages, docs| WAW[wa-webhook]
 WAW --> DB[(Postgres: wa_conversations, wa_messages, wa_cases, wa_case_ledger…)]
 WAW --> PREP[wa-prepare: AI extraction / doc review]
 PREP --> GEM[(Gemini)]
 STAFF([Agency staff]) --> ADM[Admin app: chats, family card, To pay]
 ADM --> ACT[wa-staff-action]
 WEB([Agent on web]) --> WP[Web platform: AI Import, Apply, History] --> DB
 EXT[Chrome extension] --> DB
 DB -->|agent_jobs| WK[AI agent worker: Playwright]
 WK --> GOV[(India / China government portals)]
 WK --> CAP[captcha-solve]
 WK --> JE[wa-job-event] --> SEND[wa-send] --> CUST

7.4 Automation run (India)

7.4 Automation run (India)
Diagram as text
sequenceDiagram
 participant U as Agent
 participant API as FastAPI / worker
 participant AI as gemini-extract
 participant PW as Playwright
 participant GOV as e-Visa portal
 participant SB as Supabase
 U->>API: upload passport + documents
 API->>AI: extract (prompt per service) → structured fields
 U->>API: review / correct, choose preset + credential
 API->>SB: pricing-engine (reuse check) → reserve credits
 API->>PW: launch browser (selected Chromium/Edge path)
 loop Form 1..5
 PW->>GOV: fill fields, upload photo (cropped), solve captcha
 PW-->>API: progress event (WebSocket + Realtime)
 end
 PW->>GOV: submit / save; capture application id + PDF
 API->>SB: automation attempt result, balance transaction

Features (complete)

AI passport / document extraction · review / edit UI · India e-Visa 5-form automation · China form automation with persistent profile · resume after failure · captcha solving · photo crop (face detection) / rotation / orientation fixes · PDF and document prep · progress streaming (WebSocket + Realtime) · multi-tenant companies / users / roles / service permissions · credentials (encrypted, access-logged) and presets · pricing engine (prepaid / postpaid, tiers, reuse) · credits / balances / invoices · admin console (services, prompts with Monaco editor, users, companies, pricing, WhatsApp chats, family card, payments due) · desktop build / release / code signing / auto version sync · browser install and selection · web platform (AI Import, Apply, History) · Chrome extension fill · agent worker + dev control UI · n8n workflows · WhatsApp bot (menu, documents, family, questions, payments, staff actions, templates, link codes) · data retention · audit logs · Sri Lanka ETA extension.


Skills Learned

Browser automation at production scale (Playwright / Selenium), LLM document extraction and prompt ops, desktop packaging and code signing, local-first sync, multi-tenant billing design, WhatsApp bot architecture, job-queue workers, n8n, Chrome extensions (MV3, MediaPipe), computer vision for photos, Supabase at scale.

Challenges & Solutions

Challenge Solution
Antivirus blocking backend connectivity Post-mortem + env / packaging fixes
Browser path issues on client PCs Browser selection / launch logic, Chromium / Edge path fixes
Field focus / cursor issues on the portal Field-level focus handling
Long runs failing mid-way Resume code flow
Double billing on retries Reuse pricing
AI quota limits API-key round-robin management
Image rotation / orientation Orientation correction pipeline

Related projects

Want to discuss this project?

Happy to walk through the architecture, trade-offs or the code.

Email me about it

© 2026 Thuyavan Sivarasa. Script code is MIT licensed.