Skip to content

AmmarsGeeks/Subscription-Management-Dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Subscription Management Dashboard

A comprehensive Django & Django REST Framework application to track subscription services (e.g. Netflix, Spotify) with renewal reminders, cost analysis, and a user-friendly dashboard interface.


Table of Contents


Overview

This application helps users manage their subscriptions by tracking monthly and annual costs, reminding about upcoming renewals, and calculating potential savings if switching from monthly to annual billing. The frontend dashboard provides clear insights with charts and alerts to help users stay on top of their subscriptions.


Features

Backend (Django + DRF)

  • Manage subscriptions with fields like name, price, billing cycle, start date, and renewal date.
  • Automatically calculate renewal dates based on billing cycle.
  • Validate renewal dates cannot be set in the past.
  • API endpoints for listing, creating, and soft-deleting subscriptions.
  • Annotation-based cost calculations for efficient data retrieval.
  • Annual savings calculation based on switching from monthly to annual billing.

Frontend

  • Dashboard displaying total monthly spend and cost breakdown by subscription.
  • Alerts highlighting subscriptions renewing within the next 7 days.
  • Bar chart visualization of monthly costs per service.
  • Comparison tool displaying potential yearly savings.

Technical Details

  • Python 3.12, Django 5.2, Django REST Framework
  • PostgreSQL or SQLite database support
  • Chart.js for frontend chart rendering
  • Decimal precision handled carefully for financial data
  • Clean, modular code structure for easy maintenance and extension

Installation

  1. Clone the repo:
    git clone <repository_url>
    cd <repository_directory>
    

Create and activate a virtual environment:

    python3 -m venv venv
    source venv/bin/activate

Install dependencies:

    pip install -r requirements.txt

Run migrations

    python manage.py migrate

Run the development server:

    python manage.py runserver

Usage

API Endpoints

  1. List Subscriptions GET /api/subscriptions/ Returns all active subscriptions with calculated monthly and annual costs.
    curl -X GET http://localhost:8000/api/subscriptions/
  1. Add Subscription POST /api/subscriptions/ Create a new subscription.

If renewal_date is omitted, it will be auto-calculated based on start_date and billing_cycle.

You can optionally specify renewal_date manually.

Sample JSON payload:

   {
  "name": "Netflix",
  "price": "15.99",
  "billing_cycle": "monthly",
  "renewal_date": "2025-05-28"
    }

cURL example:

    curl -X POST http://localhost:8000/api/subscriptions/ \
    -H "Content-Type: application/json" \
    -d '{
    "name": "Netflix",
    "price": "15.99",
    "billing_cycle": "monthly",
    "renewal_date": "2025-05-28"
    }'
  1. Cancel Subscription

DELETE /api/subscriptions/{id}/ Soft deletes (deactivates) a subscription by setting is_active to False.

Example to cancel subscription with ID 4:

    curl -X DELETE http://localhost:8000/api/subscriptions/4/

Folder Structure

    subman/
├── manage.py
├── requirements.txt
├── README.md
├── subman/
│   ├── __init__.py
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
├── subscriptions/
│   ├── __init__.py
│   ├── admin.py
│   ├── apps.py
│   ├── models.py
│   ├── serializers.py
│   ├── tests.py
│   ├── urls.py
│   ├── views.py
│   └── templates/
│       └── subscriptions/
│           ├── base.html
│           └── dashboard.html
└── static/
    └── (css/js/images as needed)

Screenshots

  1. Dashboard — Initial State (no data) Dashboard Empty

  2. Dashboard — With Subscriptions & Alerts

Dashboard With Alerts

License

MIT License

About

Subscription Management Dashboard

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published