# Expense Tracker

Full-stack expense tracker with:
- `backend`: Spring Boot API
- `frontend`: React + Vite
- `db`: PostgreSQL
- `traefik`: reverse proxy

## Security-first environment setup

1. Copy env template:
   - `cp .env.example .env` (Linux/macOS)
   - `Copy-Item .env.example .env` (PowerShell)
2. Set strong values in `.env`:
   - `POSTGRES_PASSWORD`
   - `APP_JWT_SECRET` (base64 secret, at least 32 bytes before encoding)

`.env` is git-ignored. Commit only `.env.example`.

## Run production-like stack

```bash
docker compose --profile prod up -d --build
```

- App: `http://localhost`

## Run development stack (frontend + backend hot reload)

```bash
docker compose -f docker-compose.yml -f docker-compose.dev.yml --profile dev up --build
```

- Backend runs via `spring-boot:run` with `devtools` restart enabled
- Frontend runs via Vite dev server

## Notes

- API is mounted under `/api` through Traefik.
- Backend auth endpoints:
  - `POST /api/auth/register`
  - `POST /api/auth/login`
  - `POST /api/auth/refresh`
  - `POST /api/auth/logout`
- Auth env vars:
  - `APP_JWT_SECRET`
  - `APP_JWT_ISSUER`
  - `APP_JWT_ACCESS_EXPIRES_MINUTES`
  - `APP_JWT_REFRESH_EXPIRES_DAYS`
