Skip to main content

Architecture

Cashlytics uses a Next.js App Router architecture with a strong separation between pages, components, actions, and data access.

High-Level Structure

  • src/app/: route-level entry points and API routes
  • src/actions/: server actions for reads and writes
  • src/components/: UI composition layers
  • src/lib/: database, AI integration, validation, and shared utilities
  • src/hooks/: reusable client behavior hooks

Design Patterns

  • Atomic-style component hierarchy (atoms, molecules, organisms, layout)
  • Server Actions as the mutation boundary
  • Zod validation at data boundaries
  • Typed entities inferred from Drizzle schema

Data Flow

  1. UI triggers an action or page-level fetch.
  2. Server Action validates input and calls Drizzle ORM.
  3. Action returns typed response payload.
  4. Relevant routes are revalidated after writes.
  • cashlytics/docs/architecture/README.md
  • cashlytics/docs/architecture/database-schema.md
  • cashlytics/docs/architecture/ai-integration.md