Skip to content

Latest commit

Β 

History

987 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Bradley's Finance Hub

πŸ’Ό Comprehensive Financial Management Progressive Web App

Take complete control of your finances with powerful tools for debt management, budgeting, savings tracking, and financial planning

Firebase Firestore PWA License


πŸ“± About

Bradley's Finance Hub is a modern Progressive Web App (PWA) designed to help you manage every aspect of your financial life. Built with vanilla JavaScript and Firebase, the app provides comprehensive tools for debt management, budgeting, savings tracking, tax estimation, and financial optimization using velocity banking and zero-based budgeting principles.

πŸ”’ Privacy-First: Your financial data is stored securely in Firebase Firestore with authentication and encrypted connections.

πŸ“± Mobile-Optimized: Fully responsive design works seamlessly on desktop, tablet, and mobile devices.

⚑ Performance: Built for speed with optimized code, lazy loading, and efficient data caching.


✨ Features

πŸ’³ 1. Debt Tracker

  • Track multiple debts with detailed information
  • Monitor balances, interest rates, and minimum payments
  • Calculate total debt and average interest rates
  • Payment due date tracking
  • Full CRUD operations (Create, Read, Update, Delete)

πŸ’° 2. Budget Tracker

  • Monthly budget creation and tracking by category
  • Track budgeted vs. spent amounts
  • Visual progress bars with percentage tracking
  • Month-by-month budget history
  • Budget alerts when approaching limits

🎯 3. Savings Goal Tracker

  • Set multiple savings goals with target amounts
  • Track progress with visual progress bars
  • Priority-based goal management (Low, Medium, High)
  • Target date planning
  • Current vs. target amount tracking

⚑ 4. Velocity Calculator

  • Optimize debt payoff using velocity banking principles
  • Compare traditional vs. velocity banking strategies
  • Calculate interest savings and time savings
  • Line of credit integration calculations

πŸ’Ž 5. Net Worth Tracker

  • Track total assets and liabilities
  • Calculate and monitor net worth over time
  • Visual breakdown of assets vs. liabilities
  • Integration with debt data for accurate tracking

πŸ’³ 6. Credit Score Estimator

  • Estimate credit score based on financial factors
  • Factor analysis: Payment History (35%), Credit Utilization (30%), Credit Age (15%), Credit Mix (10%), New Credit (10%)
  • Visual score display with color-coded ranges
  • Detailed score breakdown by factor

πŸ“Ÿ 7. 1099 Tax Estimator

  • Calculate quarterly tax payments for self-employed individuals
  • Self-employment tax calculations (15.3%)
  • Federal income tax estimation
  • Quarterly payment breakdown (Q1-Q4)
  • Support for different filing statuses

πŸ”” 8. Notifications

  • Financial alerts and notifications
  • Budget warnings and overspend alerts
  • Savings goal milestones
  • High-interest debt warnings
  • Mark as read / mark all as read functionality

🧾 9. Activity Feed

  • Complete financial activity history
  • Chronological timeline of all financial events
  • Aggregates data from debts, budgets, goals, and net worth
  • Activity icons and descriptions
  • Date/time formatting

πŸ† 10. Challenge Library

  • 6 pre-built savings challenges:
    • 52-Week Challenge: Save $1,378 over a year
    • 365-Day Penny Challenge: Save $667.95 over a year
    • 100 Envelope Challenge: Save $5,050 over 2 years
    • No-Spend Month Challenge: Break spending habits
    • Biweekly $100 Challenge: Save $2,600 annually
    • Spare Change Challenge: Save all change daily
  • Challenge details and descriptions
  • Direct integration with Savings Goal Tracker

πŸ› οΈ Technology Stack

  • Frontend: Vanilla JavaScript (ES6+), HTML5, CSS3
  • Backend: Firebase (Authentication, Firestore, Hosting)
  • Progressive Web App: Service Worker, Web App Manifest
  • Build Tools: None (direct deployment from source)
  • Hosting: Firebase Hosting
  • Database: Cloud Firestore
  • Authentication: Firebase Authentication

πŸ“‹ Requirements

  • Browser: Modern web browser (Chrome 90+, Firefox 88+, Safari 14+, Edge 90+)
  • Firebase Account: For hosting and backend services
  • Node.js (Optional): For Firebase CLI tools
  • Firebase CLI: For deployment (install via npm install -g firebase-tools)

πŸš€ Getting Started

Prerequisites

  1. Install Firebase CLI (if not already installed):

    npm install -g firebase-tools
  2. Login to Firebase:

    firebase login

Installation

  1. Clone the repository:

    git clone https://github.com/ronb12/Bradleys-Financial-Hub.git
    cd Bradleys-Financial-Hub
  2. Initialize Firebase (if starting fresh):

    firebase init
    • Select: Hosting, Firestore
    • Use existing project: mobile-debt-tracker

Configuration

  1. Firebase Configuration:

    • The Firebase configuration is already set in config/firebase-config.js
    • For a new project, update the config with your Firebase project credentials
  2. App Configuration:

    • Review config/config.js for app settings
    • Configure session timeout, security settings, and feature flags
  3. Firestore Security Rules:

    • Security rules are defined in firestore.rules
    • Rules ensure users can only access their own data
    • Deploy rules: firebase deploy --only firestore:rules
  4. Firestore Indexes:

    • Indexes are defined in firestore.indexes.json
    • Required for queries using where() + orderBy()
    • Deploy indexes: firebase deploy --only firestore:indexes

πŸ“ Project Structure

Bradleys-Financial-Hub/
β”œβ”€β”€ config/                  # Configuration files
β”‚   β”œβ”€β”€ config.js            # App configuration and settings
β”‚   └── firebase-config.js   # Firebase initialization
β”œβ”€β”€ scripts/                 # Core application scripts
β”‚   β”œβ”€β”€ auth.js             # Authentication logic and session management
β”‚   └── service-worker.js   # Service worker for PWA and offline support
β”œβ”€β”€ dist/                    # Build/deployment directory (deployed to Firebase)
β”‚   β”œβ”€β”€ index.html          # Main dashboard page
β”‚   β”œβ”€β”€ src/pages/          # All application pages
β”‚   β”‚   β”œβ”€β”€ debt/           # Debt Tracker
β”‚   β”‚   β”œβ”€β”€ other/          # Budget, Net Worth, Notifications, Activity Feed
β”‚   β”‚   β”œβ”€β”€ savings/        # Savings Goals, Challenge Library
β”‚   β”‚   └── calculators/    # Velocity Calculator, Credit Score, 1099 Tax
β”‚   β”œβ”€β”€ utils/              # Utility scripts
β”‚   β”‚   β”œβ”€β”€ dataService.js  # Firestore data operations (CRUD)
β”‚   β”‚   β”œβ”€β”€ authHelper.js   # Authentication helpers
β”‚   β”‚   β”œβ”€β”€ themeManager.js # Dark/light theme management
β”‚   β”‚   └── ...             # Other utility scripts
β”‚   β”œβ”€β”€ config.js           # Config (copied to dist)
β”‚   β”œβ”€β”€ auth.js             # Auth (copied to dist)
β”‚   └── firebase-config.js  # Firebase config (copied to dist)
β”œβ”€β”€ src/                     # Source code (development)
β”‚   β”œβ”€β”€ components/         # Reusable components
β”‚   └── pages/              # Page components
β”œβ”€β”€ docs/                    # Documentation
β”‚   β”œβ”€β”€ markdown/           # Technical documentation
β”‚   └── logs/               # Test logs and reports
β”œβ”€β”€ firebase.json            # Firebase configuration (hosting, firestore)
β”œβ”€β”€ firestore.rules          # Firestore security rules
β”œβ”€β”€ firestore.indexes.json   # Firestore composite indexes
β”œβ”€β”€ .firebaserc              # Firebase project configuration
└── README.md                # This file

πŸ—οΈ Architecture

Data Flow

  1. Authentication: Firebase Authentication handles user login/logout
  2. Data Storage: Cloud Firestore stores all user financial data
  3. Data Access: dataService.js provides CRUD operations for all collections
  4. UI Updates: Vanilla JavaScript manipulates DOM based on data changes
  5. Real-time Updates: Firestore listeners (optional) for real-time data sync

Collections Structure

  • users: User profile data
  • debts: Debt records with userId, balance, interest rate, payments
  • budgets: Budget records with userId, category, amounts, month
  • savingsGoals: Savings goals with userId, target/current amounts, dates
  • netWorth: Net worth snapshots with userId, assets, liabilities
  • activities: Activity log entries with userId, type, description, amounts

Security

  • Firestore Rules: User-based access control (users can only access their own data)
  • Authentication: Required for all data operations
  • Data Isolation: All queries filtered by userId field
  • Encryption: Firebase handles encryption in transit and at rest

πŸš€ Deployment

Deploy All Services

firebase deploy

Deploy Specific Services

Deploy Hosting Only:

firebase deploy --only hosting

Deploy Firestore Rules Only:

firebase deploy --only firestore:rules

Deploy Firestore Indexes Only:

firebase deploy --only firestore:indexes

Deployment Process

  1. Build (if needed): Ensure dist/ folder contains latest files
  2. Deploy Hosting: firebase deploy --only hosting
  3. Deploy Rules: firebase deploy --only firestore:rules
  4. Deploy Indexes: firebase deploy --only firestore:indexes

Note: The dist/ folder is not tracked in git (in .gitignore). Deploy directly from local dist/ folder.


πŸ”§ Development

Local Development

  1. Serve locally (for testing):

    cd dist
    python3 -m http.server 8000

    Then visit: http://localhost:8000

  2. Use Firebase Emulator (advanced):

    firebase emulators:start

Code Organization

  • Separation of Concerns: Utilities, services, and pages are separated
  • Modular Design: Each page is self-contained HTML file
  • Shared Utilities: Common functionality in /utils directory
  • Data Layer: All Firestore operations centralized in dataService.js

πŸ“š API Documentation

DataService API

All data operations go through window.DataService:

// Debts
await window.DataService.getDebts()
await window.DataService.addDebt(debtData)
await window.DataService.updateDebt(debtId, debtData)
await window.DataService.deleteDebt(debtId)

// Budgets
await window.DataService.getBudgets()
await window.DataService.addBudget(budgetData)
await window.DataService.updateBudget(budgetId, budgetData)
await window.DataService.deleteBudget(budgetId)

// Savings Goals
await window.DataService.getSavingsGoals()
await window.DataService.addSavingsGoal(goalData)
await window.DataService.updateSavingsGoal(goalId, goalData)
await window.DataService.deleteSavingsGoal(goalId)

// Net Worth
await window.DataService.getNetWorth()
await window.DataService.saveNetWorth(netWorthData)

// Activities
await window.DataService.getActivities(limitCount)
await window.DataService.addActivity(activityData)

// Helpers
window.DataService.formatDate(timestamp)
window.DataService.formatCurrency(amount)

Authentication API

// Check authentication
await window.waitForAuth()

// Global auth functions
window.logout()
window.extendSession()
window.login(email, password)
window.register(email, password, displayName)

πŸ”’ Security & Privacy

Data Security

  • Authentication Required: All data operations require authenticated user
  • User Isolation: Firestore rules ensure users can only access their own data
  • Encrypted Connections: All data transmitted over HTTPS
  • Secure Storage: Firebase encrypts data at rest

Privacy Policy

For detailed privacy information, see: Privacy Policy


πŸ“Š Performance

  • Lazy Loading: Scripts and resources loaded on demand
  • Service Worker: Offline support and asset caching
  • Optimized Queries: Firestore indexes for fast queries
  • Efficient Rendering: DOM manipulation optimized for performance
  • Minimal Dependencies: Vanilla JavaScript (no heavy frameworks)

πŸ› Troubleshooting

Common Issues

"Missing or insufficient permissions" Error:

  • Ensure Firestore security rules are deployed: firebase deploy --only firestore:rules
  • Verify user is authenticated: Check window.auth.currentUser

"The query requires an index" Error:

  • Deploy Firestore indexes: firebase deploy --only firestore:indexes
  • Or click the link in the error to create the index automatically

Module Import Errors:

  • Ensure auth.js and firebase-config.js are loaded as modules: <script type="module">
  • Check import paths use absolute paths (starting with /)

Service Worker Issues:

  • Clear browser cache and service workers
  • Unregister old service workers: Visit /unregister_sw.html (if available)

🌐 Live Sites


πŸ“– Additional Documentation

Technical documentation available in docs/markdown/:

  • PROJECT_STRUCTURE.md - Detailed project structure
  • CONSOLE_ERRORS_FIXED.md - Error resolution guide
  • SERVICE_WORKER_CACHE_FIX.md - Service worker documentation

🀝 Contributing

This is a personal project. Contributions and suggestions are welcome!

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature-name
  3. Commit your changes: git commit -m 'Add some feature'
  4. Push to the branch: git push origin feature/your-feature-name
  5. Open a Pull Request

πŸ“„ License

Copyright Β© 2025 Bradley's Finance Hub. All rights reserved.

This software is proprietary and confidential. Unauthorized copying, modification, distribution, or use of this software, via any medium, is strictly prohibited.


πŸ”— Links


πŸ“ž Support

For support, questions, or feature requests:


Made with ❀️ using Firebase and Progressive Web App technologies

Bradley's Finance Hub - Comprehensive Financial Management Tools

Β© 2025 Bradley's Finance Hub. All rights reserved.

About

πŸ’Ό AI-Powered Personal Finance Dashboard | Velocity Banking | Debt Tracking | Budget Management | Net Worth Calculator | Built with Firebase & Modern Web Technologies

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages