FairShare is a modern, high-performance web utility designed to help couples determine a fair and proportionate way to split household expenses. By moving beyond the standard 50/50 split—which can be inequitable when salaries differ significantly—this tool calculates contributions based on each partner's relative earning power.
- 🌟 Project Overview
- 🏗️ Technical Architecture
- 📁 Project Structure
- 🚀 Installation
- 📖 Usage
- 🤝 Contribution
- 🙌 Acknowledgments
FairShare automates household budgeting by establishing a contribution ratio based on relative income. It ensures both partners retain a fair share of disposable income, removing financial friction.
- 🧠 Smart Ratio Calculation: Automatically estimates net monthly take-home pay (after tax and NI) to ensure contribution ratios are truly fair.
- 🌗 Dark Mode & Themes: Fully themed UI with native support for system preferences and manual overrides.
- 📊 Detailed Roadmap: Generates a final report separating Initial Upfront Costs from Ongoing Monthly Shares.
- 🌐 Real-World Data: Fetches estimated property values via the UK Land Registry SPARQL endpoint.
- ⚡ PWA Ready: Fully installable on iOS and Android with offline functionality.
- ♿ Accessibility First: Strictly WCAG 2.1 AA compliant with legible typography and keyboard navigation.
FairShare is built using a Decoupled Modular Design powered by ES6 modules. This architecture ensures high maintainability and testability without the overhead of a framework.
- Reactive State (Proxy Pattern): State in
State.jsis wrapped in a Javascript Proxy, triggering UI renders andlocalStoragesync automatically. - Pure Functional Logic: All financial logic in
FinanceEngine.jsconsists of side-effect-free pure functions. - Specialized Controllers:
NavigationController: Manages hash-based routing and keyboard navigation.FormController: Handles input life-cycles and real-time validation.UIManager: Orchestrates BEM-compliant DOM updates.
fairshare/
├── src/ # Application Source
│ ├── core/ # Business Logic & State
│ ├── services/ # External API Integrations
│ ├── ui/ # View Orchestration
│ └── utils/ # Formatting & Helpers
├── scripts/ # Build & Automation Utilities
├── cypress/ # E2E & A11y Tests
├── unit/ # Logic Unit Tests
├── icons/ # SVG Asset Library
├── style.css # Modern CSS (Nesting, Variables)
└── index.html # Application Entry Point
- Node.js (v18 or higher recommended)
- Clone the repository:
git clone https://github.com/DrizzlyOwl/FairShare.git cd FairShare - Install dependencies:
npm install
npm startThe application will be available at http://localhost:8080.
This project uses an automated build stamp utility. Before pushing any changes:
npm run bumpThis automatically increments the build version, updates the GMT footer timestamp, and refreshes asset cache busters.
FairShare maintains high quality through comprehensive testing:
npm test- Unit Tests:
npm run test:unit - Cypress E2E:
npm run test:cypress - Accessibility (WCAG):
npm run test:a11y
To generate a local HTML coverage report:
npm run test:coverageThe report will be available in the coverage/ directory.
Contributions are welcome! Please follow these guidelines:
- BEM Naming: Ensure all changes adhere to the Block-Element-Modifier convention.
- A11y: Maintain WCAG 2.1 AA compliance (validated via
npm run test:a11y). - Docs: All new functions must include DocBlock style comments.
- Validation: Execute
npm run bumpbefore pushing to ensure version integrity.
Special thanks to the following users for their invaluable help with testing, bug reporting, and feature suggestions:
- dynamictulip
- yndajas
- @greenfingeredgec
This project is licensed under the Apache License, Version 2.0.
Vibe coded by Ash Davies (DrizzlyOwl) and Gemini.
This project is co-piloted and maintained by Gemini CLI, an interactive autonomous agent powered by Google Gemini 2.0 models.
Agent Capabilities & Facts:
- Autonomous Lifecycle: Gemini CLI manages the entire development lifecycle—Research, Strategy, and Execution.
- Surgical Refactoring: The agent performs precise code modifications while strictly adhering to architectural mandates.
- Validation Focused: It prioritizes empirical reproduction of issues and validates every change through automated test suites.
- Project Context Awareness: Operates with deep understanding of local project standards and engineering constraints.