Skip to content

Architecture

CoogCasa is built as a modern, serverless application leveraging Cloudflare’s edge platform and Supabase for backend services.

LayerTechnology
FrontendAstro 5, React 19, TypeScript, Tailwind CSS 4
DesignGlass UI, minimal rounded corners, light mode
DatabaseSupabase (PostgreSQL + Auth + Storage + Realtime)
HostingCloudflare Pages (auto-deploy on push)
WorkersCloudflare Workers (Sports API, Scholarships API)
CDN/SecurityCloudflare (DDoS protection, WAF)
┌─────────────────────────────────────────────────────────────┐
│ Cloudflare Edge │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ Pages │ │ Workers │ │ Rate Limiting │ │
│ │ (Website) │ │ (APIs) │ │ (WAF) │ │
│ └──────┬──────┘ └──────┬──────┘ └─────────────────────┘ │
└─────────┼────────────────┼──────────────────────────────────┘
│ │
│ ▼
│ ┌─────────────────┐
│ │ API Router │
│ │ api.coogcasa.com│
│ └────────┬────────┘
│ │
│ ┌────────────┴────────────┐
│ ▼ ▼
│ ┌──────────────┐ ┌──────────────┐
│ │Sports Backend│ │Scholarships │
│ │ Worker │ │ Backend │
│ └──────┬───────┘ └──────┬───────┘
│ │ │
│ │ ┌─────────────┘
│ │ │
▼ ▼ ▼
┌────────────────────────┐
│ Supabase │
│ ┌──────┐ ┌──────────┐ │
│ │Postgres│ │ Storage │ │
│ │ DB │ │ (Images)│ │
│ └──────┘ └──────────┘ │
└────────────────────────┘

The main website is built with Astro 5 and React 19:

  • Framework: Astro with React islands for interactive components
  • Styling: Tailwind CSS 4 with custom Glass UI design system
  • Routing: File-based routing with Astro
  • Deployment: Automatic via GitHub push to main branch

Unified API endpoint that routes requests to backend services:

  • URL: https://api.coogcasa.com (or coog-api-router.coog-planner.workers.dev)
  • Routes:
    • /sports/* → Sports Backend
    • /scholarships/* → Scholarships Backend
    • /health → Combined health check

Uses Cloudflare Service Bindings for zero-latency internal routing.

Cloudflare Worker that fetches and caches UH sports data from ESPN:

  • Data Sources: ESPN API
  • Caching: KV for schedules, rosters, standings
  • Features: Schedule tracking, game polling, image caching

Cloudflare Worker that scrapes and indexes UH scholarship sources:

  • Data Sources: 10+ UH scholarship pages
  • Storage: Supabase for persistence
  • Updates: Daily cron job

PostgreSQL database with:

  • Auth: User authentication (Discord OAuth)
  • Tables: Discussions, replies, reactions, profiles
  • Storage: User-uploaded images
  • Realtime: Live updates for discussions
PUBLIC_SUPABASE_URL=https://[project-id].supabase.co
PUBLIC_SUPABASE_ANON_KEY=[anon-key]
PUBLIC_SPORTS_API_URL=https://api.coogcasa.com/sports
PUBLIC_SCHOLARSHIPS_API_URL=https://api.coogcasa.com/scholarships

Secrets are configured via wrangler secret put:

Terminal window
wrangler secret put SUPABASE_URL
wrangler secret put SUPABASE_SERVICE_KEY
  • RLS: Row-Level Security on all Supabase tables
  • CORS: Strict origin allowlisting
  • Rate Limiting: Cloudflare WAF rules
  • Auth: Supabase Auth with Discord OAuth