How aryan7691/finsight works
Project type and purpose
• This is a full-stack, server-rendered React application built with Next.js (app directory), Prisma ORM, and Inngest for background jobs, focused on personal finance management (accounts, budgets, transactions, email notifications).
File structure
• Top-level directories:
• app/ – Next.js “app router” pages, layouts, server & client components
• actions/ – shared server functions for CRUD and background tasks (account, budget, transaction, email, seed)
• lib/ – utilities (Prisma client, Inngest client and function wrappers, auth checks)
• prisma/ – database schema + migration history
• components/ – reusable UI components (drawers, headers, forms, tables, UI primitives)
• hooks/ – custom React hooks (use-fetch)
• emails/ – email templates (JSX)
• public/, styles, config files
• API endpoints:
• app/api/inngest/route.js – entrypoint for Inngest webhooks
• app/api/seed/route.js – seeding endpoint
• Build & deployment:
• next.config.mjs, tailwind.config.js, jsconfig.json, ESLint, PostCSS.
README
• (Empty in this case; architecture must be inferred from code.)
Main components and interactions
a. Frontend (Next.js App)
– Server Components (SSR pages under app/…)
– Client Components (transaction form, charts, tables)
– Custom hooks (use-fetch) for calling internal API
b. API Layer (Next.js API routes)
– REST or webhook endpoints for seeding & Inngest
c. Business Logic (actions/)
– account.js, budget.js, transaction.js, send-email.js, seed.js
– Invoked either directly by API routes or by background jobs
d. Background Job Processor (Inngest)
– lib/inngest/client.js & function.js register and invoke long-running jobs
e. Database (PostgreSQL via Prisma)
– lib/prisma.js provides a singleton client
– prisma/schema.prisma defines models (Account, Transaction, Budget, etc.)
f. External Services
– Email service (SendGrid, SES, etc. – invoked by send-email actions)
Architectural patterns & design principles
• Container pattern (clear separation between frontend, backend, DB, jobs)
• Server Components in Next.js for SSR and data fetching
• Single source of truth for business logic in actions/
• Background processing via event-driven Inngest functions
• Prisma migrations for schema evolution