Containerised architecture
Frontend Layer
The Frontend layer is built using Next.js framework. It handles presentation logic and UI, including:
Pages, Layouts, Navigation - Landing Pages, Authentication, Dashboards, Reporting, Admin Portal Fetching & Displaying Data - Fetched from Backed FastAPI, Local State Management Interacting with Backend API Framework
Tailwind CSS for styling and UI Possibly Vercel for prod? Backend Layer
The Backend layer built with FastAPI framework handles:
Connecting to External Services Data Processing & Validation Backend technologies:
Probably Redis? for job and queue brokerage Carbon Accounting API
Ingest and process emissions data from variety of sources Automated ETL pipelines to transform data Data validation and quality checks Persist aggregated/analyzed data to Supabase Expose REST endpoints for emissions data operations ML Models
Predictive models to forecast future emissions Anomaly detection on streams of emissions data Recommendation algorithms for reduction opportunities Serve predictions via API endpoints 3rd Party Integrations
Connect with external carbon accounting services Pull relevant emissions data from enterprise systems Sync processed data back to reporting tools Background Tasks
Schedule periodic ETL jobs Email reports and summaries Continuous model retraining Async processing for long-running tasks Middleware
Authentication between Supabase and FastAPI backend Protect backend API routes Central auth middleware for code reuse Schema validation logic for routes and API requests Logging standardize request/response logs for traceability Error handling and performance monitoring Monitoring
Performance metrics and telemetry Debugging and observability Health checks and error tracking
Database Layer
The Database layer manages storage and retrieval of:
Database technologies:
Multitenancy