Back to Projects

Full-Stack FinTech2025

Casestudy 04

Spendora

Real-Time Financial Telemetry & Expense Intelligence

Next.js 15PostgreSQLPrismaClerkZodRecharts

The Vision & Architecture

Illuminating financial habits with real-time telemetry and predictive forecasting.

Spendora is a full-stack personal finance and telemetry platform with real-time transaction tracking, interactive Recharts analytics, pre-aggregated history tables for O(1) chart lookups, and end-to-end type safety from PostgreSQL through Prisma and Zod runtime validation.

O(1)History Chart Lookups
<200msp95 Query Latency
40%FCP Improvement
100%Type Safety Coverage

Core Capabilities

  • Zero-Client-Bundle Data Layer

    Architected with Next.js Server Components and React Suspense boundaries, improving First Contentful Paint by 40% (1.2s to 0.72s) on cold loads.

  • Pre-Aggregated History Tables

    Engineered MonthHistory and YearHistory rollups that turn expensive dynamic aggregations into instantaneous O(1) lookup queries for charts.

  • Atomic Transactional Writes

    Executes category updates and journal entries within prisma.$transaction blocks to guarantee complete ACID consistency across all records.

  • End-to-End Type Safety

    Schema-first type inference connecting PostgreSQL schemas to Prisma models and Zod runtime validation at API and form boundaries.

  • Composite Query Indexing

    Eliminated full-table scans by indexing (user_id, date, category), driving p95 query latency under 200ms for a 4× throughput improvement.

Technology Stack

Next.js 15 App RouterFull-Stack Framework
PostgreSQLACID Relational Core
Prisma ORMType-Safe Data Layer
ClerkJWT Authentication
Zod & React Hook FormRuntime Validation
Recharts & Tailwind CSSInteractive Visuals

Architectural Decisions

  • Pre-aggregated history tables over runtime SUM queries

    Calculating monthly and yearly totals on every dashboard load scales poorly. Pre-aggregating at write time guarantees instant chart rendering.

  • Server Actions with Zod validation

    Handling mutations via Server Actions eliminates client API boilerplate while enforcing strict server-side authorization and validation.