How 21d4n/expense-tracker works
Expense Tracker is a Next.js personal-finance app: users register or log in, then view per-user income, expenses, balance, and transaction history; they can create, edit, delete, and filter transactions. Server actions and pages enforce ownership and use Prisma for persistence. The sampled code confirms the dashboard query and authentication flow; transaction-action internals and several route implementations were not sampled, so those links reflect documented capabilities rather than inferred call details.
Main entry points: page.tsx Dashboard page · lib/auth.ts Session and auth · prisma.ts Prisma client · actions/auth.ts Auth actions
Components 21
Account access
- Landing page
src/app/page.tsx - Login page
src/app/(auth)/login/page.tsx - Login form
src/app/(auth)/login/login-form.tsx - Registration page
src/app/(auth)/register/page.tsx - Registration form
src/app/(auth)/register/register-form.tsx - Auth actions
src/actions/auth.ts - Logout route
src/app/(auth)/logout/route.ts
Financial overview
- Dashboard page
src/app/dashboard/page.tsx - Summary cards
src/components/dashboard/SummaryCards.tsx - Dashboard filters
src/components/dashboard/FilterTabs.tsx - Transaction history
src/components/dashboard/TransactionList.tsx
Transaction management
- Transaction pages
src/app/dashboard/transactions - Transaction form
src/components/transactions/transaction-form.tsx - Transaction actions
src/actions/transactions.ts
Security and storage
- Route middleware
src/middleware.ts - Session and auth
src/lib/auth.ts - PostgreSQL database
prisma/schema.prisma - Prisma client
src/lib/prisma.ts
Other components
- User
- Browser
- HttpOnly session cookie
Connections 28
- User → Browser: uses
- Browser → Landing page: opens
- Browser → Login page: opens
- Browser → Registration page: opens
- Login page → Login form: renders
- Registration page → Registration form: renders
- Login form → Auth actions: submits to
- Registration form → Auth actions: submits to
- Auth actions → Prisma client: reads/writes accounts
- Auth actions → Session and auth: hashes; creates session
- Session and auth → Prisma client: reads/writes sessions
- Session and auth → HttpOnly session cookie: sets/reads/deletes
- Browser → Route middleware: requests routes
- Route middleware → HttpOnly session cookie: reads
- Browser → Logout route: requests logout
- Logout route → Session and auth: deletes session
- Dashboard page → Session and auth: requires verified session
- Browser → Dashboard page: opens dashboard
- Dashboard page → Prisma client: queries user transactions
- Prisma client → PostgreSQL database: queries
- Dashboard page → Summary cards: passes totals
- Dashboard page → Dashboard filters: passes active filter
- Dashboard page → Transaction history: passes transaction rows
- Browser → Transaction pages: opens transaction pages
- Transaction pages → Transaction form: renders form
- Transaction form → Transaction actions: submits create/edit
- Transaction actions → Prisma client: manages owned transactions
- Transaction history → Transaction pages: links edit