Skip to content

Parvezkhan0/subscription-expense-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’° Subscription Expense Tracker

Version License React FastAPI Docker

Take control of your recurring subscriptions and never miss a payment again!

πŸš€ Quick Start β€’ πŸ“– Documentation β€’ 🀝 Contributing β€’ ⭐ Features


🌟 Overview

Subscription Expense Tracker is a full-stack web application that helps you manage all your recurring subscriptions in one place. Built with modern technologies, it provides comprehensive expense tracking, intelligent reminders, and detailed analytics to optimize your subscription spending.

🎯 Perfect for: Individuals and families who want to take control of their subscription expenses and avoid unwanted charges.

πŸ“Š Problem & Solution

🚨 The Problem

  • πŸ’Έ Forgotten subscriptions draining your wallet
  • ⏰ Missed free trial cancellations
  • πŸ” Hidden recurring charges on credit cards
  • πŸ“ˆ No visibility into monthly subscription costs

βœ… Our Solution

  • πŸ“± Centralized dashboard for all subscriptions
  • πŸ”” Smart reminders before renewals
  • πŸ“Š Detailed analytics and spending insights
  • πŸ’‘ Optimization suggestions to save money

⚑ Features

πŸ” Authentication & Security

  • JWT-based secure authentication
  • Password hashing with bcrypt
  • Role-based access control
  • API rate limiting

πŸ“Š Dashboard & Analytics

  • Monthly expense summaries
  • Interactive charts and graphs
  • Spending trend analysis
  • Category-wise breakdowns

πŸ’³ Subscription Management

  • Add, edit, delete subscriptions
  • Track multiple currencies
  • Flexible billing cycles
  • Custom categories

πŸ”” Smart Notifications

  • Email reminders before renewals
  • Customizable notification timing
  • Free trial expiration alerts
  • Monthly spending reports

πŸ“„ Data Management

  • CSV import/export functionality
  • Backup and restore options
  • Data visualization tools
  • Search and filtering

πŸ“± Modern UI/UX

  • Responsive design (mobile-first)
  • Clean, intuitive interface
  • Dark/light mode support
  • Accessibility compliant

πŸ—οΈ Architecture

graph TD
    A[🌐 Frontend<br/>React + Vite<br/>Port: 5173] <--> B[⚑ Backend<br/>FastAPI<br/>Port: 8000]
    B <--> C[πŸ—„οΈ PostgreSQL<br/>Database]
    B <--> D[πŸ”„ Redis<br/>Cache & Tasks]
    B <--> E[πŸ“§ Celery<br/>Background Jobs]
    F[🐳 Docker<br/>Containerization] -.-> A
    F -.-> B
    F -.-> C
    F -.-> D
Loading

πŸ› οΈ Tech Stack

🎨 Frontend Technologies
Technology Version Purpose
React 18+ UI Framework
Vite Latest Build Tool & Dev Server
Tailwind CSS 3+ Styling & Design
React Router 6+ Client-side Routing
Axios Latest HTTP Client
Chart.js Latest Data Visualization
βš™οΈ Backend Technologies
Technology Version Purpose
FastAPI 0.104+ Web Framework
PostgreSQL 15+ Primary Database
SQLAlchemy 2+ ORM
Redis 7+ Caching & Task Queue
Celery 5+ Background Tasks
JWT - Authentication
πŸš€ DevOps & Infrastructure
Technology Purpose
Docker Containerization
Docker Compose Local Development
Nginx/Traefik Reverse Proxy
GitHub Actions CI/CD Pipeline
AWS/GCP Cloud Deployment

πŸš€ Quick Start

Prerequisites

  • 🐳 Docker & Docker Compose
  • πŸ“¦ Node.js 18+ (for manual setup)
  • 🐍 Python 3.11+ (for manual setup)

Option 1: Docker (Recommended) 🐳

# Clone the repository
git clone https://github.com/Parvezkhan0/subscription-expense-tracker.git
cd subscription-expense-tracker

# Start all services with Docker Compose
docker-compose up --build

# πŸŽ‰ That's it! Your app is running:
# Frontend: http://localhost:5173
# Backend API: http://localhost:8000
# API Docs: http://localhost:8000/docs

Option 2: Manual Setup πŸ› οΈ

Click to expand manual setup instructions

Backend Setup

cd backend

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Set environment variables
cp .env.example .env
# Edit .env with your configuration

# Run database migrations
alembic upgrade head

# Start the server
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

Frontend Setup

cd frontend

# Install dependencies
npm install

# Set environment variables
cp .env.example .env
# Edit .env with your configuration

# Start development server
npm run dev

🌐 API Documentation

πŸ”‘ Authentication Endpoints

Endpoint Method Description
/auth/signup POST Register new user
/auth/login POST User authentication
/auth/refresh POST Refresh JWT token
/auth/logout POST User logout

πŸ’³ Subscription Endpoints

Endpoint Method Description
/subscriptions/ GET List all subscriptions
/subscriptions/ POST Create new subscription
/subscriptions/{id} PUT Update subscription
/subscriptions/{id} DELETE Delete subscription

πŸ“Š Analytics Endpoints

Endpoint Method Description
/dashboard/summary GET Monthly summary
/analytics/trends GET Spending trends
/analytics/categories GET Category breakdown

πŸ“– Full API Documentation: Visit http://localhost:8000/docs after starting the backend

πŸ”§ Configuration

Environment Variables

Backend (.env)

# Database
DATABASE_URL=postgresql://user:password@localhost:5432/subscription_db

# JWT
SECRET_KEY=your-secret-key-here
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30

# Redis
REDIS_URL=redis://localhost:6379

# Email (for notifications)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASSWORD=your-app-password

Frontend (.env)

VITE_API_BASE_URL=http://localhost:8000
VITE_APP_NAME=Subscription Tracker

πŸ§ͺ Testing

# Backend tests
cd backend
pytest tests/ -v --coverage

# Frontend tests
cd frontend
npm run test

# E2E tests
npm run test:e2e

πŸ“¦ Deployment

🐳 Docker Production

# Build production images
docker-compose -f docker-compose.prod.yml build

# Deploy to production
docker-compose -f docker-compose.prod.yml up -d

☁️ Cloud Deployment

AWS Deployment Guide
  1. Setup RDS PostgreSQL
  2. Setup ElastiCache Redis
  3. Deploy to ECS/EKS
  4. Configure CloudFront
  5. Setup Route53 DNS

See deployment guide for detailed instructions.

πŸ”’ Security Features

  • πŸ›‘οΈ JWT Authentication with refresh tokens
  • πŸ” Password hashing using bcrypt
  • 🚫 Rate limiting on API endpoints
  • πŸ”’ HTTPS enforcement in production
  • πŸ›‚ Input validation with Pydantic
  • πŸ” SQL injection prevention

πŸš€ Roadmap

🎯 Version 2.0 (Q2 2024)

  • πŸ€– AI-powered subscription optimization
  • πŸ“± Mobile app (React Native)
  • πŸ” OCR for receipt scanning
  • πŸ“ˆ Advanced analytics dashboard

🎯 Version 3.0 (Q3 2024)

  • πŸ’¬ WhatsApp/Telegram notifications
  • 🌍 Multi-currency support
  • πŸ‘₯ Family/team sharing
  • 🎨 Custom themes and branding

πŸ“Š Project Stats

GitHub stars GitHub forks GitHub issues GitHub pull requests

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

πŸ› οΈ Development Process

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch (git checkout -b feature/AmazingFeature)
  3. πŸ’ Commit your changes (git commit -m 'Add some AmazingFeature')
  4. πŸ“€ Push to the branch (git push origin feature/AmazingFeature)
  5. πŸŽ‰ Open a Pull Request

πŸ“‹ Contribution Guidelines

  • Follow the existing code style
  • Write tests for new features
  • Update documentation as needed
  • Be respectful and collaborative

⭐ If you found this project helpful, please give it a star!

Made with ❀️ by Parvez Khan

About

πŸ’° Full-stack subscription expense tracker built with React & FastAPI. Manage recurring subscriptions, track expenses, get renewal reminders, and optimize spending with smart analytics. Features JWT auth, real-time notifications, and comprehensive dashboard.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages