A full-stack personal finance application built with modern web technologies and a monorepo structure for efficient development and type sharing.
personal-finance-app/
βββ packages/
β βββ shared-types/ # Shared TypeScript types
βββ server/ # Backend API (Bun + Express)
βββ web/ # Frontend app (React + Vite)
βββ package.json # Root workspace configuration
βββ turbo.json # Turborepo configuration
- Runtime: Bun
- Framework: Express.js
- Database: PostgreSQL with Bun's native SQL
- Authentication: JWT
- Validation: Express Validator + Zod
- Code Quality: Biome (linting + formatting)
- Framework: React 19
- Build Tool: Vite
- Routing: TanStack Router
- State Management: Zustand
- Data Fetching: TanStack Query + Axios
- Forms: TanStack Form + Zod
- Styling: CSS Modules
- Code Quality: Biome (linting + formatting)
- Language: TypeScript
- Purpose: Shared type definitions between frontend and backend
- Build: TypeScript compiler
- Bun (latest version)
- PostgreSQL database
- Node.js 18+ (for compatibility)
-
Clone the repository
git clone <your-repo-url> cd personal-finance-app
-
Install dependencies
bun install
-
Set up environment variables
Create
.envfiles in the server directory:# server/.env DATABASE_URL=postgresql://username:password@localhost:5432/personal_finance JWT_SECRET=your-super-secret-jwt-key JWT_EXPIRES_IN=7d NODE_ENV=development PORT=3000 -
Set up the database
# Run database migrations cd server bun run db:migrate
-
Build shared types
bun run build:types
bun run devThis will start both the backend server and frontend development server concurrently.
# Start backend only
bun run dev:server
# Start frontend only
bun run dev:web
# Build and watch shared types
cd packages/shared-types
bun run devbun run dev- Start all services in development modebun run build- Build all packages and applicationsbun run lint- Lint all packagesbun run format- Format all packages
bun run dev- Start development server with hot reloadbun run build- Build for productionbun run start- Start production serverbun run lint- Lint TypeScript filesbun run format- Format TypeScript filesbun run db:migrate- Run database migrations
bun run dev- Start Vite development serverbun run build- Build for productionbun run preview- Preview production buildbun run lint- Lint TypeScript/React filesbun run format- Format TypeScript/React files
bun run build- Compile TypeScript to JavaScriptbun run dev- Watch and compile on changesbun run lint- Lint TypeScript filesbun run format- Format TypeScript files
The shared types package includes:
ApiResponse<T>- Standard API response wrapperPaginatedResponse<T>- Paginated data responsePaginationMetadata- Pagination infoBaseTableQuery- Common query parameters
- Auth:
LoginRequest,SignupRequest,AuthResponse,JwtPayload - User:
User,UserProfile - Transaction:
Transaction,CreateTransactionRequest,TransactionQuery, etc. - Budget:
Budget,CreateBudgetRequest,BudgetWithSpending - Pot:
Pot,CreatePotRequest,PotProgress - Recurring Bills:
RecurringBill,RecurringBillPayment, etc. - Overview:
OverviewData,MonthlyTrend
Each package has its own tsconfig.json with appropriate settings:
- Server: Configured for Node.js with Bun
- Web: Configured for React with Vite
- Shared Types: Configured for library compilation
All packages use Biome for consistent linting and formatting:
- Shared configuration in
biome.json - Consistent code style across frontend and backend
- Pre-configured rules for TypeScript and React
- Workspace: Bun workspaces for dependency management
- Turborepo: Pipeline configuration for builds and tasks
- Shared Dependencies: Types package linked via workspace protocol
POST /api/auth/login- User loginPOST /api/auth/signup- User registrationGET /api/auth/profile- Get user profile
GET /api/transactions- List transactions (paginated)POST /api/transactions- Create transactionGET /api/transactions/:id- Get specific transactionPUT /api/transactions/:id- Update transactionDELETE /api/transactions/:id- Delete transactionGET /api/transactions/categories- Get transaction categoriesGET /api/transactions/stats- Get transaction statistics
GET /api/budgets- List budgetsPOST /api/budgets- Create budgetGET /api/budgets/:id- Get specific budgetPUT /api/budgets/:id- Update budgetDELETE /api/budgets/:id- Delete budgetGET /api/budgets/:id/spending- Get budget with spending info
GET /api/pots- List potsPOST /api/pots- Create potGET /api/pots/:id- Get specific potPUT /api/pots/:id- Update potDELETE /api/pots/:id- Delete pot (returns money)POST /api/pots/:id/add- Add money to potPOST /api/pots/:id/withdraw- Withdraw money from potGET /api/pots/:id/progress- Get pot progress
GET /api/recurring-bills- List recurring bills (paginated)POST /api/recurring-bills- Create recurring billGET /api/recurring-bills/:id- Get specific recurring billPUT /api/recurring-bills/:id- Update recurring billDELETE /api/recurring-bills/:id- Delete recurring billPATCH /api/recurring-bills/payments/:paymentId/paid- Mark bill as paidGET /api/recurring-bills/due-soon- Get bills due soon
GET /api/overview- Get dashboard overview dataGET /api/overview/monthly-trends- Get monthly income/expense trends
cd server
bun run build
bun run startcd web
bun run build
# Deploy the 'dist' folder to your hosting providerCreate Docker configurations for each service as needed.
- Follow the established code style (enforced by Biome)
- Add types to the shared package when creating new APIs
- Test both frontend and backend when making changes
- Update this README when adding new features
[Your License Here]