Simple Budget is a full-stack web application that helps you manage your personal finances through a form of "envelope" saving. The application provides real-time financial insights, goal tracking, and comprehensive budget management through Accounts, Envelopes, Goals, and analytics.
- Backend: Axum web framework using Hotwire for HTML-over-the-wire
- Frontend: Server-side rendered HTML with TailwindCSS and Stimulus controllers
- Database: PostgreSQL
- Authentication: OpenID Connect (Google Sign-In)
- Observability: Jaeger tracing and Prometheus metrics
- Multi-Account Management: Track multiple bank accounts including assets and debts
- Envelope Budgeting: Allocate funds to different spending categories
- Smart Goal Tracking: Set and track financial goals with flexible recurrence patterns (daily, weekly, monthly, quarterly, yearly)
- Real-time Analytics: Per-day spending allowances, goal progress, and balance calculations
- Automatic Goal Processing: Background jobs handle recurring goal resets and accumulation
- Timezone Support: User-configurable timezone preferences
- Rust (2024 edition)
- PostgreSQL database
- Docker and Docker Compose
- Node.js (for TailwindCSS compilation)
-
Clone the repository
git clone https://github.com/corybuecker/simple-budget cd simple-budget -
Start development services
cd dev && docker-compose up -d
-
Set up environment variables
export DATABASE_URL="postgresql://simple_budget@localhost:5432/simple_budget" export GOOGLE_CALLBACK_URL="http://localhost:8000/authentication/callback" export GOOGLE_CLIENT_ID="<must be provided>" export GOOGLE_CLIENT_SECRET="<must be provided>" export SECRET_KEY="<must be provided>"
-
Compile CSS
npx tailwindcss -i input.css -o static/app.css
-
Start the development server
cargo run
cargo install cargo-watch
cargo watch -x runFor CSS changes, run TailwindCSS in watch mode:
npx tailwindcss -i input.css -o static/app.css --watchThe Docker Compose setup provides:
- PostgreSQL: Database server (port 5432)
- Prometheus: Metrics collection (port 9090)
- Jaeger: Distributed tracing (port 16686)
Apply the Kubernetes manifests:
kubectl apply -f k8s/The application includes:
- Namespace isolation
- Resource limits (512M memory, 150m CPU)
- Health check endpoints
- Gateway API routing configuration
├── src/
│ ├── models/ # Data models (Account, Envelope, Goal, User)
│ ├── routes/ # HTTP route handlers
│ ├── middleware/ # Authentication and CSRF middleware
│ ├── errors.rs # Error handling and HTTP responses
│ └── main.rs # Application entry point
├── migrations/ # Database schema migrations
├── assets/ # Static assets and compiled CSS
├── templates_legacy/ # Tera HTML templates
├── k8s/ # Kubernetes deployment manifests
├── ios/ # Companion iOS application
└── dev/docker-compose.yaml # Local development environment
Core entities include:
- users: User profiles with OAuth integration
- accounts: Financial accounts (assets and debts)
- envelopes: Budget categories with allocated amounts
- goals: Financial targets with recurrence patterns
- sessions: Authentication sessions with CSRF protection
Run the test suite:
cargo testRequired environment variables:
DATABASE_URL: PostgreSQL connection stringSECRET_KEY: Session signing key (generate securely for production)GOOGLE_CALLBACK_URL: Definition TBAGOOGLE_CLIENT_ID: Definition TBAGOOGLE_CLIENT_SECRET: Definition TBA
Optional:
LOG_LEVEL: Logging verbosity, e.g. "debug"METRICS_ENDPOINT: Prometheus metrics export URLTRACING_ENDPOINT: Jaeger traces export URL
MIT License - see LICENSE file for details.
- This README was written by AI.