A personal budget management app built with Laravel 12, React 19, and Inertia.js 2. Import your bank CSV statements, automatically categorize transactions with AI (Google Gemini), and visualize your spending by category and month.
Live: https://budget.lamberttraccard.dev (Laravel Cloud, deployed on every push to main; see Deployment).
- CSV Import — Import bank statements from Revolut or Banque Populaire (automatic format detection)
- AI Categorization — Transactions are automatically categorized via Google Gemini (3 passes: bank metadata, merchant rules, then AI)
- Monthly Dashboard — Spending overview by category with month-over-month comparison
- Recurring Transactions — Automatic detection of subscriptions and fixed charges
- Multi-Account — Manage multiple bank accounts (personal, professional) in a single interface
- Search — Full-text search across all your transactions
- Merchant Rules — Create custom rules to automatically categorize transactions from a specific merchant
- Deduplication — Already-imported transactions are automatically skipped (SHA-256 hash)
- PWA — Installable on mobile as a native-like app
- MCP Server — Query your budget data from an AI agent (Claude, etc.)
- 2FA — Two-factor authentication available
| Tool | Version | Notes |
|---|---|---|
| Docker Desktop | Latest | docker.com/products/docker-desktop |
| Gemini API Key | — | Free at aistudio.google.com/apikey (required for AI categorization) |
That's it. Docker handles the rest (PHP 8.5, PostgreSQL 18 with pgvector, Mailpit, Node.js, Bun).
git clone https://github.com/lamberttraccard/budget-app.git
cd budget-appSince Sail runs inside Docker, you first need to install PHP dependencies via a temporary container:
docker run --rm \
-u "$(id -u):$(id -g)" \
-v "$(pwd):/var/www/html" \
-w /var/www/html \
laravelsail/php85-composer:latest \
composer install --ignore-platform-reqs./vendor/bin/sail up -dTip: Add an alias to your
~/.zshrcor~/.bashrc:alias sail='./vendor/bin/sail'The rest of this README uses
sailas a shorthand.
sail composer setupThis command does everything at once:
- Copies
.env.exampleto.env - Generates the application key
- Runs database migrations
- Installs frontend dependencies (Bun)
- Builds frontend assets
Edit the .env file and add your API key:
GEMINI_API_KEY=your_key_here
sail artisan db:seed --class=CategorySeeder # default categories only
# or
sail artisan db:seed # categories + demo data (user test@example.com / password)sail composer devThis starts everything simultaneously:
- The Laravel server
- The queue worker (for async jobs: imports, AI categorization)
- Real-time logs (Pail)
- The Vite dev server (frontend hot reload)
The app is available at http://localhost.
- Go to http://localhost
- Create an account (standard registration)
- Optionally enable 2FA in settings
- From the dashboard, click Import CSV
- Select your CSV file (Revolut or Banque Populaire)
- The format is detected automatically
- Preview the transactions and choose the target account
- Confirm the import
Transactions are automatically deduplicated: if you re-import a file, duplicates are skipped.
AI categorization runs in the background via the queue. Reload the page after a few seconds to see the assigned categories.
- Click on a transaction to manually change its category
- Create a merchant rule in settings so all future transactions from that merchant are automatically categorized
| Bank | Supported Formats |
|---|---|
| Revolut | Personal format (EN/FR), business format |
| Banque Populaire | Classic format, enriched format (with categories) |
The architecture is designed to make adding new banks easy. Each parser implements the CsvParserInterface:
interface CsvParserInterface
{
public function canParse(string $content, string $filename): bool;
public function parse(string $content): Collection;
public function bankName(): string;
}Steps to add a bank:
- Create the parser in
app/Parsers/:
<?php
namespace App\Parsers;
use Carbon\Carbon;
use Illuminate\Support\Collection;
class MyBankParser implements CsvParserInterface
{
public function canParse(string $content, string $filename): bool
{
// Detect the format via the CSV headers
$firstLine = strtok($content, "\n");
return str_contains($firstLine, 'Specific Header');
}
/** @return Collection<int, TransactionData> */
public function parse(string $content): Collection
{
$rows = array_map('str_getcsv', explode("\n", $content));
$headers = array_shift($rows);
return collect($rows)
->filter(fn ($row) => count($row) === count($headers))
->map(function ($row) use ($headers) {
$data = array_combine($headers, $row);
return new TransactionData(
date: Carbon::parse($data['Date'])->format('Y-m-d'),
description: $data['Description'],
amountCents: (int) round((float) $data['Amount'] * 100),
rawLine: implode(',', $row),
);
});
}
public function bankName(): string
{
return 'My Bank';
}
}-
Register the parser in
app/Parsers/CsvParserFactory.php— add your class to the available parsers array. -
That's it. Auto-detection will try your parser via
canParse()on the next import.
Important notes:
- Amounts must be in cents (integer). Multiply by 100.
- Expenses are negative, income is positive.
- The
rawLinefield stores the raw CSV line for deduplication. - You can add optional
bankMetadata(JSON) if your bank provides enriched data.
The app exposes an MCP (Model Context Protocol) server that allows AI agents like Claude to query your budget data in read-only mode.
Available tools:
| Tool | Description |
|---|---|
GetCategoryTotals |
Monthly spending totals by category |
QueryTransactions |
Filter by date range, amount, merchant |
GetTransactionDetails |
Individual transaction details |
GetCategoryBreakdown |
Detailed category analysis |
GetMonthlyComparison |
Side-by-side comparison of two months |
GetAccountSummary |
Per-account income/expenses/net |
To configure an MCP client (e.g. Claude Desktop), point it to your application's URL. MCP routes are handled by the laravel/mcp package.
| Layer | Technologies |
|---|---|
| Backend | PHP 8.5, Laravel 12, PostgreSQL 17+ (pgvector) |
| Frontend | React 19, TypeScript, Inertia.js 2, Tailwind CSS 4, shadcn/ui |
| AI | Google Gemini via Laravel AI |
| Infrastructure | Laravel Cloud (production), Docker / Laravel Sail (local), Bun |
| Testing | PHPUnit (backend), Vitest + Testing Library (frontend) |
# Development
sail up -d # Start containers
sail composer dev # Run everything (server + queue + logs + Vite)
sail down # Stop containers
# Testing
sail composer test # PHP: Pint check + PHPStan + PHPUnit
sail artisan test # PHPUnit only
sail bun run test # Vitest (frontend)
# Linting & Formatting
sail bun run lint # ESLint with auto-fix
sail bun run format # Prettier
sail bun run types # TypeScript type checking
sail composer lint # PHP Pint auto-fix
# Database
sail artisan migrate # Run migrations
sail artisan migrate:fresh --seed # Full reset + seedbudget-app/
├── app/
│ ├── Http/Controllers/ # Controllers (thin controllers)
│ ├── Models/ # Eloquent models
│ ├── Services/ # Business logic
│ │ ├── BudgetQueryService # Dashboard queries
│ │ ├── CsvImportService # CSV import
│ │ ├── CategorizationService # Categorization (3 passes)
│ │ ├── DeduplicationService # SHA-256 deduplication
│ │ ├── RecurringDetectionService # Subscription detection
│ │ └── MerchantMatchingService # Merchant rules
│ ├── Parsers/ # CSV parsers per bank
│ ├── Mcp/ # MCP server (AI tools)
│ ├── Jobs/ # Async jobs
│ └── Events/ # Application events
├── resources/js/
│ ├── pages/ # Inertia page components (React)
│ ├── components/ui/ # shadcn/ui components
│ ├── types/ # TypeScript types
│ └── lib/ # Utilities (formatAmount, etc.)
├── database/
│ ├── migrations/ # PostgreSQL migrations
│ ├── factories/ # Test factories
│ └── seeders/ # Seeders (categories)
├── routes/
│ ├── web.php # Main routes
│ └── settings.php # Settings routes
└── tests/ # PHPUnit tests
Production runs on Laravel Cloud (organization lambert, application budget-app, region eu-central-1):
| URL | https://budget.lamberttraccard.dev (the only production URL; the Laravel Cloud address is disabled) |
| Environment | main (the only one: no staging or preview environments) |
| Deploys | Automatically on every push to main (push-to-deploy) |
| Build | composer install --no-dev --optimize-autoloader, then bun install && bun run build |
| Deploy command | php artisan migrate --force |
| Database | Neon serverless PostgreSQL (budget-app cluster) |
| Queue | Laravel Cloud managed queue (QUEUE_CONNECTION=cloud), 0–3 workers |
| Monitoring | Laravel Nightwatch |
The build and deploy commands, environment variables, and infrastructure live in the Laravel Cloud dashboard, not in this repository. GitHub Actions (tests and linter workflows) run on pushes and pull requests but do not gate the deploy.
To run your own instance elsewhere you need PHP 8.5 (pdo_pgsql, mbstring, intl, bcmath, …), PostgreSQL 17+ with pgvector, Bun for the asset build, and a queue worker (php artisan queue:work). Run php artisan migrate --force and php artisan db:seed --class=CategorySeeder --force on first deploy, and point the web server at public/.
| Variable | Description | Required |
|---|---|---|
APP_KEY |
Laravel encryption key | Yes (generated during setup) |
APP_URL |
Application URL | Yes |
DB_* |
PostgreSQL connection | Yes |
GEMINI_API_KEY |
Google Gemini API key | Yes (for AI categorization) |
QUEUE_CONNECTION |
Queue driver (database locally, cloud on Laravel Cloud) |
No (default: database) |
CACHE_STORE |
Cache driver | No (default: file) |
MAIL_* |
Email configuration | No (Mailpit in local) |
- Amounts: Stored as integer cents. 15.99 EUR =
1599. Displayed in French locale format viaformatAmount(). - Routing: No SPA router — Inertia.js handles navigation with Laravel's server-side routing.
- TypeScript: Strict mode, separate type imports (
import type { ... }). - Frontend package manager: Bun (not npm or yarn).
Personal use. Feel free to fork for your own use.


