Skip to content

Architecture Overview

The G2 Elite platform uses a modern edge-first architecture built on Cloudflare's developer platform.

How It All Connects

📱
Mobile App
Expo / React Native
💻
Web App
React / Vite
Authenticated requests
🛡️
API Gateway
Verifies identity • Finds your org • Routes requests
🗃️
Core Database
Users, orgs, memberships
Data Service
Teams, schedule, scores, chat
🔐
Clerk
Sign-in & account security
🏟️
Organization Database
All sports data — teams, players, games, schedules, chat & more
Client Apps
API Gateway
Services
Databases
External

What Happens When You Open the App

What happens when you open the app and view your teams
1
📱 App🛡️ Gateway
"Show me my teams"
2
🛡️ Gateway🔐 Clerk
Verify this person is who they say they are
3
🛡️ Gateway🗃️ Core DB
What org does this person belong to?
4
🗃️ Core DB🛡️ Gateway
Aaron — Admin at The Farm League
5
🛡️ Gateway⚡ Data Service
Get teams for The Farm League
6
⚡ Data Service🏟️ Org DB
Query teams, players, and schedule
7
🏟️ Org DB📱 App
Here are your teams with rosters and records
Teams displayed in under 200ms

Key Components

ComponentWhat It Does
API GatewayFront door — verifies who you are and routes your request
Data ServiceFetches sports data and formats it for the mobile app
User SyncKeeps user accounts in sync between Clerk and our database
Core DatabaseKnows users, organizations, and memberships
Org DatabaseStores all the sports data (teams, players, games, etc.)
ClerkHandles sign-in, passwords, and account security
Mobile AppThe iOS app parents and coaches use

Where Everything Lives

ServiceURL
API Gatewayg2-elite-gateway.2pw.workers.dev
Data Serviceg2-elite-mobile-bff.2pw.workers.dev
User Syncg2-elite-webhook.2pw.workers.dev
Help Centerg2-elite-help.pages.dev
Internal Docsg2-elite-internal-docs.pages.dev

Internal Documentation — Do Not Share