How soren-starck/budget-flow works
Project Type and Purpose
• Budget Flow is a single-page/full-stack-style application built on Next.js.
• It provides a UI for entering income/expense data, calculates savings allocations, and renders interactive charts (e.g. Sankey) in the browser.
File Structure
• Top-level: Dockerfile/docker-compose (containerization), next.config.ts, Tailwind + PostCSS configs, package manifests.
• src/app: Next.js “app” directory with layout.tsx, page.tsx (SSR/SSG entry points).
• src/components: React UI—buttons, forms, tables, Sankey chart wrapper, Shadcn-powered UI primitives.
• src/lib: schema (Zod), store (Zustand state), utils (calculation helpers).
• src/providers: theme-provider (context).
• public: static assets (logo.svg, preview.png).
README for Stack & Flow
• Built With: Next.js (React + SSR), Shadcn (component library), Tailwind CSS (styles), Nivo (charts), Zustand (state).
• No external API/backend—logic is executed client-side or during SSR/SSG.
A. Client (Web Browser)
B. Next.js Server/Runtime (SSR/SSG, static asset serving)
C. React UI Layer
1. Pages (layout, page)
2. Components (forms, inputs, banners, tables, Sankey chart component)
3. Providers (ThemeProvider)
D. State Management (Zustand Store)
E. Business Logic (Utils + Schema Validation)
F. Charting Engine (Nivo)
G. Static Assets (public folder via CDN or built-in server)
H. Container/Hosting (Docker + docker-compose)
Relationships & Data Flow
• Browser → Next.js Server: initial page request → SSR/SSG → HTML/CSS/JS delivered.
• Browser (client-side) → React UI: hydration/post-hydration rendering.
• User Input (forms) → Zustand Store (update state) → Utils (calculate savings) → Store/state updated.
• Store → React UI: re-render components (tables, Sankey charts).
• React UI → Nivo Library: generate chart visuals.
• Next.js Server → public assets (logo, CSS) served via CDN or static route.
Architectural Patterns
• Component-Driven Architecture (atomic Shadcn UI primitives).
• Unidirectional Data Flow (Zustand store as single source of truth).
• SSR/SSG with CSR hydration (Next.js “app” router).
• Modular separation: UI vs. state vs. business-logic utils.
Relevant Technologies & Frameworks
• Next.js (React, routing, SSR/SSG)
• React + TypeScript
• Zustand (state management)
• Zod (schema validation)
• Tailwind CSS (utility-first styling)
• Shadcn/UI (design system)
• Nivo (visualization)
• Docker + docker-compose (containerization)