The Problem

Households and small teams struggle to keep financial data from multiple accounts in sync, categorize spending, and extract actionable insights without manual effort or expensive tools. The lack of a unified, AI‑enhanced dashboard leads to fragmented tracking and missed budgeting opportunities.

What This Does

Badget delivers a single‑page financial hub built on Next.js 15 and TypeScript. Core UI lives under src/components/, while server‑side actions (e.g., src/actions/plaid-actions.ts, src/actions/user-actions.ts) handle data ingestion, authentication (src/app/api/auth/[...all]/route.ts), and AI‑driven budgeting (src/actions/ai-budget-actions.ts). Content such as help articles and blog posts are stored as MDX under content/ and compiled by the .content-collections generator.

Key files:

  • src/app/dashboard/page.tsx – the protected dashboard entry point.
  • src/components/dashboard/analytics-section.tsx – renders AI insights.
  • prisma/schema.prisma & prisma/seed.ts – define and populate the PostgreSQL data model.

How It Is Wired

Execution starts when Next.js runs pnpm dev (see How To Use It). The framework loads src/app/layout.tsx, which wraps every page in the ThemeProvider and AuthProvider. A request to /dashboard invokes the route defined in src/app/dashboard/page.tsx.

  1. Authenticationsrc/app/api/auth/[...all]/route.ts validates the session via Better‑auth and sets a JWT cookie.
  2. Data Fetch – the page calls src/actions/dashboard-actions.ts (most‑connected module: src/actions/user-actions with 6 inbound imports) to fetch accounts, transactions, and AI predictions via Prisma (src/lib/prisma.ts).
  3. AI Budgetingsrc/actions/ai-budget-actions.ts sends relevant data to the AI endpoint (configured in src/lib/openai.ts, not listed but implied by the “AI‑Powered” branding). Results flow back to the dashboard components (analytics-section, metrics-section).
  4. Rendering – UI components compose async loaders (src/components/dashboard/async-components.tsx, src/components/financial/financial-async-components.tsx) that lazily import heavy charts (src/components/charts/LineChartSupport.tsx). The import graph shows these async components have an instability of 1, meaning they are leaf nodes with no downstream imports, keeping their blast radius low.

All database writes funnel through Prisma client instances created in src/lib/prisma.ts. No circular imports were detected, simplifying refactoring.

How To Use It

# Clone the repo
git clone https://github.com/moses-y/Badget.git
cd Badget

# Install dependencies (pnpm is the declared manager)
pnpm install

# Copy example env and fill required keys (PLAID, DATABASE_URL, NEXTAUTH_SECRET, etc.)
cp .env.example .env
# edit .env with your values

# Run database migrations and seed data
pnpm prisma migrate dev   # creates tables from prisma/schema.prisma
pnpm prisma db seed       # executes prisma/seed.ts

# Start the dev server
pnpm dev                  # runs `next dev` per package.json scripts

The server listens on http://localhost:3000. Auth routes are under /api/auth, and the dashboard is protected at /dashboard.

Real‑World Use

A fintech startup can embed Badget as its internal expense portal: after configuring the Plaid client ID/secret in .env, the platform automatically pulls checking and credit‑card transactions, runs the AI budgeting routine nightly, and presents family‑wide spend summaries on the /dashboard page. No additional UI work is needed beyond branding the marketing pages in src/app/(marketing).

Code Health & Issues

  • High – No test suite – 239 source files, zero test files.
  • High – No CI workflow – repository lacks any GitHub Actions or other build gate.
  • High – Deploy artifact without build gate – e.g., src/components/charts/LineChartSupport.tsx ships without validation.
  • Medium – Dependabot missing – only one manifest (package.json) and no update bot configured.
  • Medium – Postinstall scriptpackage.json defines a postinstall that runs external code; CI should disable scripts or move work to explicit steps.
  • Medium – Deep nesting – dialogs such as src/components/dialog/bond-asset-dialog.tsx reach 8‑level indentation, making logic hard to follow.
  • Medium – Duplicated code blocks – identical 6‑line snippets appear in >80 files (e.g., content‑collection cache config).
  • Medium – Oversized filessrc/components/charts/LineChartSupport.tsx exceeds 800 lines; splitting by responsibility is advisable.
  • Low – TODO/FIXME markers – five unresolved comments in src/components/dashboard/metrics-section.tsx.
  • Low – Missing repo conventions – no .editorconfig, .gitattributes, or formatter config.

The Bottom Line

Badget provides a complete Next.js‑based financial dashboard with AI‑driven insights and a clear separation between auth, data, and UI layers. The codebase is functional but lacks automated testing, CI, and some refactoring hygiene, which raises maintenance risk. It is suitable for teams that can invest in adding a test suite and CI pipeline while leveraging the existing UI and Prisma integration.