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