2.9 KiB
2.9 KiB
Cashback Tracker
A comprehensive web application for tracking debit card cashback rewards. Built with React + TypeScript frontend, Node.js + Express + SQLite backend, and deployed with Docker Compose.
Features
- Card Management: Add, edit, and delete debit cards with details
- Category Management: Manage cashback categories (groceries, gas, etc.)
- Monthly Category Assignment: Assign categories to cards with specific cashback percentages each month
- Transaction Tracking: Record purchases and automatically calculate cashback
- Dashboard: View current month's cashback summary with filtering options
- Responsive Design: Works seamlessly on desktop and mobile devices
Tech Stack
- Frontend: React 18, TypeScript, TailwindCSS, Shadcn/UI, React Router
- Backend: Node.js, Express.js, SQLite3
- Deployment: Docker & Docker Compose
Quick Start
Using Docker Compose (Recommended)
- Clone the repository
- Run the application:
docker-compose up --build
- Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
Development Setup
Frontend
npm install
npm run dev
Backend
cd server
npm install
npm run dev
Database Schema
- cards: Store debit card information
- categories: Cashback categories (groceries, gas, etc.)
- monthly_categories: Monthly assignment of categories to cards with percentages
- transactions: Purchase records with automatic cashback calculation
API Endpoints
GET /api/cards
- Get all cardsPOST /api/cards
- Create new cardGET /api/categories
- Get all categoriesPOST /api/categories
- Create new categoryGET /api/monthly-categories/:year/:month
- Get monthly assignmentsPOST /api/monthly-categories
- Create monthly assignmentGET /api/transactions/:year/:month
- Get transactions by monthPOST /api/transactions
- Create transaction (auto-calculates cashback)GET /api/cashback/:year/:month
- Get cashback summary with filtering
Usage
- Setup Cards: Add your debit cards with bank information
- Create Categories: Define cashback categories (groceries, gas, dining, etc.)
- Monthly Assignment: Each month, assign categories to cards with their cashback percentages
- Track Transactions: Add purchases to automatically calculate and track cashback
- Monitor Dashboard: View monthly summaries and filter by card or category
Docker Commands
# Build and run
docker-compose up --build
# Run in background
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down
# Remove volumes (reset database)
docker-compose down -v
Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
License
MIT License - see LICENSE file for details