MacroMath
Architecture

Tech stack

The technologies that make MacroMath work, layer by layer.

A summary of the technologies used, with the architecture decisions behind them.

Framework and language

LayerTechnology
AppFlutter · Dart 3.9.x (^3.9.2)
State managementflutter_bloc (BLoC / Cubit) + equatable
Dependency injectionget_it
Navigationgo_router
Networkingdio ^5.9 · supabase_flutter ^2.8
Local cacheHive (NoSQL key-value)
Chartsfl_chart

Flutter compiles native code for Android and iOS from a single codebase, with Hot Reload and Dart's sound null safety reducing runtime errors.

Backend — Supabase

The entire backend rests on Supabase (an open-source BaaS over PostgreSQL), adopted in place of a standalone PostgreSQL:

  • PostgreSQL — relational database.
  • Auth — authentication (with email 2FA / OTP).
  • Storage — files and images (avatars).
  • Edge Functions — server-side logic (e.g., encapsulating FatSecret's OAuth).
  • Row-Level Security — per-user isolation.

This choice eliminated the need to maintain dedicated server infrastructure.

Artificial intelligence

  • Google Gemini 2.5 Flash — a multimodal model (text + vision), adopted in place of OpenAI/ChatGPT for its low latency, competitive cost and native support for JSON mode with schemas (Structured Outputs).

→ Details in AI and automation.

Food data

A hybrid three-source architecture — a Portuguese local database, FatSecret and Open Food Facts. See Food sources.

Libraries and device services

LibraryUse
mobile_scannerOmnidirectional barcode scanning.
google_mlkit_text_recognitionOCR of shopping receipts.
local_authBiometrics (Face ID / Touch ID / fingerprint).
flutter_local_notifications + timezoneTimezone-aware local reminders.
image_picker, crop_your_image, imageImage capture and cropping.
mailerSending OTP over SMTP.
dio / httpHTTP clients for the external APIs.
pdf, share_plus, url_launcherReports, sharing and links.

Web surfaces

Two separate web projects sit alongside the app, both statically generated for fast loads and cheap hosting:

  • Marketing site (macromath.app) — Astro (static), trilingual PT/EN/ES. See Website overview.
  • This documentationNext.js + Fumadocs (MDX), bilingual EN/PT.

Development tools

VS Code, Android Studio, Git/GitHub, Figma and Supabase Studio. Building iOS IPAs is automated with GitHub Actions.

On this page