Add budget module: FastAPI backend + React frontend
Some checks failed
Deploy to VPS / deploy (push) Failing after 7s

Backend: FastAPI + PostgreSQL with models for accounts, transactions,
and categories. Auto-categorization from merchant patterns, token auth,
CRUD endpoints, and seed data for 16 categories and 4 bank accounts.

Frontend: Login, Dashboard (account balances + recent charges),
Transactions (full CRUD table with search/filter), Cash & Transfers
view. Dark theme with emerald/cyan accents, responsive layout.

Infrastructure: Updated docker-compose for backend + db services,
nginx proxy config for API routing, deploy workflow with secrets.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Carlos Escalante
2026-03-21 11:33:38 -06:00
parent cfd2eba849
commit 13161b8e49
34 changed files with 1855 additions and 112 deletions

View File

@@ -0,0 +1,51 @@
from datetime import datetime
from fastapi import APIRouter, Depends, HTTPException
from sqlmodel import Session, select
from app.auth import get_current_user
from app.db import get_session
from app.models.models import Account, AccountCreate, AccountRead, AccountUpdate
router = APIRouter(prefix="/accounts", tags=["accounts"])
@router.get("/", response_model=list[AccountRead])
def list_accounts(
session: Session = Depends(get_session),
_user: str = Depends(get_current_user),
):
return session.exec(select(Account)).all()
@router.post("/", response_model=AccountRead, status_code=201)
def create_account(
data: AccountCreate,
session: Session = Depends(get_session),
_user: str = Depends(get_current_user),
):
account = Account.model_validate(data)
session.add(account)
session.commit()
session.refresh(account)
return account
@router.patch("/{account_id}", response_model=AccountRead)
def update_account(
account_id: int,
data: AccountUpdate,
session: Session = Depends(get_session),
_user: str = Depends(get_current_user),
):
account = session.get(Account, account_id)
if not account:
raise HTTPException(status_code=404, detail="Account not found")
update_data = data.model_dump(exclude_unset=True)
for key, value in update_data.items():
setattr(account, key, value)
account.updated_at = datetime.utcnow()
session.add(account)
session.commit()
session.refresh(account)
return account