PROJECT MASTER PLAN - EastPay v2
Last Updated: January 2026
Current Phase: Phase 1 - Basic Operations
Status: In Development
1. Vision & Mission
What is EastPay?
EastPay v2 is a hybrid AI-driven currency exchange platform (Crypto <-> Fiat) operating primarily via Telegram. It serves clients in Southeast Asia, UAE, and Russia.
Mission
Create an "Uber-like" experience for currency exchange, replacing manual operator work with intelligent AI agents while maintaining strict financial accuracy.
Key Philosophy
"Deterministic Execution, AI Support"
- Calculations must be rigid (math formulas, not LLM)
- Support can be fluid (AI-powered)
2. Success Metrics
| Metric | Target | Rationale |
|---|---|---|
| Zero Calculation Errors | 100% | Rates are calculated by formula, never by LLM |
| Admin Control | 100% coverage | Every deal over threshold must be manually approved |
| User Speed | < 60 seconds | From "Start" to "Request Sent" |
| Operator Efficiency | 3x improvement | AI handles routine queries |
3. Current Development Phase
Phase 1: Basic Operations (CURRENT)
Completed Tasks
- Infrastructure: Hostinger VPS + Coolify configured
- Typebot: Deployed with SSL, Google Auth integrated
- Supabase: Project created, keys integrated
- Admin Codebase: Initialized (Refine + Ant Design + Vite)
- Integration: Admin panel connects to Supabase
- Security: Supabase Auth integration complete
In Progress
- DB Migration: Apply DATABASE_SCHEMA v2.0 (Locations, Rates tables)
- Admin UI: Implement Orders List with filters, status tags
- Data Seeding: Run SQL seeders for test data
- Rates Matrix: Import rate calculations from CSV
Blocked/Pending
- Typebot <-> Supabase integration (waiting for schema finalization)
Phase 2: Advanced Rates & Logic
- Rates Manager page in Admin Panel
- CSV-based matrix editor (City/Instrument rates)
- Automatic
estimated_profitcalculation per deal - KYC verification flow in Typebot
- Multi-currency support
Phase 3: AI & Automation
- LLM integration to Typebot for non-standard queries
- Smart routing based on
message_templates - Order assignment to City Managers by location
- Analytics dashboard
- Real-time notifications (Telegram)
Phase 4: Scale & Optimize
- Performance optimization
- Multi-region support
- Mobile app (TMA - Telegram Mini App)
- Advanced reporting
4. System Components Overview
┌─────────────────────────────────────────────────────────────────┐
│ EastPay v2 Architecture │
├─────────────────────────────────────────────────────────────────┤
│ │
│ [Telegram User] │
│ │ │
│ ▼ │
│ ┌─────────────┐ │
│ │ Typebot │ (Hostinger/Coolify) │
│ │ bot.eastpay │ - Collects user input │
│ └──────┬──────┘ - Handles KYC flow │
│ │ │
│ ▼ │
│ ┌─────────────┐ │
│ │ n8n │ (Hostinger/Coolify) │
│ │ Orchestrator│ - Calculates rates │
│ └──────┬──────┘ - Creates orders │
│ │ │
│ ▼ │
│ ┌─────────────┐ │
│ │ Supabase │ (Cloud) │
│ │ Database │ - Single Source of Truth │
│ └──────┬──────┘ - Auth, RLS, Realtime │
│ │ │
│ ▼ │
│ ┌─────────────┐ │
│ │ Refine │ (Netlify) │
│ │ Admin Panel │ - Order management │
│ └─────────────┘ - Rate management │
│ │
└─────────────────────────────────────────────────────────────────┘
5. Key Decisions Log
| Date | Decision | Rationale |
|---|---|---|
| Jan 2026 | Use Refine v4 (not v5) | Router compatibility with react-router-v6 v4 |
| Jan 2026 | Ant Design v5 | Stable, enterprise-ready UI |
| Jan 2026 | Self-hosted Typebot | Full control, no vendor lock-in |
| Jan 2026 | Supabase for Auth + DB | Free tier sufficient, RLS built-in |
6. Risk Registry
| Risk | Probability | Impact | Mitigation |
|---|---|---|---|
| Rate calculation errors | Low | Critical | Formula-based calc, no LLM |
| Typebot downtime | Medium | High | Coolify monitoring, backups |
| Supabase rate limits | Low | Medium | Upgrade plan if needed |
| Version conflicts (Refine) | High | Medium | Lock versions in package.json |
7. Team & Responsibilities
| Role | Responsibility | Tools |
|---|---|---|
| Admin | Full system access, rate management | Admin Panel |
| City Manager | Local rates, cash flow in specific city | Admin Panel (limited) |
| Operator | Process deals, check receipts | Admin Panel (limited) |
| Client | Exchange currency | Telegram Bot |
8. AI Agent Instructions
When working on this project:
- Always check current phase - Focus on Phase 1 tasks first
- Reference docs before implementing:
DATABASE_SCHEMA.md- Data structureDOMAIN_MODEL.md- Business logicTECH_STACK.md- Version constraints
- No over-engineering - Implement only what's needed for current phase
- Test with seeders - Use test data to verify implementations
9. Quick Reference Links
- Production Admin: https://admin.eastpay.online
- Bot Builder: https://builder.eastpay.online
- Supabase Dashboard: (via Supabase console)
- Coolify Dashboard: (via Hostinger VPS)