saldito vercel app_

Overview

Saldito is a web tool designed to help public transport users manage their travel funds more efficiently. Often, when topping up transport cards, users are left with small unusable amounts (“dead balance”) that aren’t enough for a full trip. This application allows users to input their ticket price and desired number of trips to automatically calculate the exact combination of recharge amounts (based on standard payment app options). It ensures the final balance is zero or as close to zero as possible, helping users maximize every cent loaded onto their cards.

Technical details

This project is a Single Page Application (SPA) built with React and TypeScript, leveraging Vite for fast build times and performance. The UI is responsive and minimalist, styled with Tailwind CSS and Lucide React icons. The core logic relies on a custom optimization algorithm (findBestRechargeStrategy) which employs a recursive search with pruning to solve a variation of the “Change-making problem” (or Knapsack problem). This algorithm evaluates multiple combinations of predefined recharge amounts to output two strategies: the absolute cheapest option and a “recommended” option that minimizes waste vs. locked capital. User preferences are persisted client-side using LocalStorage.