Technical Implementation

1. Event-Driven Architecture

Reactive UI

The application uses a strictly event-driven model to minimize CPU usage. Updates are triggered only when the user interacts with the application.

2. Manual URL Optimization

Custom Compression

To keep URLs short enough for messaging apps (which often have a 2,000-character limit), we use a multi-step optimization process:

3. Proportional Cost Logic

Mathematics

The splitting algorithm ensures that taxes and tips are shared fairly:

  1. Subtotal: Sums all base item costs.
  2. Global Modifiers: Applies the "Adder" (tax) and "Multiplier" (tip).
  3. Proportional Split: Each person's share of the tax and tip is calculated based on the ratio of their individual subtotal to the grand subtotal. This ensures that someone who ordered a $5 salad doesn't pay as much tax as someone who ordered a $50 steak.

4. Cache Management

Deployment

To ensure users always receive the latest feature updates and bug fixes, the application uses a versioned query string for its JavaScript inclusion (e.g., script.js?v=7). This forces the browser to bypass its local cache and fetch the newest logic.

Project Credits

This tool was modernized and optimized with the assistance of Gemini CLI ✨.