Finances API Architecture

Finances API Architecture An architecture diagram generated by Archify. Frontend Client · finances-frontend · Architecture component Frontend Client finances-frontend Hono API Server · TypeScript :3002 · Architecture component Hono API Server TypeScript :3002 Better Auth · Session cookies · Architecture component · httpOnly + 30d Better Auth Session cookies httpOnly + 30d PostgreSQL · Drizzle ORM · Architecture component PostgreSQL Drizzle ORM Plaid API · Banking sync · Architecture component · sandbox/prod Plaid API Banking sync sandbox/prod OpenAI API · Receipt scanning · Architecture component · gpt-4o vision OpenAI API Receipt scanning gpt-4o vision Plaid Sync Worker · node-cron · Architecture component · daily @ 00:00 Plaid Sync Worker node-cron daily @ 00:00 File Storage · receipts + backgrounds · Architecture component · formidable uploads File Storage receipts + backgrounds formidable uploads HTTPS + cookies session verify Drizzle queries scan receipt trigger sync fetch transactions upload files Legend Backend Database Cloud Security External

Backend Stack

  • • Hono web framework with TypeScript
  • • Hexagonal architecture (domain → application → infrastructure)
  • • Drizzle ORM for PostgreSQL access
  • • Port 3002 in development

Authentication

  • • Better Auth with Drizzle adapter
  • • httpOnly session cookies (30 days)
  • • Replaced legacy JWT Bearer pattern
  • • bcrypt password hashing

External Integrations

  • • Plaid API for automatic bank sync (daily cron job)
  • • OpenAI gpt-4o vision for receipt text extraction
  • • File storage for receipts and profile backgrounds