Metadata-Version: 2.4
Name: 2026-assignment2-expense-tracker-pipeline
Version: 1.0.5
Summary: Expense Tracker Release (SPD course)
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Flask
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Dynamic: license-file

# ExpenseTracker

Small Flask + SQLite web app for tracking personal expenses. Add expenses with an amount, category, description and date, edit them in place, and delete entries. Categories you use are saved and suggested next time, and the page shows the total and per-category totals. A month dropdown filters the list and the totals.

![Screenshot of the app](docs/screenshot.png)

## Setup

```bash
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```

## Run

```bash
python app.py
```

Open http://localhost:5000. The SQLite database (`expenses.db`) is created next to the app on first run.

**Local use only:** there is no authentication or CSRF protection, and the app runs with `debug=True`. Don't expose it to a network or deploy it as is.

## Tests

```bash
pip install -r requirements-dev.txt
pytest
```

Tests use a temporary database, so your real `expenses.db` is never touched.

## Layout

- `app.py` – Flask app factory, routes and input validation
- `database.py` – SQLite access
- `templates/`, `static/` – HTML, CSS and two small scripts (category suggestions, keeping the scroll position when editing)
- `tests/` – pytest tests for validation, database functions and routes

## About

The initial version was hand-coded as a practice project to remind myself of the tech behind a small web app. Development continues with Claude Code (security checks, polish, new features).

The original project was written before version control was set up, which is why the Git history starts on 20.10.2026.

Tech and concepts used:
- Flask routes and form handling
- Jinja templates
- Raw `sqlite3` with parameterized queries
- POST-redirect-GET pattern
- Server-side input validation
- Amounts stored as integer cents (parsed with `Decimal`) to avoid float rounding errors
- App factory (`create_app()`) so importing the app has no side effects
- Filtering with a query parameter (`?month=YYYY-MM`) and a parameterized `WHERE` clause

Ideas for later: CSV export.

## License

MIT, see [LICENSE](LICENSE).
