Blame

e12e4e Tebby Dog 2025-08-09 19:38:10
init
1
# Pocket Change Showdown
9c1775 Tebby Dog 2025-08-09 19:42:25
formatting
2
e12e4e Tebby Dog 2025-08-09 19:38:10
init
3
> Track every penny of your moving expenses with style! 💰
4
5
<div align="center">
6
![Flask](https://img.shields.io/badge/Flask-2.3.3-000000?style=for-the-badge&logo=flask)
7
![Docker](https://img.shields.io/badge/Docker-Ready-2496ED?style=for-the-badge&logo=docker)
8
![Kubernetes](https://img.shields.io/badge/Kubernetes-Ready-326CE5?style=for-the-badge&logo=kubernetes&logoColor=white)
9
![License](https://img.shields.io/badge/License-MIT?style=for-the-badge&logo=MIT&label=MIT)
10
9cf912 Tebby Dog 2025-08-09 19:42:49
formatting
11
<img src="https://teb.codes/2-Code/Flask/Pcs/logo.png" alt="logo" width="200"/>
12
e12e4e Tebby Dog 2025-08-09 19:38:10
init
13
[Features](#features) • [Quick Start](#quick-start) • [Installation](#installation) • [Documentation](#documentation) • [Contributing](#contributing)
14
15
</div>
16
17
---
18
19
## 📋 Table of Contents
20
21
- [Features](#features)
22
- [Screenshots](#screenshots)
23
- [Quick Start](#quick-start)
24
- [Installation](#installation)
25
- [Docker](#docker)
26
- [Kubernetes](#kubernetes)
27
- [Local Development](#local-development)
28
- [Configuration](#configuration)
29
- [Usage](#usage)
30
- [API Documentation](#api-documentation)
31
- [Development](#development)
32
- [Contributing](#contributing)
33
- [License](#license)
34
35
## ✨ Features
36
37
### Core Functionality
38
- 📸 **Receipt Management** - Upload and store receipt images/PDFs (up to 16MB)
39
- 💳 **Multiple Payment Methods** - Track how you paid (Cash, Credit, Debit, etc.)
40
- 🏷️ **Smart Categorization** - Pre-defined PCS categories (Moving, Travel, Housing, etc.)
41
- 📊 **Analytics Dashboard** - Interactive charts with Chart.js
42
- 🎨 **8 Color Themes** - Personalize your experience
43
- 📱 **Mobile Responsive** - Track expenses on the go
44
- 🔒 **No Login Required** - Simple, secure, and private
45
46
### Data Management
47
- 📥 **CSV Import** - Bulk upload expenses from spreadsheets
48
- 📤 **CSV Export** - Download all data for records
49
- 📄 **Template Download** - Get started with the right format
50
- 💾 **Persistent Storage** - Data survives container restarts
51
52
### PCS-Specific Categories
53
- 🚚 Moving
54
- ✈️ Travel
55
- 🏠 Housing
56
- 📦 Storage
57
- 🚗 Transportation
58
- 🏨 Lodging
59
- 🍔 Food
60
- 📦 Supplies
61
- 🛎️ Services
62
- ➕ Custom Categories
63
64
## 📸 Screenshots
65
66
<details>
67
<summary>Click to view screenshots</summary>
68
69
### Dashboard
70
Interactive analytics with spending trends and category breakdowns.
ab85f0 Tebby Dog 2025-08-09 20:06:23
added screenies
71
![](./Analytics.png)
e12e4e Tebby Dog 2025-08-09 19:38:10
init
72
73
### Expense Entry
74
Simple form with receipt upload and auto-complete fields.
ab85f0 Tebby Dog 2025-08-09 20:06:23
added screenies
75
![](./Expense.png)
76
77
### Homepage
78
A general overview of expenses
79
![](./Home.png)
80
81
### Import/Export
82
Efficient data importing and exporting with template
83
![](./Im-Export.png)
84
85
### PDF Export
86
Printer friendly PDF with customizable content
87
![](./PDF.png)
e12e4e Tebby Dog 2025-08-09 19:38:10
init
88
89
### Settings
90
Manage categories, payment methods, and themes.
ab85f0 Tebby Dog 2025-08-09 20:06:23
added screenies
91
![](./Settings.png)
e12e4e Tebby Dog 2025-08-09 19:38:10
init
92
93
</details>
94
95
## 🚀 Quick Start
96
97
### Docker (Recommended)
98
99
```bash
100
# Pull and run the latest image
101
docker run -d \
102
--name pcs-tracker \
103
-p 5001:5001 \
104
-v pcs-data:/app/data \
105
-v pcs-uploads:/app/uploads \
106
tebwritescode/pocket-change-showdown:latest
107
108
# Access at http://localhost:5001
109
```
110
111
### Docker Compose
112
113
```bash
114
# Clone the repository
115
git clone https://github.com/tebwritescode/pocket-change-showdown.git
116
cd pocket-change-showdown
117
118
# Start with Docker Compose
119
docker-compose up -d
120
121
# Access at http://localhost:5001
122
```
123
124
## 📦 Installation
125
126
### Docker
127
128
#### Multi-Architecture Support
129
Images are available for:
130
- `linux/amd64` (Intel/AMD)
131
- `linux/arm64` (Apple Silicon, ARM servers)
132
- `linux/arm/v7` (Raspberry Pi)
133
134
```bash
135
# Pull specific architecture
136
docker pull --platform linux/arm64 tebwritescode/pocket-change-showdown:latest
137
138
# Or let Docker auto-select
139
docker pull tebwritescode/pocket-change-showdown:latest
140
```
141
142
#### Docker Run Options
143
144
```bash
145
# Basic deployment
146
docker run -d \
147
--name pcs-tracker \
148
-p 5001:5001 \
149
tebwritescode/pocket-change-showdown:latest
150
151
# With persistent storage
152
docker run -d \
153
--name pcs-tracker \
154
-p 5001:5001 \
155
-v $(pwd)/data:/app/data \
156
-v $(pwd)/uploads:/app/uploads \
157
tebwritescode/pocket-change-showdown:latest
158
159
# With environment variables
160
docker run -d \
161
--name pcs-tracker \
162
-p 5001:5001 \
163
-e SECRET_KEY="your-secret-key-here" \
164
-e FLASK_ENV="production" \
165
-v pcs-data:/app/data \
166
-v pcs-uploads:/app/uploads \
167
tebwritescode/pocket-change-showdown:latest
168
```
169
170
### Kubernetes
171
172
```bash
173
# Apply all manifests
174
kubectl apply -f k8s/
175
176
# Or individually
177
kubectl apply -f k8s/namespace.yaml
178
kubectl apply -f k8s/secret.yaml
179
kubectl apply -f k8s/pvc.yaml
180
kubectl apply -f k8s/deployment.yaml
181
kubectl apply -f k8s/service.yaml
182
kubectl apply -f k8s/ingress.yaml # Optional
183
184
# Check deployment status
185
kubectl get all -n pcs-tracker
186
187
# Access via NodePort (default: 30001)
188
http://<node-ip>:30001
189
```
190
191
#### Kubernetes Features
192
- **Persistent Volumes** - Data and uploads stored in PVCs
193
- **Health Checks** - Liveness and readiness probes
194
- **Resource Limits** - CPU and memory constraints
195
- **Multi-Service** - LoadBalancer and NodePort options
196
- **Ingress Ready** - Configure for your domain
197
198
### Local Development
199
200
```bash
201
# Clone repository
202
git clone https://github.com/tebwritescode/pocket-change-showdown.git
203
cd pocket-change-showdown
204
205
# Create virtual environment
206
python3 -m venv venv
207
source venv/bin/activate # On Windows: venv\Scripts\activate
208
209
# Install dependencies
210
pip install -r requirements.txt
211
212
# Run application
213
python app.py
214
215
# Access at http://localhost:5001
216
```
217
218
## ⚙️ Configuration
219
220
### Environment Variables
221
222
| Variable | Description | Default |
223
|----------|-------------|---------|
224
| `SECRET_KEY` | Flask secret key for sessions | `pcs-secret-key-2024` |
225
| `FLASK_ENV` | Environment mode (`development`/`production`) | `production` |
226
| `DATABASE_URL` | SQLAlchemy database URL | `sqlite:///data/pcs_tracker.db` |
227
| `MAX_CONTENT_LENGTH` | Maximum upload size in bytes | `16777216` (16MB) |
228
229
### Data Persistence
230
231
The application stores data in two locations:
232
- `/app/data` - SQLite database
233
- `/app/uploads` - Receipt images (stored in database as BLOB)
234
235
Mount these directories as volumes to persist data.
236
237
## 📱 Usage
238
239
### Adding Expenses
240
241
1. Click **"Add Expense"** from the navigation or homepage
242
2. Fill in expense details (only title is truly required)
243
3. Upload receipt photo/screenshot (optional)
244
4. Save expense
245
246
### Importing Data
247
248
1. Navigate to **Import/Export** → **Import CSV**
249
2. Download the template for correct format
250
3. Fill in your data
251
4. Upload CSV file
252
253
### CSV Format
254
255
```csv
256
Date,Title,Description,Category,Cost,Payment Method,Location,Vendor,Notes,Tags
257
2024-01-15,Moving Truck,U-Haul rental,Moving,299.99,Credit Card,Downtown,U-Haul,26ft truck,moving
258
2024-01-16,Hotel Stay,Overnight stay,Lodging,125.00,Company Card,Holiday Inn,Holiday Inn,1 night,travel
259
```
260
261
### Managing Categories & Payment Methods
262
263
1. Go to **Settings**
264
2. Add custom categories with colors
265
3. Add custom payment methods
266
4. Delete non-default items
267
5. Change color theme
268
269
### Analytics Dashboard
270
271
- Filter by time period (Week/Month/Quarter/Year)
272
- View spending by category (Doughnut chart)
273
- Payment method breakdown (Bar chart)
274
- Daily spending trends (Line chart)
275
- Top categories table with percentages
276
277
## 🔌 API Documentation
278
279
### Endpoints
280
281
| Method | Endpoint | Description |
282
|--------|----------|-------------|
283
| GET | `/` | Homepage with statistics |
284
| GET | `/expenses` | List all expenses |
285
| GET/POST | `/expense/new` | Add new expense |
286
| GET/POST | `/expense/<id>/edit` | Edit expense |
287
| POST | `/expense/<id>/delete` | Delete expense |
288
| GET | `/expense/<id>/receipt` | View receipt image |
289
| GET | `/dashboard` | Analytics dashboard |
290
| GET | `/api/expense_data` | JSON data for charts |
291
| GET/POST | `/settings` | Application settings |
292
| POST | `/settings/category/add` | Add category |
293
| POST | `/settings/payment/add` | Add payment method |
294
| GET | `/export` | Export CSV |
295
| GET/POST | `/import` | Import CSV |
296
| GET | `/template` | Download CSV template |
297
298
### API Response Example
299
300
```json
301
GET /api/expense_data?period=month
302
303
{
304
"categories": {
305
"labels": ["Moving", "Travel", "Housing"],
306
"data": [1250.50, 890.25, 2100.00]
307
},
308
"payment_methods": {
309
"labels": ["Credit Card", "Cash", "Company Card"],
310
"data": [3500.75, 450.00, 290.00]
311
},
312
"daily_trend": {
313
"labels": ["2024-01-01", "2024-01-02"],
314
"data": [125.50, 340.25]
315
}
316
}
317
```
318
319
## 🛠️ Development
320
321
### Tech Stack
322
323
- **Backend**: Flask 2.3.3, SQLAlchemy
324
- **Frontend**: Bootstrap 5, Chart.js, Font Awesome
325
- **Database**: SQLite with SQLAlchemy ORM
326
- **File Storage**: Binary storage in database
327
- **Deployment**: Docker, Kubernetes, Gunicorn
328
329
### Project Structure
330
331
```
332
pocket-change-showdown/
333
├── app.py # Main Flask application
334
├── requirements.txt # Python dependencies
335
├── Dockerfile # Multi-arch Docker build
336
├── docker-compose.yml # Docker Compose config
337
├── templates/ # HTML templates
338
│ ├── base.html # Base template with themes
339
│ ├── index.html # Homepage
340
│ ├── expenses.html # Expense list
341
│ ├── expense_form.html # Add/Edit form
342
│ ├── dashboard.html # Analytics
343
│ ├── settings.html # Settings page
344
│ └── import.html # CSV import
345
├── k8s/ # Kubernetes manifests
346
│ ├── namespace.yaml
347
│ ├── secret.yaml
348
│ ├── pvc.yaml
349
│ ├── deployment.yaml
350
│ ├── service.yaml
351
│ └── ingress.yaml
352
└── data/ # Database (created at runtime)
353
```
354
355
### Building from Source
356
357
```bash
358
# Build Docker image
359
docker build -t pcs-tracker .
360
361
# Build multi-arch with buildx
362
docker buildx build \
363
--platform linux/amd64,linux/arm64,linux/arm/v7 \
364
-t tebwritescode/pocket-change-showdown:latest \
365
--push .
366
```
367
368
### Database Schema
369
370
```sql
371
-- Main expense table
372
CREATE TABLE expense (
373
id INTEGER PRIMARY KEY,
374
title VARCHAR(200),
375
description TEXT,
376
category_id INTEGER REFERENCES category(id),
377
cost FLOAT DEFAULT 0.0,
378
payment_method_id INTEGER REFERENCES payment_method(id),
379
date DATE,
380
receipt_image BLOB,
381
receipt_filename VARCHAR(200),
382
location VARCHAR(200),
383
vendor VARCHAR(200),
384
notes TEXT,
385
tags VARCHAR(500),
386
created_at DATETIME,
387
updated_at DATETIME
388
);
389
390
-- Categories table
391
CREATE TABLE category (
392
id INTEGER PRIMARY KEY,
393
name VARCHAR(100) UNIQUE NOT NULL,
394
color VARCHAR(7) DEFAULT '#0d6efd',
395
icon VARCHAR(50) DEFAULT 'fa-tag',
396
is_default BOOLEAN DEFAULT FALSE
397
);
398
399
-- Payment methods table
400
CREATE TABLE payment_method (
401
id INTEGER PRIMARY KEY,
402
name VARCHAR(100) UNIQUE NOT NULL,
403
icon VARCHAR(50) DEFAULT 'fa-credit-card',
404
is_default BOOLEAN DEFAULT FALSE
405
);
406
407
-- Settings table
408
CREATE TABLE settings (
409
id INTEGER PRIMARY KEY,
410
color_scheme VARCHAR(50) DEFAULT 'default',
411
default_view VARCHAR(20) DEFAULT 'list'
412
);
413
```
414
415
## 📄 License
416
417
This project is open source and available under the [MIT License](LICENSE).
418
419
## 🙏 Acknowledgments
420
421
- Built with Flask and Bootstrap
422
- Charts powered by Chart.js
423
- Icons by Font Awesome
424
425
## 📞 Support
426
427
For issues, questions, or suggestions:
428
- Open an issue on [GitHub](https://github.com/tebwritescode/pocket-change-showdown/issues)
429
- Contact via GitHub discussions
430
431
---
432
433
<div align="center">
434
435
**P**ocket **C**hange **S**howdown - Track every penny, win the move!
436
437
</div>