WhereIsMyMoney - Personal Finance Management

## Project Overview
A Go web application for personal finance management using modern frameworks. Features include comprehensive transaction management, multi-edit/delete capabilities, advanced filtering, user authentication, bank account & depot management, and a responsive UI with interactive dashboards.

## Tech Stack
- **Backend**: Go 1.23 with Gin web framework
- **Templates**: a-h/templ for type-safe HTML templates
- **Database**: GORM with SQLite
- **Configuration**: Viper for config management
- **Sessions**: Gorilla Sessions for user sessions (Safari-compatible)
- **Authentication**: bcrypt for password hashing
- **Frontend**: Tailwind CSS for styling with modular template structure, Chart.js for data visualization
- **JavaScript**: Vanilla JS for dynamic interactions, AJAX operations, and form handling

## Key Features
- **Transaction Management**: Full CRUD operations with pagination, advanced filtering, multi-edit/delete functionality
- **Recurring Transactions**: Automated generation of recurring transactions with flexible intervals
- **User Management**: Registration, login, logout with secure session handling and settings management
- **Bank Account Management**: Create and manage multiple bank accounts (checking, savings, credit)
- **Depot Management**: Create and manage investment depots with different brokers
- **Advanced Filtering**: Multi-criteria filtering (date range, description, category, account, type, amount)
- **Batch Operations**: Multi-select transactions for bulk editing and deletion
- **Interactive Dashboard**: Charts and graphs for financial overview using Chart.js
- **Responsive Design**: Mobile-friendly navigation with dropdown menus
- **Modular Templates**: Separate components for reusability and maintainability

## Development
- Run server: `go run main.go` or use VS Code task "Run Server"
- Generate templates: `templ generate`
- Build: `go build -o app .`
- Server runs on http://localhost:8080

## API Routes
### Authentication
- **Auth**: `/login`, `/register`, `/logout`

### Main Pages  
- **Dashboard**: `/` (protected) - Financial overview with interactive charts
- **Transactions**: `/transactions` (protected) - Transaction list with filtering, pagination, and multi-operations
- **Accounts**: `/accounts` (protected) - Bank account & depot management
- **Recurring**: `/recurring` (protected) - Recurring transaction management
- **Settings**: `/settings` (protected) - User settings and password management

### Transaction API
- **GET** `/transactions` - Transaction list with pagination and filtering
- **POST** `/transactions` - Create new transaction
- **PUT** `/transactions/:id` - Update transaction
- **DELETE** `/transactions/:id` - Delete transaction
- **PUT** `/transactions/multi-update` - Batch update multiple transactions
- **DELETE** `/transactions/multi-delete` - Batch delete multiple transactions

### Recurring Transactions API
- **GET** `/recurring` - List recurring transactions
- **POST** `/recurring` - Create recurring transaction
- **PUT** `/recurring/:id` - Update recurring transaction  
- **DELETE** `/recurring/:id` - Delete recurring transaction

### Account Management API
- **GET** `/accounts` - View accounts overview
- **POST** `/accounts/bank` - Create bank account
- **POST** `/accounts/depot` - Create depot

### User Management API
- **PUT** `/settings/profile` - Update user profile (name only)
- **PUT** `/settings/password` - Change user password

## Database Models
- **User**: Authentication and user data with relationships to accounts/depots/transactions
- **Transaction**: Complete transaction data (amount, description, date, category, account, type)
- **RecurringTransaction**: Templates for automated recurring transactions with flexible intervals
- **BankAccount**: Bank account details (name, bank, IBAN, balance, account type)
- **Depot**: Investment depot details (name, broker, depot number, total value)
- **Category**: Transaction categories with icons for visual organization

## Project Structure
```
whereismymoney/
├── main.go                    # Application entry point with routes
├── config.yaml               # Configuration file
├── whereismymoney.db         # SQLite database
├── static/
│   ├── css/
│   │   └── style.css         # Custom CSS styles
│   └── js/
│       └── dashboard-charts.js # Chart.js configuration
├── internal/
│   ├── config/               # Configuration management
│   ├── database/             # Database connection and migrations
│   ├── handlers/             # HTTP handlers (auth, transactions, accounts, etc.)
│   ├── models/               # GORM models (User, Transaction, BankAccount, etc.)
│   └── views/               # Templ templates
│       ├── layout.templ      # Base layout
│       ├── navigation.templ  # Reusable navigation component
│       ├── dashboard.templ   # Main dashboard with charts
│       ├── transactions.templ # Transaction list with filtering and multi-ops
│       ├── accounts.templ    # Bank accounts & depots management
│       ├── recurring.templ   # Recurring transactions management
│       ├── settings.templ    # User settings and password management
│       ├── login.templ       # Login page
│       └── register.templ    # Registration page
└── README.md                 # Documentation
```
