Documentation Index
Fetch the complete documentation index at: https://grouple.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Architecture Overview
Grouple runs across four distinct infrastructure layers: AWS Amplify (frontend), AWS ECS (backend API), Supabase (database + serverless logic), and a dedicated EC2 instance (AI workers).
Infrastructure Diagram
┌─────────────────────────────────────────────────────────────────┐
│ FRONTEND (AWS) │
│ GitHub → AWS Amplify → React + TypeScript (Vite) │
│ grouple.pro via Route 53 + CloudFront CDN │
└─────────────────────────┬───────────────────────────────────────┘
│ API requests + JWT
▼
┌─────────────────────────────────────────────────────────────────┐
│ BACKEND API (AWS) │
│ Route 53 (api.grouple.pro) │
│ → ALB (SSL Termination + ACM Certificate) │
│ → ECS Cluster (grouple-api-cluster) │
│ └── Auto Scaling Group (EC2 instances) │
│ └── ECS Tasks (API Containers via Docker/ECR) │
│ AWS Secrets Manager → injects credentials │
│ CloudWatch Logs + X-Ray → observability │
└─────────────────────────┬───────────────────────────────────────┘
│ trigger task
▼
┌─────────────────────────────────────────────────────────────────┐
│ AI WORKERS (Single EC2 Instance, PM2) │
│ ├── AI Proposal Worker (Node.js) │
│ │ └── Amazon Bedrock Claude 4.6 → generates proposals │
│ └── PDF Extract Worker (Node.js) │
│ └── Amazon Bedrock Claude 4.6 → extracts menu/PDF data │
│ Both workers save results → Supabase PostgreSQL │
└─────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ SUPABASE (Core Backend Logic) │
│ ├── PostgreSQL (primary database, 20+ tables) │
│ ├── Auth (GoTrue / JWT) │
│ ├── Email (via Edge Functions) │
│ ├── 14 Database Triggers (automated business logic) │
│ ├── 40+ RPC Functions (complex queries + operations) │
│ ├── 6 Edge Functions (serverless compute) │
│ └── Storage (venue-images, Logos, venue-brochures) │
└─────────────────────────────────────────────────────────────────┘
Key Design Decisions
Why Supabase for backend logic?
Supabase handles most business logic via database triggers and edge functions, keeping the ECS API lean. This means many operations (email sending, currency sync, settlement creation) happen automatically without hitting the API layer.
Why a separate EC2 for AI workers?
AI proposal generation and PDF extraction are long-running, resource-intensive tasks. Running them on a dedicated EC2 instance with PM2 keeps them isolated from the main API and allows independent scaling.
Why ECS + EC2 (not Fargate)?
Greater control over instance types and costs for a startup-scale workload.
Domain Structure
| Domain | Points To |
|---|
grouple.pro | AWS Amplify (frontend) |
api.grouple.pro | Application Load Balancer (backend API) |
grouple.mintlify.app | This documentation |