Skip to main content

Architecture Overview

High-Level Design

Design Principles

  1. Offline-first -- The mobile app functions fully without internet for core features (expense tracking, budget viewing, manual entry). The device SQLite database is the source of truth.

  2. Sync-optional -- Users opt in to server sync. When enabled, data is end-to-end encrypted before leaving the device.

  3. AI as enhancement -- Core functionality works without AI. AI features (receipt parsing, agent chat) require connectivity but degrade gracefully.

  4. Low data usage -- Minimize payload sizes. Compress images before upload. Paginate API responses.

  5. Simple infrastructure -- Single Django server is sufficient for the target scale. No premature scaling or task queues.

Technology Stack

Backend

LayerTechnology
FrameworkDjango 5.2 + DRF
LanguagePython 3.12+ (managed with uv)
DatabasePostgreSQL 16 (Docker) or SQLite (local dev)
AuthSimpleJWT (15-min access, 30-day refresh tokens)
OCREasyOCR
AIOpenAI GPT-4o (function calling + vision)
EncryptionPyNaCl (libsodium bindings)
API Docsdrf-spectacular (OpenAPI 3.0)
Testingpytest + pytest-django

Mobile Client

LayerTechnology
FrameworkReact Native 0.76 + Expo 52
LanguageTypeScript (strict)
Local DBDrizzle ORM + expo-sqlite
UI StateZustand
Server StateReact Query + react-query-kit
StylingNativeWind (Tailwind CSS)
Formsreact-hook-form + Zod
Encryptiontweetnacl + expo-secure-store
NetworkingAxios with JWT interceptors
TestingJest + React Testing Library

Infrastructure

ComponentTechnology
ContainerizationDocker + Docker Compose
DatabasePostgreSQL 16 (Docker volume)
CI/CDGitHub Actions
Task Runnerjust (Justfile)
Monorepopnpm workspaces