A high-performance, minimal personal finance dashboard split into decoupled client/ and server/ packages.
expense-tracker/
βββ client/ # Next.js 15 Frontend Application
β βββ app/ # Next.js App Router (Dashboard, Analytics, Categories, Transactions, Settings, Profile)
β βββ components/ # Reusable UI & Layout Components (Dock Sidebar, Navbar, Modals)
β βββ features/ # Domain feature modules (Dashboard, Expenses, Analytics, Categories, Profile)
β βββ lib/
β β βββ api/api-client.ts # Decoupled API Client (supports NEXT_PUBLIC_API_URL)
β β βββ auth/auth-context.ts# Pluggable Auth Context (login, OAuth, logout slots)
β β βββ config/app-config.ts# Configurable Backend Connection Modes (LOCAL_PRISMA vs REMOTE_HTTP)
β βββ package.json
β βββ tsconfig.json
β
βββ server/ # Standalone Express & Database Server
β βββ src/ # Backend API Controllers & Route Handlers
β βββ prisma/ # Prisma PostgreSQL Schema & Database Seed Scripts
β βββ package.json
β βββ tsconfig.json
β βββ .env
β
βββ package.json # Root Monorepo Scripts
- Place your backend API code inside
server/src/. - Configure environment variables in
server/.env:PORT=5000 DATABASE_URL="postgresql://user:password@localhost:5432/ledger?schema=public" CORS_ORIGIN="http://localhost:3000"
- In
client/.env, point the frontend API client to your backend server:NEXT_PUBLIC_BACKEND_MODE="REMOTE_HTTP" NEXT_PUBLIC_API_URL="http://localhost:5000/api/v1"
- Set
DATABASE_URLinclient/.env. - Run database migrations:
cd client npx prisma db push
# Install client dependencies
cd client && npm install
# Install server dependencies
cd ../server && npm install# From the root directory:
# Start Next.js Frontend (Runs on http://localhost:3000)
npm run dev:client
# Start Express Backend Server (Runs on http://localhost:5000)
npm run dev:server