Skip to content

bdmckean/budget_cursor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Budget Cursor

A budget planning application for analyzing and categorizing spending from CSV files. Built with Python (FastAPI) backend and React frontend, containerized with Docker.

πŸ“Š Technical Comparison: See detailed architecture comparison with budget_claude (Flask implementation) at github.com/bdmckean/code_off

Features

  • Upload CSV files for budget analysis
  • Map each row to common budget categories
  • Save progress automatically - resume mapping from where you left off
  • Visual progress tracking
  • Simple, intuitive one-page interface

Prerequisites

Before you begin, ensure you have the following installed on your local machine:

Getting Started

1. Clone the Repository

git clone <repository-url>
cd budget_cursor

2. Start the Application with Docker

Build and start all services (backend and frontend):

docker-compose up --build

This command will:

  • Build the Docker images for both backend and frontend
  • Start the backend API server on port 18080
  • Start the React frontend on port 13030
  • Mount volumes for live code reloading during development

3. Access the Application

Once the containers are running, you can access:

4. Stop the Application

To stop all running containers:

docker-compose down

To stop and remove volumes (clears data):

docker-compose down -v

Development Workflow

Running in Detached Mode

To run containers in the background:

docker-compose up -d

View logs:

docker-compose logs -f

View logs for a specific service:

docker-compose logs -f backend
docker-compose logs -f frontend

Rebuilding After Code Changes

If you make changes to dependencies (e.g., update pyproject.toml or package.json):

docker-compose up --build

For code changes, the volumes are mounted so changes should hot-reload automatically.

Local Development (Without Docker)

Backend (Python with Poetry)

cd backend
poetry install
poetry run uvicorn app.main:app --reload

The backend will run on http://localhost:8000

Frontend (React)

cd frontend
npm install
npm start

The frontend will run on http://localhost:3000

Note: When running locally, make sure to set the REACT_APP_API_URL environment variable or update the API_URL in App.jsx to point to your local backend.

Project Structure

budget_cursor/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ main.py          # FastAPI application
β”‚   β”‚   β”œβ”€β”€ models.py
β”‚   β”‚   └── utils.py
β”‚   β”œβ”€β”€ pyproject.toml        # Poetry dependencies
β”‚   β”œβ”€β”€ poetry.lock           # Locked dependency versions
β”‚   └── Dockerfile
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ App.jsx           # Main React component
β”‚   β”‚   β”œβ”€β”€ index.jsx
β”‚   β”‚   └── index.css
β”‚   β”œβ”€β”€ public/
β”‚   β”‚   └── index.html
β”‚   β”œβ”€β”€ package.json          # npm dependencies
β”‚   β”œβ”€β”€ package-lock.json     # Locked dependency versions
β”‚   β”œβ”€β”€ Dockerfile
β”‚   └── .dockerignore
β”œβ”€β”€ progress/
β”‚   └── mapping_progress.json # Saved mapping progress (auto-generated)
β”œβ”€β”€ docker-compose.yml        # Docker orchestration
β”œβ”€β”€ .gitignore
└── README.md

Usage

  1. Upload CSV File: Click "Upload CSV File" and select your budget/spending CSV file
  2. Map Rows: For each row, select the appropriate budget category
  3. Progress Saved: Your progress is automatically saved to progress/mapping_progress.json
  4. Resume Later: If you close the app, your progress is saved and you can resume from where you left off

Budget Categories

The application includes these default categories:

  • Restaurants
  • Transportation
  • Shopping
  • Bills & Utilities
  • Entertainment
  • Travel
  • Healthcare
  • Education
  • Personal Care
  • Donations
  • Gifts
  • Income
  • Other

Troubleshooting

Port Already in Use

If you get an error that ports 13030 or 18080 are already in use:

  1. Stop the conflicting service, or
  2. Update ports in docker-compose.yml:
    ports:
      - "13031:3000"  # Change frontend port
      - "18081:8000"  # Change backend port

Docker Build Fails

If the build fails, try:

# Clean up Docker cache
docker system prune -a

# Rebuild without cache
docker-compose build --no-cache
docker-compose up

Backend Not Connecting

Ensure the backend is running and check logs:

docker-compose logs backend

Frontend Not Loading

Check if the frontend container is running:

docker-compose ps
docker-compose logs frontend

Poetry Lock File Missing

If you get errors about poetry.lock, generate it:

cd backend
poetry lock

npm Install Issues

If frontend dependencies fail to install:

cd frontend
rm -rf node_modules package-lock.json
npm install

Technology Stack

  • Backend: Python 3.11, FastAPI, Poetry
  • Frontend: React 18, Create React App
  • Containerization: Docker, Docker Compose

License

See LICENSE file for details.

About

Spending analysis of downloaded csv files built with cursor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors