How dynonguyen/ezbill works
Project Type and Purpose
• This is a full-stack, single-page web application (SPA) called “Ezbill” for splitting bills among group members.
• The front end is built with Vue 3 + Vite, and the back end is provided entirely by Supabase (Postgres, Auth, Realtime, REST API, storage), orchestrated locally via Docker for development.
High-Level Architecture Overview
• Users interact through their web browser (Chrome, Safari, etc.).
• Static assets (HTML/CSS/JS) are hosted on Vercel’s CDN and fetched by the browser.
• The Vue app (components, features, router, state, supabase.ts client) communicates with Supabase endpoints.
• Supabase services include Auth, PostgREST (auto-generated REST API), Realtime (WebSockets), Postgres DB, connection pooler, vector for logs, and optional storage.
Main Components and Relationships
a. Frontend (Client Side)
• Browser (User agent)
• CDN / Vercel (Static asset hosting)
• Vue 3 SPA (src/main.ts, App.vue, pages, components, stores, routes, supabase.ts)
b. Backend-as-a-Service (Supabase)
• Kong API Gateway (routes incoming HTTP to Supabase components)
• PostgREST (translates HTTP requests to SQL queries)
• Realtime Server (pushes DB events via WebSockets)
• Auth Server (sign-up, sign-in flows)
• Postgres DB (schema defined via SQL in docker/volumes/db/init/*.sql)
• Pooler (pgBouncer)
• Vector (aggregates logs)
• Storage & Functions (if used)
c. Local Development Environment
• Docker Compose (docker/dev/docker-compose.dev.yml orchestrates Kong, Postgres, PostgREST, Realtime, pooler, vector)
• Seed scripts (docker/dev/data.sql, docker/volumes/db/init/*.sql)
Data-Flow and Interaction
• Browser loads index.html → downloads JS bundles from Vercel.
• Vue app initializes Supabase client (supabase.ts) using environment variables.
• On user actions (create/join group, add bill, fetch lists), Vue calls supabase.from(…) → HTTP(s) to Kong → forwarded to PostgREST or Auth.
• For real-time updates (new bills, member changes), Vue subscribes to channels via Supabase Realtime → WebSocket connection.
• Supabase writes to Postgres → pooler ensures efficient DB connections → Realtime pushes change events → front end updates UI.
• Vector collects logs from all services into a unified store (for debugging).
Architectural Patterns and Principles
• SPA / Client-Server separation
• BaaS (Backend-as-a-Service): no custom server code → leverage Supabase microservices
• Event-driven updates via WebSockets (Realtime)
• Clear separation between UI components (views, form controls, dialogs) and data access layer (supabase.ts, stores, hooks)
• Dockerized development environment for reproducible local Supabase stack
Final Checklist
• All components clearly labeled.
• Docker boundary for local dev.
• Annotations referencing key files or modules.