How lawliet0x/sunsync works
SunSync is a community energy-management web application with authenticated, role-scoped workspaces, meter-reading imports, reporting, and sourced public-data views. The principal workflow is sign-in, enter a workspace, then review records or submit reviewed meter readings for server-side processing. Public reference and public energy data are separate from operational records. The graph includes the frontend, shared Supabase access, operations gateway, and database layer; unsampled SQL details are represented only at the migrations-directory level.
Main entry points: backend.jsx Auth and client · main.jsx App shell · Workspace.jsx Role workspaces · MeterCsvImport.jsx CSV import UI
Components 13
Application UI
- App shell
src/main.jsx - Role workspaces
src/Workspace.jsx
Energy Data
- CSV import UI
src/MeterCsvImport.jsx - CSV validation
src/meter-csv.js - Public energy views
src/PublicDataWorkspace.jsx - Energy formatting
src/public-data.js
Backend Platform
- Auth and client
src/backend.jsx - Operations gateway
supabase/functions/operations/index.ts - Request body limits
supabase/functions/operations/request-body.js - Supabase database
supabase/migrations
Public Sources
- Municipal references
src/PublicReference.jsx - Sourced public data
data
Other components
- Community user
Connections 16
- Community user → App shell: opens
README.md - App shell → Auth and client: uses
src/main.jsx - App shell → Role workspaces: renders
src/main.jsx - App shell → Municipal references: renders
src/main.jsx - Role workspaces → Auth and client: uses
src/Workspace.jsx - Role workspaces → CSV import UI: renders
src/Workspace.jsx - Role workspaces → Public energy views: renders
src/Workspace.jsx - CSV import UI → CSV validation: validates with
src/MeterCsvImport.jsx - CSV import UI → Auth and client: submits through
src/MeterCsvImport.jsx - Public energy views → Auth and client: reads through
src/PublicDataWorkspace.jsx - Public energy views → Energy formatting: formats with
src/PublicDataWorkspace.jsx - Auth and client → Supabase database: authenticates against
src/backend.jsx - Auth and client → Operations gateway: invokes
src/backend.jsx - Municipal references → Supabase database: queries
src/PublicReference.jsx - Operations gateway → Request body limits: parses with
supabase/functions/operations/index.ts - Operations gateway → Supabase database: calls RPC
supabase/functions/operations/index.ts