How bitflowcode/gestordegastos works
Project type and purpose
• This is a Next.js full-stack (mostly frontend-centric) web application using the App Router (app/ directory).
• Purpose: an expense-tracking UI that lets users input, view, and export expense data (e.g., via jsPDF), with theming support and a collection of reusable UI components.
File structure
• Top-level config: next.config.js, tailwind.config.ts, postcss.config.mjs, eslint.config.mjs, tsconfig.json
• Public static assets: /public
• Application entry (App Router): /src/app
• layout.tsx (theme-provider, global CSS)
• page.tsx (home/dashboard)
• globals.css (base styling)
• UI component library: /src/components/ui (atomic components: Button, Input, Table, etc.)
• Cross-cutting component: /src/components/theme-provider.tsx
• Domain-specific components: expense-card, expense-form, expense-history, settings-view
• Hooks for state/data-logic: /src/hooks/use-expenses.ts
• Utility functions: /src/lib/utils.ts
• Type definitions for libraries: /src/types/jspdf.d.ts
README for technical stack
• Next.js (React, server & client components)
• TypeScript
• Tailwind CSS & PostCSS
• Vercel deployment
Main components and relationships
a. Next.js Server Layer (app/)
• layout.tsx: applies theme, global styles
• page.tsx: server-rendered page shell
b. React Client Components
• UI primitives (Button, Input, Table, etc.)
• Domain widgets (ExpenseForm, ExpenseCard, ExpenseHistory)
• ThemeToggle, AlertDialog, Toast, etc.
c. State/Data Layer
• useExpenses hook: manages in-memory expense state and persistence (e.g., localStorage or API)
• lib/utils.ts: PDF generation via jsPDF; any data-transformation helpers
d. Public Assets
• Static images, fonts in /public
e. Build & Deployment
• Next.js build pipeline (Webpack/RSC)
• Tailwind/PostCSS plugin
• ESLint, TypeScript checks
• Hosted on Vercel
Architectural patterns & principles
• Component-based / Atomic design: primitive vs. composite UI elements
• Separation of concerns: presentation (UI comps) vs. logic (hooks, utils)
• App Router with server components for layout and SEO
• Single page app interactions for expense management