teb.codes
Attachments
History
Blame
View Source
Changelog
Documentation
About An Otter Wiki
Toggle dark mode
Login
Home
A - Z
Page Index
1-Guides
Authentik-Basic-Setup-Guide
2-Code
Bash
Bootstrap-Script
Email-to-Obsidian-Sync
Fish-Aliases
Mount-Point-Service-Sync
Docker
Docker-Shortcuts
Flash-Container
NV14
Project-F
Stick-RPG
Subway-Surfers
VSCode
Flask
Employee-Hour-Tracker
Pocket-Change-Showdown
Sales Tracker
K8S
Backup-Pushover-Notification
Home
Stalk-Me
Throw Money At Me
2-Code
Flask
Pocket-Change-Showdown
73ffc2
Commit
73ffc2
2025-08-09 21:07:26
Tebby Dog
: adding humor
2-code/flask/pocket-change-showdown.md
..
@@ 1,54 1,50 @@
-
# Pocket Change Showdown
+
# Pocket Change Showdown: The Penny-Pincher's Paradise
-
> Track every penny of your moving expenses with style! π°
+
> Feck yeah! It's time to tackle your moving expenses with a dash of style and a whole lot of sass! π°
<div align="center">
-
+
Hey look, there's more Flair than a corporate drone with a Monday morning hangover!

-

-

+

+


-
<img src="https://teb.codes/2-Code/Flask/Pocket-Change-Showdown/logo.png" alt="logo" width="150"/>
-
[Features](#features) β’ [Quick Start](#quick-start) β’ [Installation](#installation) β’ [Documentation](#documentation) β’ [Contributing](#contributing)
-
+
Think you're bad at managing expenses? Ah, quit your whining. We've got everything: [sassy Features](#features) β’ super-speed [Quick Start](#quick-start) β’ hassle-free [Installation](#installation) β’ wordy [Documentation](#documentation) β’ places to rant... I mean, [Contributing](#contributing)!
</div>
---
## π Table of Contents
-
-
- [Features](#features)
-
- [Screenshots](#screenshots)
-
- [Quick Start](#quick-start)
-
- [Installation](#installation)
-
- [Docker](#docker)
-
- [Kubernetes](#kubernetes)
-
- [Local Development](#local-development)
-
- [Configuration](#configuration)
-
- [Usage](#usage)
-
- [API Documentation](#api-documentation)
-
- [Development](#development)
-
- [Contributing](#contributing)
-
- [License](#license)
+
- [What Features?](#features)
+
- [Screenshots β Because Who Reads?](#screenshots)
+
- [Quick Start β No, Really, Itβs Quick](#quick-start)
+
- [Slog through Installation](#installation)
+
- [Docker - Walk the Weird Whale](#docker)
+
- [Kubernetes - Because You're Fancy](#kubernetes)
+
- [Local Mayhem - Developer Stuff](#local-development)
+
- [Mess About with Configuration](#configuration)
+
- [Usage - Whatβs the Point?](#usage)
+
- [Guff About API Documentation](#api-documentation)
+
- [What Matters in Development?](#development)
+
- [Contributing - Your Turn to Bitch](#contributing)
+
- [License - Free Stuff's Always Good](#license)
## β¨ Features
-
### Core Functionality
-
- πΈ **Receipt Management** - Upload and store receipt images/PDFs (up to 16MB)
-
- π³ **Multiple Payment Methods** - Track how you paid (Cash, Credit, Debit, etc.)
-
- π·οΈ **Smart Categorization** - Pre-defined PCS categories (Moving, Travel, Housing, etc.)
-
- π **Analytics Dashboard** - Interactive charts with Chart.js
-
- π¨ **8 Color Themes** - Personalize your experience
-
- π± **Mobile Responsive** - Track expenses on the go
-
- π **No Login Required** - Simple, secure, and private
+
- πΈ **Receipt Management** - Store craploads of receipts. We dare you.
+
- π³ **Multiple Payment Methods** - We track whether you spent cash, credit, IOUs, or favors.
+
- π·οΈ **Smart Categorization** - Keep your spending habits smart and snarky.
+
- π **Analytics Dashboard** - Like looking at a magic crystal ball of shame.
+
- π¨ **8 Color Themes** - Because your expenses can't be as drab as your personality.
+
- π± **Mobile Responsive** - Track on the go, from your phone or hell, a potato.
+
- π **No Login Required** - No strings attached, like that one-night stand.
### Data Management
-
- π₯ **CSV Import** - Bulk upload expenses from spreadsheets
-
- π€ **CSV Export** - Download all data for records
-
- π **Template Download** - Get started with the right format
-
- πΎ **Persistent Storage** - Data survives container restarts
+
- π₯ **CSV Import** - Bring the madness of an Excel sheet to a whole new level.
+
- π€ **CSV Export** - Send your data on a field trip!
+
- π **Template Download** - Look, Ma! Iβm organized.
+
- πΎ **Persistent Storage** - Data that laughs in the face of restarts.
### PCS-Specific Categories
- π Moving
@@ 60,107 56,64 @@
- π Food
- π¦ Supplies
- ποΈ Services
-
- β Custom Categories
+
- β Make up your own crap!
## πΈ Screenshots
-
<details>
-
<summary>Click to view screenshots</summary>
-
-
### Dashboard
-
Interactive analytics with spending trends and category breakdowns.
-

-
-
### Expense Entry
-
Simple form with receipt upload and auto-complete fields.
-

-
-
### Homepage
-
A general overview of expenses
-

-
### Import/Export
-
Efficient data importing and exporting with template
-

-
-
### PDF Export
-
Printer friendly PDF with customizable content
-

-
-
### Settings
-
Manage categories, payment methods, and themes.
-

-
-
</details>
### Sample PDF
-
[pdf_sample.pdf](./pdf_sample.pdf)
+
Donβt just stand there, gawk! [pdf_sample.pdf](./pdf_sample.pdf)
## π Quick Start
-
### Docker (Recommended)
-
```bash
-
# Pull and run the latest image
+
# Unleash the Kraken with the latest image
docker run -d \
--name pcs-tracker \
-p 5001:5001 \
-v pcs-data:/app/data \
-v pcs-uploads:/app/uploads \
tebwritescode/pocket-change-showdown:latest
-
-
# Access at http://localhost:5001
+
# Chuckle maniacally at http://localhost:5001
```
### Docker Compose
-
```bash
-
# Clone the repository
+
# Phone-up Chuck Norris: "We're cloning a repo"
git clone https://github.com/tebwritescode/pocket-change-showdown.git
cd pocket-change-showdown
-
-
# Start with Docker Compose
+
# Compose your mess with Docker Compose
docker-compose up -d
-
-
# Access at http://localhost:5001
+
# Dance your way to http://localhost:5001
```
## π¦ Installation
-
### Docker
-
-
#### Multi-Architecture Support
-
Images are available for:
-
- `linux/amd64` (Intel/AMD)
-
- `linux/arm64` (Apple Silicon, ARM servers)
-
- `linux/arm/v7` (Raspberry Pi)
-
+
#### Recognizing All Sorts
+
Because compatibility is key, unless it isn't!
```bash
-
# Pull specific architecture
+
# Pull for your peculiar machine
docker pull --platform linux/arm64 tebwritescode/pocket-change-showdown:latest
-
-
# Or let Docker auto-select
+
# Or let Docker rub its chin and decide
docker pull tebwritescode/pocket-change-showdown:latest
```
-
#### Docker Run Options
-
+
#### Docker Run Degeneracy
```bash
-
# Basic deployment
+
# Deploy it, Captain
docker run -d \
--name pcs-tracker \
-p 5001:5001 \
tebwritescode/pocket-change-showdown:latest
-
-
# With persistent storage
+
# Make it last longer than a baking lesson
docker run -d \
--name pcs-tracker \
-p 5001:5001 \
-v $(pwd)/data:/app/data \
-v $(pwd)/uploads:/app/uploads \
tebwritescode/pocket-change-showdown:latest
-
-
# With environment variables
+
# Secret sauce for the discerning chef
docker run -d \
--name pcs-tracker \
-p 5001:5001 \
@@ 172,138 125,113 @@
```
### Kubernetes
-
```bash
-
# Apply all manifests
+
# Manifest your destiny, or just the code
kubectl apply -f k8s/
-
-
# Or individually
+
# Or one by bloody one
kubectl apply -f k8s/namespace.yaml
kubectl apply -f k8s/secret.yaml
kubectl apply -f k8s/pvc.yaml
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
-
kubectl apply -f k8s/ingress.yaml # Optional
+
kubectl apply -f k8s/ingress.yaml # Optional, like an appendix
-
# Check deployment status
+
# Check if your stuff's intact
kubectl get all -n pcs-tracker
-
-
# Access via NodePort (default: 30001)
-
http://<node-ip>:30001
+
# If it worked, buy yourself a drink at http://<node-ip>:30001
```
-
#### Kubernetes Features
-
- **Persistent Volumes** - Data and uploads stored in PVCs
-
- **Health Checks** - Liveness and readiness probes
-
- **Resource Limits** - CPU and memory constraints
-
- **Multi-Service** - LoadBalancer and NodePort options
-
- **Ingress Ready** - Configure for your domain
+
#### Kubernetes Thingamabobs
+
- **Persistent Volumes** - Turns out you donβt need to webscrape for dataβit sticks around.
+
- **Health Checks** - It only mostly dies.
+
- **Resource Limits** - So demanding!
+
- **Multi-Service** - Load balance like a tightrope walker.
+
- **Ingress Ready** - Fancy domain? Me too.
### Local Development
-
```bash
-
# Clone repository
+
# Kiss the clouds goodbye
git clone https://github.com/tebwritescode/pocket-change-showdown.git
cd pocket-change-showdown
-
-
# Create virtual environment
+
# Create a virtual haven
python3 -m venv venv
-
source venv/bin/activate # On Windows: venv\Scripts\activate
-
-
# Install dependencies
+
source venv/bin/activate
+
# Unload a bag of dependencies
pip install -r requirements.txt
-
-
# Run application
+
# Go-Go-Gadget application
python app.py
-
-
# Access at http://localhost:5001
+
# Channel your inner regulator at http://localhost:5001
```
## βοΈ Configuration
-
### Environment Variables
-
| Variable | Description | Default |
|----------|-------------|---------|
-
| `SECRET_KEY` | Flask secret key for sessions | `pcs-secret-key-2024` |
-
| `FLASK_ENV` | Environment mode (`development`/`production`) | `production` |
-
| `DATABASE_URL` | SQLAlchemy database URL | `sqlite:///data/pcs_tracker.db` |
-
| `MAX_CONTENT_LENGTH` | Maximum upload size in bytes | `16777216` (16MB) |
+
| `SECRET_KEY` | SMERSH-level deception sessions key | `pcs-secret-key-2024` |
+
| `FLASK_ENV` | Sneaky environment mood | `production` |
+
| `DATABASE_URL` | Alchemize this: your database | `sqlite:///data/pcs_tracker.db` |
+
| `MAX_CONTENT_LENGTH` | Maximum cr-p (content) upload size | `16777216` (16MB) |
### Data Persistence
-
-
The application stores data in two locations:
-
- `/app/data` - SQLite database
-
- `/app/uploads` - Receipt images (stored in database as BLOB)
-
-
Mount these directories as volumes to persist data.
+
To make data hang around like a bad smell:
+
- `/app/data` - SQLite domicile
+
- `/app/uploads` - Receipts chill as BLOBs
## π± Usage
-
-
### Adding Expenses
-
-
1. Click **"Add Expense"** from the navigation or homepage
-
2. Fill in expense details (only title is truly required)
-
3. Upload receipt photo/screenshot (optional)
-
4. Save expense
-
-
### Importing Data
-
-
1. Navigate to **Import/Export** β **Import CSV**
-
2. Download the template for correct format
-
3. Fill in your data
-
4. Upload CSV file
-
-
### CSV Format
-
+
### Tossin' Pennies - Adding Expenses
+
1. Sing "Add Expense!" from any rooftop or just click it
+
2. Wake up from title-only dream
+
3. Attach facepalming receipts (optional)
+
4. Ceremoniously hit "Save"
+
+
### Inflicting Data - Importing
+
1. Explore **Import/Export** β **Import CSV**
+
2. Don shiny template armor
+
3. Be daVinci, fill your masterpiece
+
4. Blast off with CSV sere-naah-de
+
+
### Cheese-Cutting Format
```csv
Date,Title,Description,Category,Cost,Payment Method,Location,Vendor,Notes,Tags
2024-01-15,Moving Truck,U-Haul rental,Moving,299.99,Credit Card,Downtown,U-Haul,26ft truck,moving
2024-01-16,Hotel Stay,Overnight stay,Lodging,125.00,Company Card,Holiday Inn,Holiday Inn,1 night,travel
```
-
### Managing Categories & Payment Methods
-
-
1. Go to **Settings**
-
2. Add custom categories with colors
-
3. Add custom payment methods
-
4. Delete non-default items
-
5. Change color theme
-
-
### Analytics Dashboard
+
### Manipulating Categories & Payment Methods
+
1. Go where no wo/man has deemed necessary: **Settings**
+
2. Cust-omize your little heart out
+
3. Create methods even mad scientists couldnβt
+
4. Marry whimsy: color themes purr with indulgence
-
- Filter by time period (Week/Month/Quarter/Year)
-
- View spending by category (Doughnut chart)
-
- Payment method breakdown (Bar chart)
-
- Daily spending trends (Line chart)
-
- Top categories table with percentages
-
-
## π API Documentation
+
### Accidental Analytics Dashboard
+
- Scorn last week, guilt-trip for next: from nanosecond to year
+
- See-spend scenario via doughnut dive
+
- Payment method squabbles (Bar chart showdown)
+
- Dailies take you on the trend train (Line chart)
+
- Top dog categories, percentages & flaunting aplenty
+
## π API Guff
### Endpoints
-
-
| Method | Endpoint | Description |
-
|--------|----------|-------------|
-
| GET | `/` | Homepage with statistics |
-
| GET | `/expenses` | List all expenses |
-
| GET/POST | `/expense/new` | Add new expense |
-
| GET/POST | `/expense/<id>/edit` | Edit expense |
-
| POST | `/expense/<id>/delete` | Delete expense |
-
| GET | `/expense/<id>/receipt` | View receipt image |
-
| GET | `/dashboard` | Analytics dashboard |
-
| GET | `/api/expense_data` | JSON data for charts |
-
| GET/POST | `/settings` | Application settings |
-
| POST | `/settings/category/add` | Add category |
-
| POST | `/settings/payment/add` | Add payment method |
-
| GET | `/export` | Export CSV |
-
| GET/POST | `/import` | Import CSV |
-
| GET | `/template` | Download CSV template |
-
-
### API Response Example
-
+
| Method | Endpoint | Quirky Description |
+
|--------|----------|--------------------|
+
| GET | `/` | Home sweet home(wrecker) |
+
| GET | `/expenses` | Expense expedition |
+
| GET/POST | `/expense/new` | New expense enlightenment |
+
| GET/POST | `/expense/<id>/edit` | Edit the unavoidable |
+
| POST | `/expense/<id>/delete` | PURGE! |
+
| GET | `/expense/<id>/receipt` | Picture-perception |
+
| GET | `/dashboard` | Analytical nincompoopery |
+
| GET | `/api/expense_data` | JSON chateria |
+
| GET/POST | `/settings` | Mischief management |
+
| POST | `/settings/category/add` | Go rogue - add category |
+
| POST | `/settings/payment/add` | Payment etiquette upgrade |
+
| GET | `/export` | CSV in Wonderland |
+
| GET/POST | `/import` | CSV Carousel |
+
| GET | `/template` | CSV preface nobility |
+
+
### API Response Satire
```json
GET /api/expense_data?period=month
-
{
"categories": {
"labels": ["Moving", "Travel", "Housing"],
@@ 320,66 248,60 @@
}
```
-
## π οΈ Development
-
+
## π οΈ Development - Why Bother?
### Tech Stack
+
- **Backend**: Flask, spicy SQLAlchemy
+
- **Frontend**: Bootstrap, Chart.js, Font Awesome (a peacock)
+
- **Database**: SQLite: SQLAlchemy Sings
+
- **File Storage**: Database belly storage
+
- **Deployment**: Orchestrations with Docker, Kubernetes & Gunicorn bravado
-
- **Backend**: Flask 2.3.3, SQLAlchemy
-
- **Frontend**: Bootstrap 5, Chart.js, Font Awesome
-
- **Database**: SQLite with SQLAlchemy ORM
-
- **File Storage**: Binary storage in database
-
- **Deployment**: Docker, Kubernetes, Gunicorn
-
-
### Project Structure
-
+
### Structure of Madness
```
pocket-change-showdown/
-
βββ app.py # Main Flask application
-
βββ requirements.txt # Python dependencies
-
βββ Dockerfile # Multi-arch Docker build
-
βββ docker-compose.yml # Docker Compose config
-
βββ templates/ # HTML templates
-
β βββ base.html # Base template with themes
-
β βββ index.html # Homepage
-
β βββ expenses.html # Expense list
-
β βββ expense_form.html # Add/Edit form
-
β βββ dashboard.html # Analytics
-
β βββ settings.html # Settings page
-
β βββ import.html # CSV import
-
βββ k8s/ # Kubernetes manifests
+
βββ app.py # App-worthy babel
+
βββ requirements.txt # Dependency lug
+
βββ Dockerfile # Docker concoction
+
βββ docker-compose.yml # Docker squad
+
βββ templates/ # HTML insidiousness
+
β βββ base.html # The totally base
+
β βββ index.html # Page of presents
+
β βββ expenses.html # Expense paradox
+
β βββ expense_form.html # Input vs Reality
+
β βββ dashboard.html # Chase your shame
+
β βββ settings.html # Hangover fixes
+
β βββ import.html # CSV courtship
+
βββ k8s/ # Kubernetes enigma
β βββ namespace.yaml
β βββ secret.yaml
β βββ pvc.yaml
β βββ deployment.yaml
β βββ service.yaml
β βββ ingress.yaml
-
βββ data/ # Database (created at runtime)
+
βββ data/ # Runtime ingenuity
```
-
### Building from Source
-
+
### Born from Code
```bash
-
# Build Docker image
+
# Glayvin! Build me this Docker monstrosity
docker build -t pcs-tracker .
-
-
# Build multi-arch with buildx
+
# Partake in fetching multi-arch wonders
docker buildx build \
--platform linux/amd64,linux/arm64,linux/arm/v7 \
-t tebwritescode/pocket-change-showdown:latest \
--push .
```
-
### Database Schema
-
+
### The Flat Schema (Non-Skiable)
```sql
-
-- Main expense table
+
-- Ground Zero table for expense
CREATE TABLE expense (
-
id INTEGER PRIMARY KEY,
+
id INTEGER,
title VARCHAR(200),
description TEXT,
-
category_id INTEGER REFERENCES category(id),
-
cost FLOAT DEFAULT 0.0,
-
payment_method_id INTEGER REFERENCES payment_method(id),
+
category_id INTEGER,
+
cost FLOAT,
+
payment_method_id INTEGER,
date DATE,
receipt_image BLOB,
receipt_filename VARCHAR(200),
@@ 388,54 310,49 @@
notes TEXT,
tags VARCHAR(500),
created_at DATETIME,
-
updated_at DATETIME
+
updated_at DATETIME,
+
PRIMARY KEY (id)
);
-
-
-- Categories table
+
-- Column of categorization
CREATE TABLE category (
-
id INTEGER PRIMARY KEY,
-
name VARCHAR(100) UNIQUE NOT NULL,
-
color VARCHAR(7) DEFAULT '#0d6efd',
-
icon VARCHAR(50) DEFAULT 'fa-tag',
-
is_default BOOLEAN DEFAULT FALSE
+
id INTEGER,
+
name VARCHAR(100),
+
color VARCHAR(7),
+
icon VARCHAR(50),
+
is_default BOOLEAN,
+
PRIMARY KEY (id)
);
-
-
-- Payment methods table
+
-- Noteworthy payment table
CREATE TABLE payment_method (
-
id INTEGER PRIMARY KEY,
-
name VARCHAR(100) UNIQUE NOT NULL,
-
icon VARCHAR(50) DEFAULT 'fa-credit-card',
-
is_default BOOLEAN DEFAULT FALSE
+
id INTEGER,
+
name VARCHAR(100),
+
icon VARCHAR(50),
+
is_default BOOLEAN,
+
PRIMARY KEY (id)
);
-
-
-- Settings table
+
-- Settings booth
CREATE TABLE settings (
-
id INTEGER PRIMARY KEY,
-
color_scheme VARCHAR(50) DEFAULT 'default',
-
default_view VARCHAR(20) DEFAULT 'list'
+
id INTEGER,
+
color_scheme VARCHAR(50),
+
default_view VARCHAR(20),
+
PRIMARY KEY (id)
);
```
-
## π License
-
-
This project is open source and available under the [MIT License](LICENSE).
-
-
## π Acknowledgments
-
-
- Built with Flask and Bootstrap
-
- Charts powered by Chart.js
-
- Icons by Font Awesome
+
## π License - Go Forth and Conquer!
+
This project is merrily open source and blissfully up for grabs under the [MIT License](LICENSE).
-
## π Support
+
## π Cheers & Acknowledgments
+
- Built under the spell of Flask and Bootstrap
+
- Charts magicked by Chart.js
+
- Icons with Font Awesome - Awe as your own
-
For issues, questions, or suggestions:
-
- Open an issue on [GitHub](https://github.com/tebwritescode/pocket-change-showdown/issues)
-
- Contact via GitHub discussions
+
## π Screech for Help
+
For tirades, discontent, or amusing suggestions:
+
- Holler on [GitHub Issues](https://github.com/tebwritescode/pocket-change-showdown/issues)
+
- Vent thoroughly in GitHub Discussions
---
-
<div align="center">
-
-
**P**ocket **C**hange **S**howdown - Track every penny, win the move!
-
+
**P**ocket **C**hange **S**howdown - Because tracking every penny is nothing short of glorious insanity!
</div>
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9