Blame

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