Skip to content

Repository files navigation

Spends Tracker

A personal purchase and warranty tracking application with receipt/file management.

Overview

Track your purchases, manage warranties, and analyze spending patterns. Upload receipts, manuals, and photos with automatic deduplication storage.

Tech Stack

FrontendBackendStorage
Vite + Alpine.jsFastAPI + SQLAlchemySQLite (dev) / PostgreSQL (prod)
Bootstrap 5PydanticHash-sharded files
Chart.jsUvicornReference counting

Documentation

Security

For security vulnerabilities, please report to oss@mailite.com or create a private GitHub security advisory.

Quick Start

Prerequisites

  • Node.js 16+
  • Python 3.10+

Installation

# Install frontend dependencies
npm install
# Install backend dependenciescd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cd ..

Configure Ports (Optional)

Default ports are 3030 (frontend) and 3031 (backend). To customize, edit the .env files:

.env (frontend):

VITE_PORT=3030VITE_API_URL=http://localhost:3031

backend/.env (backend):

PORT=3031FRONTEND_URL=http://localhost:3030

Run Development Environment

Terminal 1 - Frontend:

npm run dev -- --host 0.0.0.0

Terminal 2 - Backend:

cd backend
source venv/bin/activate
uvicorn app.main:app --reload --host 0.0.0.0 --port 3031
ServiceDefault URL
Frontendhttp://localhost:3030
Backend APIhttp://localhost:3031/api
API Docshttp://localhost:3031/docs

Features

  • Purchase Tracking: Product details, price, retailer, brand
  • File Management: Upload receipts, manuals, photos with deduplication
  • Warranty Tracking: Auto-expiry detection
  • Analytics: Spending trends, retailer/brand distribution
  • Data Import/Export: JSON and CSV support

Project Structure

spends/
├── src-modern/ # Frontend source (Vite + Alpine.js)
│ ├── scripts/ # Alpine.js components
│ └── styles/scss/ # SCSS styles
├── backend/ # FastAPI backend
│ ├── app/ # Routes, models, schemas
│ └── migrations/ # Alembic migrations
├── dist-modern/ # Production build (auto-generated)
└── uploads/ # File storage (hash-sharded)

Key Commands

# Frontend
npm run dev # Development server
npm run build # Production build# Backendcd backend
alembic upgrade head # Run database migrations
uvicorn app.main:app --reload --host 0.0.0.0 --port 3031
# Testing
pytest # Run backend tests

License

MIT

About

Self-hosted purchase & warranty tracker with spending analytics. Track expenses, monitor warranties, and visualize your spending patterns. Built with FastAPI + Alpine.js

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages