Skip to content

mr-574rk/XpensFlow

Repository files navigation

πŸ’° XpensFlow β€” Smart, Secure & Insightful Personal Finance PWA

Offline-first. Encrypted. Intelligent. Beautiful.

XpensFlow is a next-generation progressive web app (PWA) that helps you track expenses, budgets, and insights β€” even without the internet.
Designed for privacy-first finance, it features zero-knowledge encryption, AI-powered insights, and a developer-grade debugging system.


πŸš€ Highlights

βœ… Offline-First: Works without internet using IndexedDB
βœ… AES-256 Encryption: Zero-knowledge encryption model
βœ… PWA: Installable as a native app
βœ… Voice Input: Add expenses by voice
βœ… Dark Mode: Automatic theme switching
βœ… Analytics: Interactive charts with Recharts
βœ… Budget Tracking: Set and monitor budgets
βœ… Financial Score: Gamified financial health insights
βœ… Export/Import: Backup and restore securely
βœ… Responsive: Works seamlessly across all devices


🧩 What We Built (12 New Files)

πŸ” Core Systems (Enterprise-Grade)

🧱 SecurityManager.js β€” Zero-Knowledge Encryption

  • PBKDF2 with 310k iterations
  • AES-GCM 256-bit encryption
  • SHA-256 integrity checksums
  • Auto-lock with configurable timeout
  • PIN strength validation
    (No plaintext data or keys ever leave the device.)

πŸ’Ύ DatabaseManager.js β€” Encrypted Vault

  • Encrypted IndexedDB wrapper
  • Versioned backups (keeps last 3)
  • Automatic cleanup and compaction
  • Storage usage tracking
  • Data restore functionality

🧠 IntelligenceEngine.js β€” Smart Insights

  • 9 types of financial insights
  • Statistical anomaly detection
  • Month-over-month comparison
  • Spending pattern recognition
  • Budget compliance tracking

🎨 Enhanced Components

File Description
ErrorBoundary.jsx Professional error handling and recovery UI
DebugOverlay.jsx Live developer console with performance metrics
InsightsDashboard.jsx Visualizes trends, anomalies, and savings
OnboardingWizard.jsx Intuitive 4-step user onboarding
KeyboardShortcutsHelp.jsx In-app modal listing available shortcuts

⚑ Power Features

File Description
useKeyboardShortcuts.js 15+ global shortcuts (Ctrl+K, Ctrl+D, etc.)
Integration Guide Detailed developer setup and usage guide
Docs Comprehensive documentation for all modules

πŸ’Ž Key Innovations

πŸ”’ Security (Bank-Grade)

  • Zero-knowledge encryption β€” only salt stored
  • PBKDF2 key derivation (310,000 iterations)
  • AES-GCM 256-bit encryption
  • SHA-256 integrity checksums
  • Auto-lock after inactivity
  • PIN validation (must include letters + numbers)

🧠 Intelligence (Smart as Hell)

  • Spending pattern detection using z-score analysis
  • Month-over-month comparisons
  • Anomaly detection for unusual spending
  • Budget compliance tracking
  • Spending rhythm analysis (best/worst days)
  • Savings potential calculator
  • Smart recommendations powered by statistical models

πŸ§‘β€πŸ’» Developer Experience

  • Real-time debug overlay with performance stats
  • Error boundary with persistent logs
  • 15+ keyboard shortcuts for power users
  • Performance & memory monitoring
  • Error tracking (last 10 exceptions)
  • Auto-lock after inactivity

πŸ› οΈ Tech Stack

Layer Technology
Frontend React + Vite + TailwindCSS
State Zustand / Redux Toolkit
Storage Encrypted IndexedDB
Encryption WebCrypto API (AES-GCM + PBKDF2)
Charts Recharts / Chart.js
PWA Service Workers + Manifest
Voice Input Web Speech API
Testing Vitest / React Testing Library

🧭 Architecture Overview

src/ β”œβ”€β”€ core/ β”‚ β”œβ”€β”€ SecurityManager.js β”‚ β”œβ”€β”€ DatabaseManager.js β”‚ └── IntelligenceEngine.js β”œβ”€β”€ components/ β”‚ β”œβ”€β”€ ErrorBoundary.jsx β”‚ β”œβ”€β”€ DebugOverlay.jsx β”‚ β”œβ”€β”€ InsightsDashboard.jsx β”‚ β”œβ”€β”€ OnboardingWizard.jsx β”‚ └── KeyboardShortcutsHelp.jsx β”œβ”€β”€ hooks/ β”‚ └── useKeyboardShortcuts.js β”œβ”€β”€ assets/ β”œβ”€β”€ pages/ └── utils/


🧠 How It Works

  1. Zero-Knowledge Encryption:

    • All user data is encrypted locally before storage.
    • Master key is derived from user PIN using PBKDF2 (310k iterations).
    • AES-GCM ensures both confidentiality and integrity.
  2. Smart Insights:

    • The IntelligenceEngine analyzes patterns, flags anomalies, and generates month-over-month analytics.
    • All insights run client-side for privacy.
  3. Offline-First Database:

    • The DatabaseManager uses an encrypted IndexedDB layer.
    • Keeps 3 rolling backups with versioning.
    • Tracks storage usage and cleans stale data.
  4. Auto-Lock:

    • App locks automatically after inactivity or when tab is hidden.
    • Requires PIN re-entry to decrypt data.

πŸ”§ Setup & Development

# Clone the repository
git clone https://github.com/mr-574rk/xpensflow.git

# Enter project directory
cd xpensflow

# Install dependencies
npm install

# Start development server
npm run dev
Then open http://localhost:5173 in your browser.

πŸ§ͺ Testing
bash
Copy code
npm run test
Unit tests for core modules (SecurityManager, DatabaseManager, IntelligenceEngine)

Integration tests for encryption and error boundaries

πŸ“¦ Build for Production
bash
Copy code
npm run build
npm run preview
πŸ›‘οΈ Security Principles
Zero-knowledge: No sensitive data leaves the user’s device.

Immutable backups: Each backup version is integrity-checked via SHA-256.

Strong encryption: AES-GCM 256-bit + PBKDF2 (310k iterations).

Auto-lock: Session timeout + tab visibility lock.

PIN rules: Enforced strength validation and entropy checks.

🧭 Roadmap
Stage	Features
βœ… v1.0	Core encryption, insights, charts
🚧 v1.1	Cloud sync (end-to-end encrypted)
πŸš€ v2.0	Shared budgets + collaborative finance
🌐 v3.0	AI-powered financial forecasting

πŸ§‘β€πŸ’Ό Contributing
We welcome PRs that:

Improve performance, security, or developer experience

Add new types of insights

Enhance accessibility or UX

Please run all tests and lint before submitting:

bash
Copy code
npm run lint && npm run test
🧾 License
This project is released under the MIT License.
See LICENSE for details.

πŸ’¬ Credits
Designed & Engineered by [Mr Stark]
πŸ“§ [gh0ztsurg3@gmail.com]
🌐 [mr574rk.dev]

πŸ’‘ β€œTrack smarter. Spend wiser. Stay secure β€” even offline.”

About

A progressive web app (PWA) that helps users track income, expenses, and budgets without depending on cloud storage.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors