A comprehensive personal budget management application with multilingual support, expense tracking, savings goals, and financial reporting. Built with modular architecture following SOLID principles.
# Clone repository
git clone <repository-url>
cd Windsurf_Budget
# Create database
mysql -u root -p
CREATE DATABASE budget_app;
EXIT;
# Import schema
cd backend
mysql -u root budget_app < database/schema.sql
# Seed with sample data
npm run seed
# Backend (already configured in .env)
cd backend
# Edit .env if needed (DB_HOST, DB_USER, DB_PASSWORD, etc.)
# Frontend
cd ../frontend
# .env already created with API_URL
# Windows
start-dev.bat
# Linux/Mac
chmod +x start-dev.sh
./start-dev.sh
# Terminal 1 - Backend
cd backend
npm run dev
# Terminal 2 - Frontend
cd frontend
npm run dev
Sample users created with seed data:
backend/
โโโ modules/ # Feature-based modules
โ โโโ auth/ # Authentication (login, register)
โ โ โโโ auth.controller.js
โ โ โโโ auth.service.js
โ โ โโโ auth.repository.js
โ โ โโโ auth.routes.js
โ โโโ user/ # User management
โ โ โโโ user.controller.js
โ โ โโโ user.service.js
โ โ โโโ user.repository.js
โ โ โโโ user.routes.js
โ โโโ transaction/ # Transaction CRUD
โ โ โโโ transaction.controller.js
โ โ โโโ transaction.service.js
โ โ โโโ transaction.repository.js
โ โ โโโ transaction.routes.js
โ โโโ category/ # Category management
โ โ โโโ category.controller.js
โ โ โโโ category.service.js
โ โ โโโ category.repository.js
โ โ โโโ category.routes.js
โ โโโ savings/ # Savings goals
โ โ โโโ savings.controller.js
โ โ โโโ savings.service.js
โ โ โโโ savings.repository.js
โ โ โโโ savings.routes.js
โ โโโ report/ # Analytics
โ โโโ report.controller.js
โ โโโ report.service.js
โ โโโ report.repository.js
โ โโโ report.routes.js
โโโ middlewares/ # Cross-cutting concerns
โ โโโ auth.middleware.js # JWT validation
โ โโโ error.middleware.js # Centralized error handling
โ โโโ validation.middleware.js
โโโ utils/ # Shared utilities
โ โโโ logger.js # Logging utility
โ โโโ database.js # DB connection
โ โโโ helpers.js # Common helpers
โโโ config/ # Configuration
โ โโโ database.config.js
โโโ database/ # Database setup
โโโ schema.sql # Database structure
โโโ seeds.sql # Sample data
frontend/src/
โโโ routes/ # Pages & routing
โ โโโ (auth)/ # Authentication pages
โ โ โโโ login/
โ โ โโโ register/
โ โโโ dashboard/ # Main dashboard
โ โโโ transactions/ # Transaction pages
โ โ โโโ +page.svelte # List view
โ โ โโโ new/ # Create form
โ โ โโโ [id]/ # Edit/view details
โ โโโ categories/ # Category management
โ โโโ savings/ # Savings goals
โ โ โโโ +page.svelte # Goals list
โ โ โโโ new/ # Create goal
โ โ โโโ [id]/ # Goal details & contributions
โ โโโ reports/ # Analytics pages
โ โโโ settings/ # App settings
โโโ lib/
โ โโโ components/ # Reusable UI components
โ โ โโโ ui/ # Base UI components
โ โ โโโ forms/ # Form components
โ โ โโโ charts/ # Chart components
โ โโโ services/ # API layer
โ โ โโโ auth.api.js
โ โ โโโ transactions.api.js
โ โ โโโ categories.api.js
โ โ โโโ savings.api.js
โ โ โโโ api.service.js # Base API client
โ โโโ stores/ # State management
โ โ โโโ auth.store.js
โ โ โโโ transactions.store.js
โ โ โโโ categories.store.js
โ โ โโโ savings.store.js
โ โโโ translations/ # Multilingual system
โ โ โโโ general.js # Common translations
โ โ โโโ routes/ # Route-specific translations
โ โ โโโ transactions.js
โ โ โโโ categories.js
โ โ โโโ savings.js
โ โ โโโ settings.js
โ โโโ settings/ # App configuration
โ โ โโโ language.js # Language management
โ โโโ utils/ # Helper functions
โโโ assets/ # Static assets
POST /api/auth/login - User authenticationPOST /api/auth/register - User registrationGET /api/auth/profile - Get user profilePUT /api/auth/profile - Update profilePOST /api/auth/logout - User logoutGET /api/transactions - List with pagination & filteringPOST /api/transactions - Create new transactionGET /api/transactions/:id - Get transaction detailsPUT /api/transactions/:id - Update transactionDELETE /api/transactions/:id - Delete transactionGET /api/categories - List user categoriesPOST /api/categories - Create categoryPUT /api/categories/:id - Update categoryDELETE /api/categories/:id - Delete categoryGET /api/savings - List savings goalsPOST /api/savings - Create savings goalGET /api/savings/:id - Get goal detailsPUT /api/savings/:id - Update goalDELETE /api/savings/:id - Delete goalPOST /api/savings/:id/contributions - Add contributionGET /api/savings/:id/contributions - Get contribution historyDELETE /api/savings/contributions/:id - Delete contributionGET /api/reports/summary - Financial summaryGET /api/reports/trends - Income/expense trendsGET /api/reports/categories - Category breakdownsGET /api/reports/savings - Savings progressGET /api/settings/language - Get language preferencePUT /api/settings/language - Update language preferencecd backend
npm test
cd frontend
npm run check
npm run lint
translations/
โโโ general.js # Common translations
โโโ routes/ # Route-specific translations
โโโ transactions.js # Transaction module
โโโ categories.js # Category module
โโโ savings.js # Savings module
โโโ reports.js # Reports module
โโโ settings.js # Settings module
import { getLabel } from "$lib/settings/language.js";
// Automatic route detection
const title = getLabel("title");
// Manual language specification
const title = getLabel("title", "en");
# Quick start with automatic scripts
./start-dev.sh # Linux/Mac
start-dev.bat # Windows
# Manual development setup
npm run dev:backend # Terminal 1
npm run dev:frontend # Terminal 2
# Backend production
cd backend
npm run build
npm start
# Frontend production
cd frontend
npm run build
npm run preview
# Backend (.env)
NODE_ENV=production
DB_HOST=your-db-host
DB_USER=your-db-user
DB_PASSWORD=your-db-password
DB_NAME=budget_app
JWT_SECRET=your-jwt-secret
FRONTEND_URL=https://your-domain.com
# Frontend (.env)
VITE_API_URL=https://your-api-domain.com/api
# Dockerfile configuration available
docker-compose up -d # Full stack deployment
git checkout -b feature/amazing-featuregit commit -m 'Add amazing feature'git push origin feature/amazing-featurefeature/ - New featuresbugfix/ - Bug fixeshotfix/ - Critical fixesdocs/ - Documentation updates# Check MySQL/MariaDB status
sudo systemctl status mysql
# Verify database exists
mysql -u root -p -e "SHOW DATABASES;"
# Recreate database
mysql -u root -p -e "DROP DATABASE IF EXISTS budget_app; CREATE DATABASE budget_app;"
# Check environment variables
echo $FRONTEND_URL
echo $VITE_API_URL
# Verify backend CORS configuration
# Check backend/middlewares/auth.middleware.js
# Reset seed data
cd backend
npm run seed
# Check JWT secret
echo $JWT_SECRET
# Clear node modules
rm -rf node_modules package-lock.json
npm install
# Check for TypeScript errors
npm run check
๐ Happy Budgeting with Windsurf Budget! ๐ฐ๐
Built with โค๏ธ using modern web technologies and best practices