A self-hosted web application to track credit card point redemptions and calculate Cents Per Point (CPP) values to optimize your rewards strategy.
- π Track & Analyze - Log redemptions and calculate CPP with interactive analytics
- π₯ Import/Export - Bulk CSV import with smart column mapping and data validation
- π« Travel Credits - Track both point redemptions and travel credit usage
- π Visual Analytics - Professional charts with continuous trend lines and clean time-series data
- π Privacy First - All data stored locally, no external transmission
- π³ Docker Ready - Easy deployment with PostgreSQL and automatic SQLite migration
Step 1: Create a .env file with your database password:
echo "DB_PASSWORD=your-secure-password" > .envStep 2: Download and start:
curl -o docker-compose.yml https://raw.githubusercontent.com/stephtanner1/Cost%20Per%20Point/main/docker-compose.yml
docker-compose up -dStep 3: Open your browser:
# Local access
open http://localhost:3000
# Remote access (replace IP with your server's IP)
open http://192.168.0.100:3000services:
postgres:
image: postgres:15-alpine
environment:
POSTGRES_DB: centsperpoint
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
restart: unless-stopped
backend:
image: stephtanner1/cpp-backend:latest
environment:
- DB_PASSWORD=${DB_PASSWORD}
ports:
- "5000:5000"
# Optional: Mount SQLite data if migrating from a previous sqlite version
# volumes:
# - backend_data:/app/data
depends_on:
- postgres
restart: unless-stopped
frontend:
image: stephtanner1/cpp-frontend:latest
# Uncomment VITE_API_URL only if you change the backend port above
# Replace YOUR_SERVER_IP with localhost (local) or your server's IP (remote)
# Example: VITE_API_URL=http://192.168.0.100:8080
# environment:
# - VITE_API_URL=http://YOUR_SERVER_IP:BACKEND_PORT
ports:
- "3000:3000"
depends_on:
- backend
restart: unless-stopped
volumes:
postgres_data:
# backend_data: -- optional, uncomment if migrating from a previous sqlite versionTo migrate existing SQLite data:
- Uncomment the volume lines in
docker-compose.yml(lines marked with# Optional) - Add
ENABLE_SQLITE_MIGRATION=trueto your.envfile - Run
docker-compose up -d - Check logs:
docker-compose logs -f backend
Migration is automatic and non-destructive (creates a backup).
| Service | Port | URL |
|---|---|---|
| Frontend | 3000 | http://localhost:3000 |
| Backend API | 5000 | http://localhost:5000/health |
| PostgreSQL | 5432 | Internal only |
To use different ports, edit the ports section in docker-compose.yml:
ports:
- "8080:5000" # Backend now accessible on port 8080Important: If you change the backend port, also uncomment and set VITE_API_URL:
# In frontend service:
environment:
- VITE_API_URL=http://localhost:8080 # For local access
# - VITE_API_URL=http://192.168.0.100:8080 # For remote accessNote: The frontend automatically detects Docker environments and constructs API URLs, but custom backend ports require explicit
VITE_API_URLconfiguration.
Required: Create a .env file with your database password:
DB_PASSWORD=your-secure-passwordOptional: For SQLite migration only:
ENABLE_SQLITE_MIGRATION=trueRemote Access: Works automatically via your server's IP address (e.g.,
http://192.168.0.100:3000). The frontend automatically detects the environment and constructs the correct API URLs.
GET /api/redemptions- List all redemptionsPOST /api/redemptions- Create new redemptionPUT /api/redemptions/:id- Update redemptionDELETE /api/redemptions/:id- Delete redemption
GET /api/import-export/export- Export CSVGET /api/import-export/template- Download templatePOST /api/import-export/analyze- Analyze CSV structurePOST /api/import-export/import- Import with mapping
Example:
# Export data (local)
curl http://localhost:5000/api/import-export/export -o backup.csv
# Export data (remote - replace with your server IP)
curl http://192.168.0.100:5000/api/import-export/export -o backup.csv
# Create redemption
curl -X POST http://localhost:5000/api/redemptions \
-H "Content-Type: application/json" \
-d '{"date":"2024-01-15","source":"Chase","points":50000,"value":750}'Near Term: Advanced analytics dashboard, enhanced import formats
Medium Term: Point balance tracking, multi-user support
Long Term: Progressive web app, API integrations
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Test locally:
docker-compose up --build - Submit pull request
See CONTRIBUTING.md for detailed guidelines.
Licensed under MIT License. See LICENSE for details.
- π Issues & Features: GitHub Issues
- π Detailed Docs: Deployment Guide
β Star this repo if you find it helpful!
Made with β€οΈ for the points and miles community
