Inspiration

UMKM in the culinary sector face silent, daily leaks in their bottom lines. During our research, we identified four major friction points:

1.Receipt Fraud & Record Friction: Recording shopping lists from traditional markets into kitchen books is tedious, slow, and highly vulnerable to price manipulation or missing receipts.

  1. Instinct-driven Procurement: Ingredient buying is often based on guesswork rather than empirical data. This leads to overstocking, which traps valuable business cash flow in rotting inventory.
  2. Invisible Food Waste Losses: Restaurant owners rarely know the exact rupiah amount ending up in the garbage bin. Without clear metrics, food waste remains a financial blind spot.
  3. Delayed Rescue Actions: When raw ingredients approach their expiration date, busy kitchen staff lack the time or authority to formulate rescue discounts or special menus, causing ingredients to rot.

What it does

Fresh Ledger is an intelligent, role-based stock management application tailored for local kitchens:

  1. Anti-Fraud Receipt Archiver: Staff must photograph physical receipts when logging new stock. The system records the entry and matches it against physical evidence to maintain a secure audit trail.
  2. Smart ML Procurement Forecaster: Using a historical dataset of ingredient consumption, the system runs a Machine Learning regression model to predict exact food quantities required for the upcoming month, preventing overstocking.
  3. Waste Index Dashboard: Visualizes spending vs. waste. Managers get an auto-calculating Waste Index (WI) with color-coded alerts (Green for efficient, Yellow for warnings, Red for critical waste losses) and can export fully audit-ready spreadsheets (.xlsx) in one click.
  4. AI Food Rescue Promo Recommender: When staff mark ingredients as expiring within 2 days, Google Gemini API analyzes the ingredients and restaurant menu to generate a discount promo draft (e.g., 15% off Beef Bowl). Managers can review and instantly activate these promos to salvage food and recover costs.

How we built it

We architected Fresh Ledger as a secure, fast, and light web application:

  1. Frontend: Built completely from scratch using Vanilla HTML5, CSS3, and JavaScript. We designed a crisp, custom dark-mode interface, dual-login panels (Manager vs. Staff), and highly responsive dashboard elements.
  2. Backend API: Built using Node.js (Express) handling authentication (JWT tokens), role-based endpoint protection (isManager), and receipt file handling using multer.
  3. Database: Powered by TiDB Cloud Serverless (MySQL) via SSL connection, ensuring our transaction logs, stock batches, and promo drafts are safely stored in a cloud environment.
  4. Machine Learning Predictor: Built as a serverless function in Python (Flask + Scikit-Learn) utilizing a RandomForestRegressor to estimate future ingredient quantities.
  5. AI Engine: Integrated Google Gemini API (gemini-2.5-flash) using the official @google/genai library to create dynamic, RAG-style recipes and discount suggestions.
  6. Deployment: Hosted on Vercel with a multi-runtime setup, seamlessly routing API requests between our Node.js controllers and our Python ML microservice.

Challenges we ran into

  1. Multi-Runtime Serverless Sync: Deploying both Python (for the Scikit-Learn ML engine) and Node.js (for the Express API) in a unified repository on Vercel required strict routing configurations and virtual environment setup.
  2. Cold Starts & Data Seeding: When validating ML predictions and displaying analytical graphs, a clean database looks empty. We overcame this by writing a comprehensive MySQL seeding script that generates 3 months of synthetic sales/usage history, enabling high-quality, real-time visual demos from the first minute.
  3. Permission Guardrails: Kitchen staff need a quick, distraction-free workflow. We separated permissions so staff can log entries and request AI promos, but only managers have the authorization to approve price changes or download business balance sheets.

Accomplishments that we're proud of

  1. Zero Heavy Frameworks on Frontend: Building a dynamic, role-restricted dashboard with settings menus and modals using raw Vanilla JS and CSS allowed us to achieve hyper-fast load times and custom aesthetics.
  2. Full-Stack ML/AI Integration: Successfully joining classical machine learning (Random Forest) with generative AI (Google Gemini) to solve a dual-layer optimization problem (buying the right amount, and rescuing what is left).
  3. Robust Seeding & Visuals: Crafting an automated mock database seeder that simulates believable kitchen supply logs, rendering gorgeous analytical dashboard charts for demo evaluations.

What we learned

  1. How to configure Vercel for complex Node.js + Python serverless microservice environments.
  2. The business value of turning raw LLM recommendations into actionable draft workflows (pending_approval state) rather than letting AI make automated decisions without manager supervision.
  3. Designing clean, modular REST APIs with middleware validations to prevent privilege escalation.

What's next for Fresh Ledger

OCR Receipt Scanner: Implementing Google Cloud Vision or a Gemini multimodal model to automatically read traditional grocery market invoices and auto-populate raw fields (item name, volume, price).

Share this project:

Updates