A beginner-friendly web application to track and manage your subscriptions (Netflix, Amazon Prime, Gym memberships, etc.). Built with Flask (Python) and includes a Django alternative version.
- β User registration and login
- β Add, edit, and delete subscriptions
- β Dashboard showing all subscriptions
- β Monthly and yearly spending calculations
- β Automatic email notifications for upcoming renewals
- β Analytics page with charts
- β Mobile-friendly responsive design
- β Secure password hashing
- β SQLite database (development) or MySQL (production)
- Download Python from python.org
- Install Python (check "Add Python to PATH" during installation)
- Verify installation:
Should show:
python --version
Python 3.x.x
A virtual environment keeps your project dependencies separate:
# Navigate to project folder
cd FYPNew
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On Mac/Linux:
source venv/bin/activateYou should see (venv) in your terminal prompt.
pip install -r requirements.txtThis installs all required packages (Flask, SQLAlchemy, etc.).
-
Copy
.env.exampleto.env:# On Windows: copy .env.example .env # On Mac/Linux: cp .env.example .env
-
Edit
.envfile and add your settings:SECRET_KEY=your-random-secret-key-here DATABASE_URL=sqlite:///subscriptions.db MAIL_USERNAME=your-email@gmail.com MAIL_PASSWORD=your-gmail-app-password
Note: For Gmail, you need an "App Password":
- Go to Google Account β Security β 2-Step Verification β App Passwords
- Generate a password for "Mail"
python run.pyYou should see:
==================================================
Subscription Management Website
==================================================
Server starting on http://127.0.0.1:5000
Press CTRL+C to stop the server
==================================================
Open your web browser and go to:
http://127.0.0.1:5000
- Click "Register"
- Fill in username, email, and password
- Click "Register"
- You'll be redirected to login
After logging in:
- Click "Add Subscription"
- Add these examples:
- Netflix: $10/month, Next renewal: (30 days from today)
- Amazon Prime: $6/month, Next renewal: (30 days from today)
- Gym: $15/month, Next renewal: (30 days from today)
project/
βββ app/
β βββ __init__.py # Flask app factory
β βββ routes.py # URL routes and page handlers
β βββ models.py # Database models (User, Subscription)
β βββ forms.py # Form definitions
β βββ utils.py # Helper functions (notifications, calculations)
β βββ templates/ # HTML templates
β β βββ layout.html
β β βββ register.html
β β βββ login.html
β β βββ dashboard.html
β β βββ subscription_form.html
β β βββ analytics.html
β βββ static/
β βββ css/style.css # Stylesheet
β βββ js/charts.js # Chart utilities
βββ config.py # Configuration settings
βββ run.py # Application entry point
βββ requirements.txt # Python dependencies
βββ Procfile # For deployment (Heroku/Render)
βββ .env.example # Environment variables template
βββ tests/
β βββ test_basic.py # Basic tests
βββ README.md # This file
Development (SQLite):
- No setup needed! SQLite is included with Python.
- Database file:
subscriptions.db(created automatically)
Production (MySQL):
- Install MySQL server
- Create database:
CREATE DATABASE subscriptions_db;
- Update
.env:DATABASE_URL=mysql+pymysql://username:password@localhost/subscriptions_db
- Install MySQL driver:
pip install PyMySQL cryptography
Email notifications are sent 3 days before subscription renewal.
Setup Gmail:
- Enable 2-Step Verification in Google Account
- Generate App Password: Security β App Passwords β Mail
- Add to
.env:MAIL_USERNAME=your-email@gmail.com MAIL_PASSWORD=your-app-password
- Shows all your subscriptions in a table
- Displays monthly and yearly totals
- Highlights upcoming renewals (next 7 days)
- Quick actions: Edit or Delete subscriptions
- Visual charts showing spending by category
- Monthly vs Yearly spending comparison
- Total subscription count
- Automatic email reminders 3 days before renewal
- Runs daily at 9 AM (configurable in
run.py)
-
Create Render Account:
- Go to render.com
- Sign up for free
-
Create New Web Service:
- Click "New" β "Web Service"
- Connect your GitHub repository
- Or upload files manually
-
Configure Settings:
- Build Command:
pip install -r requirements.txt - Start Command:
gunicorn run:app - Python Version: 3.11
- Build Command:
-
Set Environment Variables:
- Go to Environment tab
- Add all variables from
.env:SECRET_KEY(generate random string)DATABASE_URL(use Render's PostgreSQL or MySQL)MAIL_USERNAMEMAIL_PASSWORD
-
Deploy:
- Click "Create Web Service"
- Wait for deployment (2-3 minutes)
- Your site is live!
-
Install Heroku CLI:
- Download from heroku.com
-
Login:
heroku login
-
Create App:
heroku create your-app-name
-
Set Environment Variables:
heroku config:set SECRET_KEY=your-secret-key heroku config:set DATABASE_URL=your-database-url heroku config:set MAIL_USERNAME=your-email@gmail.com heroku config:set MAIL_PASSWORD=your-app-password
-
Deploy:
git push heroku main
-
Open:
heroku open
- What: Passwords are never stored as plain text
- How: Uses Werkzeug's
generate_password_hash()function - Why: If database is hacked, passwords can't be read
- What: Prevents fake form submissions
- How: Flask-WTF automatically adds hidden tokens to forms
- Why: Stops attackers from submitting forms on your behalf
- What: Stores sensitive data (passwords, keys) outside code
- How: Loaded from
.envfile (never commit to git!) - Why: Keeps secrets safe and allows different settings per environment
- What: Prevents malicious database queries
- How: SQLAlchemy ORM automatically escapes inputs
- Why: Protects your database from attacks
- Install Python 3.8+
- Create virtual environment (
python -m venv venv) - Activate virtual environment
- Install dependencies (
pip install -r requirements.txt) - Copy
.env.exampleto.envand fill in values - Run application (
python run.py) - Open browser to
http://127.0.0.1:5000 - Register a new account
- Login with your account
- Add your first subscription
- View dashboard with subscription
- Check analytics page
- Test edit and delete functions
- Verify email notifications (if configured)
Demo Flow:
- Login - Show secure authentication system
- Add Subscription - Demonstrate adding Netflix subscription with form validation
- Dashboard Updates - Show how totals automatically calculate (monthly/yearly)
- Chart Updates - Display analytics page with visual spending breakdown
- Notification System - Explain automatic email reminders for upcoming renewals
# Install pytest
pip install pytest
# Run tests
python -m pytest tests/- β Simpler - Easier to understand
- β Flexible - More control over structure
- β Faster to learn - Less concepts
- β Better for small projects - Lightweight
- β More structured - Follows conventions
- β Built-in admin - Automatic admin panel
- β More features - Includes ORM, auth, etc.
β οΈ Steeper learning curve - More to learn
Recommendation: Start with Flask version if you're a beginner!
After creating your account, add these subscriptions:
| Name | Price | Billing Cycle | Category |
|---|---|---|---|
| Netflix | $10 | Monthly | Streaming |
| Amazon Prime | $6 | Monthly | Shopping |
| Gym Membership | $15 | Monthly | Fitness |
- Solution: Make sure virtual environment is activated and dependencies are installed
- Solution: Change port in
run.py:app.run(port=5001)
- Solution: Check Gmail App Password is correct, enable "Less secure app access" (if needed)
- Solution: Delete
subscriptions.dband restart app (database will be recreated)
- Flask Documentation: flask.palletsprojects.com
- SQLAlchemy: docs.sqlalchemy.org
- WTForms: wtforms.readthedocs.io
This project is open source and available for educational purposes.
Created for Final Year Project (FYP) - Beginner-friendly subscription management system.
# Activate virtual environment
source venv/bin/activate # Mac/Linux
venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
# Run application
python run.py
# Run tests
python -m pytest tests/
# Create database (automatic on first run)
# Database file: subscriptions.dbHappy Coding! π
If you have questions or issues, check the troubleshooting section or review the code comments - everything is explained in beginner-friendly terms!