How gxurav1710/youpi-pg works
YOUPI PG is a self-hosted UPI payment gateway. A buyer starts checkout through the merchant integration, verifies by WhatsApp OTP, enters a single-slot FIFO queue, pays the displayed UPI QR, and receives confirmation after banking observations are matched to a payment. Its major capabilities also include Android, Gmail, and Google Messages observers; merchant administration; and service/tunnel management. The README documents the end-to-end flow; sampled code confirms selected route, parsing, persistence, and observation links. Some unsampled route and integration wiring is therefore omitted.
Main entry points: server.js Payment API · checkout.routes.js Checkout Routes · payment-session.repository.js Payment Sessions · verification-pipeline.js Verification Pipeline
Components 25
Checkout
- Merchant Integration
packages/merchant-sdk/src/youpi.js - Checkout UI
apps/checkout-portal/src/sdk/youpi.js - QR Generation
apps/checkout-portal/src/qr-lib.js
Gateway
- Payment API
apps/payment-api/src/server.js - Checkout Routes
apps/payment-api/src/routes/checkout.routes.js - Merchant Admin
apps/payment-api/src/routes/admin.routes.js - WhatsApp OTP
apps/payment-api/src/services/whatsapp-berry.service.js - FIFO Queue
packages/core/src/queue-engine.js - Payment Timers
packages/core/src/timing-engine.js - Verification Pipeline
packages/core/src/verification-pipeline.js - Attribution Engine
packages/core/src/attribution-engine.js - Webhook Delivery
packages/core/src/webhook-engine.js
Bank Observers
- Android Observer
apps/android-observer-app/app/src/main/java/com/youpi/observer/ForegroundService.kt - Gmail Observer
apps/gmail-observer/src/gmail-poller.js - Gmail Browser Automation
apps/gmail-observer/src/browser-automator.js - Google Messages Observer
apps/sms-observer/src/sms-service.js - Messages Automation
apps/sms-observer/src/browser-automator.js
Persistence
- SQLite Database
packages/db/src/database.js - Payment Sessions
packages/db/src/repositories/payment-session.repository.js - Customer Records
packages/db/src/repositories/customer.repository.js
Operations
- Service Control Center
apps/control-center/src/process-manager.js - Tunnel Manager
apps/payment-api/src/services/tunnel-manager.js
Other components
- Buyer
- Merchant Storefront
- Bank / UPI Rails
Connections 27
- Buyer → Checkout UI: starts checkout
- Merchant Storefront → Merchant Integration: integrates
- Merchant Integration → Checkout UI: opens checkout
- Checkout UI → Payment API: requests payment
- Payment API → Checkout Routes: routes checkout
apps/payment-api/src/routes/checkout.routes.js - Checkout Routes → WhatsApp OTP: authenticates buyer
- Checkout Routes → FIFO Queue: acquires slot
apps/payment-api/src/routes/checkout.routes.js - FIFO Queue → Payment Sessions: reserves slot
- Checkout Routes → QR Generation: provides payment QR
- Buyer → Bank / UPI Rails: pays by UPI
- Bank / UPI Rails → Android Observer: sends SMS and alerts
- Bank / UPI Rails → Gmail Observer: sends credit email
- Android Observer → Payment API: submits observation
- Gmail Observer → Verification Pipeline: supplies observation
- Google Messages Observer → Payment API: submits observation
apps/sms-observer/src/sms-service.js - Messages Automation → Google Messages Observer: provides messages
apps/sms-observer/src/browser-automator.js - Gmail Browser Automation → Gmail Observer: automates inbox
apps/gmail-observer/src/browser-automator.js - Verification Pipeline → Attribution Engine: passes verified data
packages/core/src/verification-pipeline.js - Verification Pipeline → Payment Sessions: checks payment sessions
packages/core/src/verification-pipeline.js - Attribution Engine → Payment Sessions: records attribution
packages/core/src/attribution-engine.js - Attribution Engine → Webhook Delivery: confirms payment
- Webhook Delivery → Merchant Storefront: sends result webhook
- Payment API → Merchant Admin: serves administration
apps/payment-api/src/routes/admin.routes.js - Merchant Admin → Tunnel Manager: manages tunnel
apps/payment-api/src/routes/admin.routes.js - Service Control Center → Payment API: manages service
apps/control-center/src/process-manager.js - Payment Sessions → SQLite Database: reads and writes
packages/db/src/database.js - Customer Records → SQLite Database: reads and writes
packages/db/src/repositories/customer.repository.js