A self-hosted web application to track credit card point redemptions and calculate Cents Per Point (CPP) values to optimize your rewards strategy.
This repository provides two Docker images for the complete Cents Per Point application:
stephtanner1/cpp-frontend - React frontend with Vite and Tailwind CSSstephtanner1/cpp-backend - Node.js backend with Express and SQLiteGet up and running in under 2 minutes:
# 1. Create a project directory
mkdir cents-per-point && cd cents-per-point
# 2. Download docker-compose.yml
curl -o docker-compose.yml https://raw.githubusercontent.com/stephtanner1/Cost%20Per%20Point/main/docker-compose.yml
# 3. Start the application
docker-compose up -d
# 4. Open your browser
open http://localhost:3000
Create a docker-compose.yml file:
version: '3.8'
services:
backend:
image: stephtanner1/cpp-backend:latest
ports:
- "5000:5000"
volumes:
- backend_data:/app/data
restart: unless-stopped
frontend:
image: stephtanner1/cpp-frontend:latest
ports:
- "3000:3000"
depends_on:
- backend
restart: unless-stopped
volumes:
backend_data:
Then run:
docker-compose up -d
# Create a volume for data persistence
docker volume create cpp_data
# Run the backend
docker run -d \
--name cpp-backend \
-p 5000:5000 \
-v cpp_data:/app/data \
--restart unless-stopped \
stephtanner1/cpp-backend:latest
# Run the frontend
docker run -d \
--name cpp-frontend \
-p 3000:3000 \
--restart unless-stopped \
stephtanner1/cpp-frontend:latest
After starting the containers:
cpp-frontend)cpp-backend)The backend container uses a Docker volume (backend_data) to persist your redemption data:
/app/data# Create a backup
docker run --rm -v cpp_data:/data -v $(pwd):/backup alpine tar czf /backup/cpp-backup.tar.gz -C /data .
# Restore from backup
docker run --rm -v cpp_data:/data -v $(pwd):/backup alpine tar xzf /backup/cpp-backup.tar.gz -C /data
The containers support the following environment variables:
PORT: Server port (default: 5000)NODE_ENV: Environment mode (default: production)VITE_API_URL: Backend API URL (default: http://localhost:5000)services:
backend:
image: stephtanner1/cpp-backend:latest
environment:
- PORT=8080
- NODE_ENV=production
ports:
- "8080:8080"
frontend:
image: stephtanner1/cpp-frontend:latest
environment:
- VITE_API_URL=http://localhost:8080
Both containers include health checks:
# Check backend health
curl http://localhost:5000/health
# Check container status
docker-compose ps
For development with live reloading, use the development images:
services:
backend:
image: stephtanner1/cpp-backend:dev
volumes:
- ./backend:/app
- /app/node_modules
frontend:
image: stephtanner1/cpp-frontend:dev
volumes:
- ./frontend-vite:/app
- /app/node_modules
The backend provides RESTful endpoints:
GET /api/redemptions - List all redemptionsPOST /api/redemptions - Create new redemptionPUT /api/redemptions/:id - Update redemptionDELETE /api/redemptions/:id - Delete redemptionGET /health - Health check endpoint# View logs
docker-compose logs -f
# View specific service logs
docker-compose logs -f backend
docker-compose logs -f frontend
MIT License - see the LICENSE file for details.
Made with ❤️ for the points and miles community
Track smarter, redeem better, maximize your rewards!
Content type
Image
Digest
sha256:4ea6e5709…
Size
25 MB
Last updated
7 months ago
docker pull stephtanner1/cpp-frontend