Skip to content

Motakabbir/budget-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

61 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Budget Manager ๐Ÿ’ฐ

A modern, full-featured personal finance management application built with Vite, React 19, TypeScript, Tailwind CSS 4, shadcn/ui, Recharts, and Supabase.

Version License React TypeScript


๐Ÿš€ Quick Start

Get started in 15 seconds:

./install.sh  # Automated installation - Choose Complete Schema

๏ฟฝ Essential Docs

๐Ÿ“Š Schema Info

โšก TL;DR

# 1. Install database (15 seconds)
./install.sh  # Choose option 2: Complete Schema

# 2. Configure environment
cp env.example.local .env.local
# Add your Supabase keys

# 3. Start app
npm install && npm run dev

โœจ Features

๐Ÿ“Š Core Features

  • Interactive Dashboard

    • Real-time financial analytics and visualizations
    • Income vs Expenses comparison charts (6-month trends)
    • Category-wise spending breakdown with pie charts
    • Balance trend line charts over time
    • Monthly financial summaries with quick stats cards
    • Time period filtering (7 days, 30 days, 90 days, 1 year, all time)
  • ๐Ÿ’ฐ Transaction Management

    • Track income and expenses with detailed categorization
    • Add, edit, and delete transactions seamlessly
    • Calendar-based date picker for accurate record-keeping
    • Rich descriptions and notes for each transaction
    • Real-time balance calculations with opening balance support
    • CSV export functionality for reporting
  • ๐Ÿท๏ธ Smart Categorization

    • Custom color-coded categories for income and expenses
    • Visual category icons and badges
    • Category-specific budget limits (monthly/yearly)
    • Budget vs actual spending tracking
    • Category usage analytics
  • ๐ŸŽฏ Savings Goals

    • Set financial targets with deadlines
    • Visual progress tracking with progress bars
    • Add contributions to goals incrementally
    • Goal completion notifications
    • Multiple simultaneous savings goals
  • ๏ฟฝ Advanced Budgeting

    • 50/30/20 budget rule implementation
    • Custom budget allocation with flexible percentages
    • Automatic category classification (needs/wants/savings)
    • Budget vs actual spending comparison
    • Smart recommendations based on spending patterns
    • Real-time utilization tracking
  • ๐Ÿ”ฎ Financial Forecasting

    • Cash flow projections (3/6/12 months)
    • Burn rate calculations
    • Future balance predictions based on trends
    • What-if scenario analysis (salary increase, loan payoff, expense reduction, etc.)
    • Scenario comparison tools
    • Financial health indicators
  • ๏ฟฝ๐Ÿ”” Notifications & Alerts

    • Budget overspending alerts
    • Savings goal milestone notifications
    • Real-time toast notifications for all actions
    • Notification history and management page
    • Spending threshold warnings
  • ๐Ÿ“ค Data Management

    • Export transactions to CSV (Excel-compatible)
    • Full backup/restore functionality (JSON format)
    • Bulk data import/export
    • Data integrity validation
    • Automatic data persistence

๐ŸŽจ User Experience

  • Theme System

    • ๐ŸŒž Light Mode: Clean, bright interface
    • ๐ŸŒ™ Dark Mode: Eye-friendly for low-light environments
    • ๐Ÿ’ป System Mode: Automatically matches OS preferences
    • Persistent theme storage across sessions
    • Smooth theme transitions with no flicker
  • ๐Ÿ“ฑ Responsive Design

    • Mobile-first approach with collapsible sidebar
    • Touch-optimized controls (44x44px minimum tap targets)
    • Adaptive layouts for all screen sizes (mobile/tablet/desktop)
    • Progressive Web App (PWA) support - installable on mobile
    • Works offline with service workers
  • โšก Performance Optimizations

    • Lazy loading for optimal initial load times
    • Smart data caching with TanStack Query (75% faster after first visit)
    • Optimized bundle splitting and code chunks
    • Skeleton loaders for smooth perceived performance
    • React 19 with automatic batching
  • โ™ฟ Accessibility

    • WCAG AA compliant
    • Full keyboard navigation support
    • Screen reader friendly with ARIA labels
    • High contrast mode support
    • Focus management and visible focus indicators

๐Ÿ› ๏ธ Tech Stack

Frontend

  • Framework: Vite 7 + React 19 + TypeScript 5
  • Routing: React Router DOM v7
  • Styling: Tailwind CSS 4 with PostCSS
  • UI Library: shadcn/ui (Radix UI primitives)
  • Charts: Recharts 3
  • Icons: Lucide React
  • Animations: tw-animate-css

Backend & Database

  • Backend: Supabase (PostgreSQL + Auth)
  • Authentication: Supabase Auth with email/password
  • Database: PostgreSQL with Row Level Security (RLS)
  • Real-time: Supabase Realtime subscriptions

State & Data Management

  • State Management: Zustand 5 (lightweight and performant)
  • Data Fetching: TanStack Query v5 (React Query) with automatic caching
  • Form Validation: Zod 4 with TypeScript integration
  • Date Handling: date-fns 4

Developer Tools

  • Testing: Vitest 4 + React Testing Library
  • Linting: ESLint 9 with modern config
  • Error Tracking: Sentry React for production monitoring
  • PWA: vite-plugin-pwa for Progressive Web App support
  • Type Safety: Full TypeScript with strict mode enabled

๐Ÿš€ Getting Started

Quick Installation (5 Minutes)

Want to get started quickly? Follow our streamlined installation guide:

๐Ÿ‘‰ Complete Installation Guide ๐Ÿ‘ˆ

Or use the automated installation script:

# Clone the repository
git clone https://github.com/Motakabbir/budget_manager.git
cd budget_manager

# Run automated installation
./install.sh

Prerequisites

Manual Installation Steps

  1. Clone the repository:

    git clone https://github.com/Motakabbir/budget_manager.git
    cd budget_manager
  2. Install dependencies:

    npm install
  3. Set up Supabase:

    • Create a new project in Supabase Dashboard
    • Go to Project Settings > API
    • Copy your Project URL and anon public key
  4. Configure environment variables:

    cp env.example.local .env.local
    • Update .env.local with your Supabase credentials:
      VITE_SUPABASE_URL=your_supabase_project_url
      VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
  5. Set up the database (One Command):

    • Go to Supabase Dashboard โ†’ SQL Editor โ†’ New Query
    • Copy ALL content from src/lib/supabase/schema.sql
    • Paste into SQL Editor and click Run
    • โœ… Done! All tables, indexes, and security policies created
  6. Start the app:

    npm run dev
  7. Open your browser: http://localhost:5173

Database Setup

The single schema file (src/lib/supabase/schema.sql) includes:

  • โœ… 6 tables with relationships
  • โœ… 24 Row Level Security policies
  • โœ… 12 performance indexes
  • โœ… 1 helper function
  • โœ… Complete security setup

Time needed: ~30 seconds

For detailed migration guides:

๐Ÿ“ Project Structure

budget_manager/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ pages/                    # Main page components
โ”‚   โ”‚   โ”œโ”€โ”€ AuthPage.tsx          # Authentication (sign in/up)
โ”‚   โ”‚   โ”œโ”€โ”€ DashboardLayout.tsx   # Layout wrapper with sidebar
โ”‚   โ”‚   โ”œโ”€โ”€ DashboardPage.tsx     # Main dashboard with charts
โ”‚   โ”‚   โ”œโ”€โ”€ IncomePage.tsx        # Income transaction management
โ”‚   โ”‚   โ”œโ”€โ”€ ExpensesPage.tsx      # Expense transaction management
โ”‚   โ”‚   โ”œโ”€โ”€ CategoriesPage.tsx    # Category management
โ”‚   โ”‚   โ”œโ”€โ”€ NotificationsPage.tsx # Notification center
โ”‚   โ”‚   โ””โ”€โ”€ SettingsPage.tsx      # Settings & savings goals
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ components/               # Reusable components
โ”‚   โ”‚   โ”œโ”€โ”€ ui/                   # shadcn/ui components (20+ components)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ button.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ card.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ dialog.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ input.tsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”‚   โ”œโ”€โ”€ dashboard/            # Dashboard-specific components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ QuickStatsCards.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ChartsSection.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ MonthlyBreakdownCards.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ SpendingAlertsCard.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ NotificationStatusWidget.tsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ TimePeriodFilter.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ loading/              # Loading states
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ LoadingSkeletons.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ notifications/        # Notification components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ notification-panel.tsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ notification-item.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ settings/             # Settings components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ DataManagementCard.tsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ NotificationSettings.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ ErrorBoundary.tsx     # Error boundary wrapper
โ”‚   โ”‚   โ”œโ”€โ”€ sidebar.tsx           # Navigation sidebar
โ”‚   โ”‚   โ”œโ”€โ”€ top-bar.tsx           # Top navigation bar
โ”‚   โ”‚   โ”œโ”€โ”€ footer.tsx            # Footer component
โ”‚   โ”‚   โ”œโ”€โ”€ theme-toggle.tsx      # Theme switcher
โ”‚   โ”‚   โ”œโ”€โ”€ page-header.tsx       # Page header component
โ”‚   โ”‚   โ””โ”€โ”€ responsive-grid.tsx   # Responsive grid layout
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ lib/                      # Utilities and configurations
โ”‚   โ”‚   โ”œโ”€โ”€ supabase/             # Supabase configuration
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ client.ts         # Supabase client instance
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ database.types.ts # Generated TypeScript types
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ schema.sql        # Complete database schema
โ”‚   โ”‚   โ”œโ”€โ”€ store/                # Zustand state management
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ index.ts          # Global state store
โ”‚   โ”‚   โ”œโ”€โ”€ hooks/                # Custom React hooks
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ use-toast.ts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ use-mobile.ts
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”‚   โ”œโ”€โ”€ providers/            # Context providers
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ theme-provider.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ utils/                # Utility functions
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ export.ts         # CSV/JSON export utilities
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”‚   โ”œโ”€โ”€ validations/          # Zod validation schemas
โ”‚   โ”‚   โ”œโ”€โ”€ sentry.ts             # Error tracking config
โ”‚   โ”‚   โ””โ”€โ”€ utils.ts              # Common utilities
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ test/                     # Test setup and utilities
โ”‚   โ”‚   โ”œโ”€โ”€ setup.ts              # Vitest configuration
โ”‚   โ”‚   โ”œโ”€โ”€ mocks/                # Mock data and functions
โ”‚   โ”‚   โ””โ”€โ”€ utils/                # Test utilities
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ App.tsx                   # Main app component with routing
โ”‚   โ”œโ”€โ”€ main.tsx                  # App entry point
โ”‚   โ”œโ”€โ”€ index.css                 # Global styles
โ”‚   โ””โ”€โ”€ vite-env.d.ts             # Vite type declarations
โ”‚
โ”œโ”€โ”€ docs/                         # Documentation
โ”‚   โ”œโ”€โ”€ guides/                   # User guides
โ”‚   โ”‚   โ”œโ”€โ”€ QUICK_START.md
โ”‚   โ”‚   โ”œโ”€โ”€ SETUP_GUIDE.md
โ”‚   โ”‚   โ”œโ”€โ”€ FEATURES_LOCATION_GUIDE.md
โ”‚   โ”‚   โ”œโ”€โ”€ PROJECT_SUMMARY.md
โ”‚   โ”‚   โ”œโ”€โ”€ BUDGET_FEATURE_SETUP.md
โ”‚   โ”‚   โ”œโ”€โ”€ NOTIFICATION_IMPLEMENTATION_GUIDE.md
โ”‚   โ”‚   โ”œโ”€โ”€ NEW_FEATURES_GUIDE.md
โ”‚   โ”‚   โ”œโ”€โ”€ RESPONSIVE_DESIGN.md
โ”‚   โ”‚   โ”œโ”€โ”€ VERCEL_DEPLOYMENT.md
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ””โ”€โ”€ database/                 # Database documentation
โ”‚       โ”œโ”€โ”€ DATABASE_SETUP.md
โ”‚       โ”œโ”€โ”€ MIGRATION_GUIDE.md
โ”‚       โ”œโ”€โ”€ QUICK_MIGRATION.md
โ”‚       โ”œโ”€โ”€ migration_add_budgets.sql
โ”‚       โ”œโ”€โ”€ migration_add_notifications.sql
โ”‚       โ”œโ”€โ”€ migration_add_recurring.sql
โ”‚       โ””โ”€โ”€ ...
โ”‚
โ”œโ”€โ”€ public/                       # Static assets
โ”‚   โ””โ”€โ”€ manifest.json             # PWA manifest
โ”‚
โ”œโ”€โ”€ package.json                  # Dependencies and scripts
โ”œโ”€โ”€ tsconfig.json                 # TypeScript configuration
โ”œโ”€โ”€ vite.config.ts                # Vite configuration
โ”œโ”€โ”€ vitest.config.ts              # Vitest test configuration
โ”œโ”€โ”€ eslint.config.mjs             # ESLint configuration
โ”œโ”€โ”€ postcss.config.mjs            # PostCSS configuration
โ”œโ”€โ”€ components.json               # shadcn/ui configuration
โ”œโ”€โ”€ vercel.json                   # Vercel deployment config
โ”œโ”€โ”€ env.example.local             # Environment variables template
โ””โ”€โ”€ README.md                     # This file

๐Ÿ—„๏ธ Database Schema

Tables Overview

Table Description Key Features
profiles User profile information Auto-created on signup
categories Income/expense categories Color-coded, user-specific
transactions Financial transactions Income & expenses with categories
savings_goals User savings targets Progress tracking, deadlines
user_settings User preferences Opening balance, theme, notifications
category_budgets Budget limits per category Monthly/yearly periods
recurring_transactions Recurring transaction templates Auto-generation support
notifications System notifications Budget alerts, goal updates

Security Features

  • โœ… Row Level Security (RLS) enabled on all tables
  • โœ… Users can only access their own data
  • โœ… Secure authentication with JWT tokens
  • โœ… API key protection with environment variables
  • โœ… SQL injection prevention with parameterized queries

Database Relationships

profiles (1) โ”€โ”€โ”€โ”€ (*) transactions
    โ”‚
    โ”œโ”€โ”€โ”€โ”€ (*) categories
    โ”‚         โ””โ”€โ”€โ”€โ”€ (*) category_budgets
    โ”‚
    โ”œโ”€โ”€โ”€โ”€ (*) savings_goals
    โ”‚
    โ”œโ”€โ”€โ”€โ”€ (1) user_settings
    โ”‚
    โ”œโ”€โ”€โ”€โ”€ (*) recurring_transactions
    โ”‚
    โ””โ”€โ”€โ”€โ”€ (*) notifications

For complete database documentation, see docs/database/

๐Ÿ“– Features Breakdown

Dashboard Page (/dashboard)

  • Quick Stats Cards: Balance, Income, Expenses, Transaction count
  • Income vs Expenses Chart: 6-month bar chart comparison
  • Category Breakdown: Pie chart showing spending by category
  • Balance Trend: Line chart tracking balance over time
  • Monthly Breakdown: Card view of monthly summaries
  • Spending Alerts: Budget overspending warnings
  • Notification Widget: Recent notifications summary
  • Time Period Filter: Quick filters (7d, 30d, 90d, 1y, all)

Income Page (/income)

  • Add new income transactions with date picker
  • View all income in a responsive table
  • Edit/delete existing income entries
  • Category filtering
  • Search functionality
  • Export to CSV
  • Real-time balance updates

Expenses Page (/expenses)

  • Add new expense transactions
  • View all expenses in a table
  • Edit/delete expense entries
  • Category filtering and search
  • Export to CSV
  • Budget comparison per category

Categories Page (/categories)

  • Create custom income/expense categories
  • Color picker for visual organization
  • Edit category names and colors
  • Delete unused categories
  • View category usage statistics
  • Budget limit assignment

Notifications Page (/notifications)

  • View all system notifications
  • Mark notifications as read/unread
  • Filter by notification type
  • Clear notification history
  • Budget alerts and goal updates
  • Real-time notification updates

Settings Page (/settings)

  • Profile Section: Update name and email
  • Opening Balance: Set initial account balance
  • Savings Goals: Create and track financial goals
  • Category Budgets: Set spending limits
  • Data Management:
    • Export all data as JSON backup
    • Import previously exported backup
    • CSV export for transactions
  • Account Actions: Change password, sign out
  • Notification Settings: Configure alert preferences

๐Ÿงช Testing

Run the test suite:

# Run all tests
npm test

# Run tests with UI
npm run test:ui

# Run tests with coverage
npm run test:coverage

# Run tests once (CI mode)
npm run test:run

Testing stack:

  • Vitest - Fast unit test runner
  • React Testing Library - Component testing
  • jsdom - DOM simulation
  • @testing-library/user-event - User interaction testing

๐Ÿ”ง Available Scripts

Command Description
npm run dev Start development server on port 3000
npm run build Build for production (TypeScript + Vite)
npm run preview Preview production build locally
npm run lint Run ESLint on the codebase
npm test Run Vitest tests in watch mode
npm run test:ui Run tests with Vitest UI
npm run test:coverage Generate test coverage report
npm run test:run Run tests once (CI mode)

๐Ÿš€ Deployment

Deploy to Vercel (Recommended)

  1. Push your code to GitHub
  2. Import repository in Vercel
  3. Configure build settings:
    • Framework Preset: Vite
    • Build Command: npm run build
    • Output Directory: dist
  4. Add environment variables:
    • VITE_SUPABASE_URL
    • VITE_SUPABASE_ANON_KEY
  5. Deploy! ๐Ÿš€

The vercel.json file is already configured for SPA routing.

For detailed instructions, see Vercel Deployment Guide

Other Deployment Options

  • Netlify: Works out of the box with Vite
  • Cloudflare Pages: Fast global CDN
  • AWS Amplify: AWS-hosted solution
  • GitHub Pages: Free hosting for public repos

๐Ÿ“š Documentation

Quick Links

Additional Resources

๐ŸŽจ Customization

Theme Customization

Edit src/index.css to customize colors:

:root {
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --primary: 221.2 83.2% 53.3%;
  /* ... more variables */
}

Component Styling

All UI components are in src/components/ui/ and can be customized individually.

Adding New Features

  1. Create page component in src/pages/
  2. Add route in src/App.tsx
  3. Add navigation item in src/components/sidebar.tsx
  4. Add any database migrations in docs/database/

๐Ÿค Contributing

Contributions are welcome! Please follow these steps:

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

Please ensure:

  • Code follows TypeScript and ESLint rules
  • All tests pass (npm test)
  • New features include tests
  • Documentation is updated

๐Ÿ› Known Issues

  • Chart labels may show TypeScript warnings (Recharts typing limitation)
  • Export utility has some any types (can be improved)
  • PWA may require manual refresh after updates

These are non-blocking and don't affect functionality.

๐Ÿ”ฎ Roadmap

Planned Features

  • Recurring Transactions: Automatic transaction generation
  • Advanced Filtering: Multi-criteria search and filtering
  • Budget Forecasting: Predict future spending patterns
  • Receipt Upload: Attach images to transactions
  • Multi-Currency: Support for multiple currencies
  • Bank Integration: Connect to bank accounts via Plaid
  • Shared Budgets: Family/team budget sharing
  • Mobile App: React Native mobile application
  • Reports & Insights: Advanced analytics and reports
  • Tax Categorization: Expense categorization for taxes

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

You are free to:

  • โœ… Use commercially
  • โœ… Modify
  • โœ… Distribute
  • โœ… Private use

๐Ÿ™ Acknowledgments

Built with amazing open-source technologies:

๐Ÿ“ž Support

Need help? Here's how to get support:

  1. ๐Ÿ“– Check the documentation in the /docs folder
  2. ๐Ÿ› Open an issue on GitHub Issues
  3. ๐Ÿ’ฌ Start a discussion on GitHub Discussions

๐Ÿ“Š Project Stats

  • Version: 1.0.0
  • Status: โœ… Production Ready
  • Last Updated: October 29, 2025
  • Language: TypeScript
  • License: MIT

Built with โค๏ธ using Vite, React 19, TypeScript, and Supabase

Report Bug ยท Request Feature ยท Documentation