Developments

Hulog: A Free Paluwagan Planner With a Fair Bunutan Draw and Hulog Tracker

Efraim Ray Efraim Ray 0 Comments
Web App Showcase

Almost every office, market and barangay in the Philippines has a paluwagan: everyone pays the same hulog every payday, and one member takes home the whole pot each round. It usually lives in one organizer's notebook and a very long group chat. I built Hulog Paluwagan Planner, a free web app that turns it into a clear payout schedule, a fair draw anyone can check, and a tracker that shows who has paid.

It runs entirely in the browser with plain HTML, CSS and JavaScript: no account, no server and no framework. It handles kinsenas at katapusan paydays, members with two ulo (slots), Sunday payouts, an optional organizer fee, and it works offline once opened.

Type Web App (PWA)
Stack HTML / CSS / Vanilla JS
Frontend No framework, offline
Version v1.0.0
License Free · MIT
Hulog Paluwagan Planner web app showing the next payout, a collection meter and a hulog tracker grid

Try It: Draw the Order and Mark the Hulog

This is a small slice of the app with a sample five-member group. Tap the boxes in round 1 to mark payments and watch the collection meter move, or type any seed and press Draw to run the bunutan.

efraimray.github.io/hulog-paluwagan/

Next payout

Ate Liza

Loading…

₱2,500

—

Bunutan · seeded draw

    Sample group: 5 members, ₱500 hulog every kinsenas at katapusan. Tap boxes to mark hulog, draw with any seed (same seed, same order). Gold ring = that member's payout round.

    Build Footprint & Quality Checks

    Group organizers open this on budget phones and patchy mobile data, so I kept it small and tested it in a real browser. These are the measured numbers from the v1.0.0 build:

    16.5
    JavaScript
    KB gzipped
    4.6
    CSS
    KB gzipped
    12
    Unit Tests
    node --test: 12/12
    44
    Browser Checks
    Playwright: 44/44

    Technology Stack & Architecture Layers

    Languages

    JavaScript, CSS, HTML

    JavaScript 76% of the code (logic, interface, tests), CSS 16% (design tokens, light and dark themes), HTML 6% (page structure).

    Core Logic

    Pure, Testable Engine

    One file with no DOM code builds the payout dates, schedule, draw, totals, CSV and safe import. The same file runs in the browser and in Node.

    Browser APIs

    Storage, Clipboard, Offline

    localStorage for groups, the Clipboard API for the chat summary, Intl for Manila time, and a service worker so it opens without signal.

    Testing

    node:test + Playwright

    Unit tests cover leap years, short months, Sundays, fees and bad backups. Browser tests run every tab at 1280px and 390px in light and dark.

    Key Architectural Decisions

    Pillar 01

    A Draw Anyone Can Check

    The bunutan hashes a seed word and uses it to drive a Fisher-Yates shuffle. Same seed, same order, so no one has to trust the organizer's phone.

    Pillar 02

    Centavos and Plain Dates

    Money is stored as whole centavos and dates as YYYY-MM-DD text computed in UTC, so rounding errors and timezones can never move a payout.

    Pillar 03

    Logic Apart From Screen

    hulog-core.js calculates; hulog-app.js only renders and listens. Every rule is covered by a unit test that runs in under a second.

    Pillar 04

    Private and Defensive

    No server at all. Names are escaped before display, restored backups are validated field by field, and CSV cells are guarded against spreadsheet formula injection.

    Paydays, the Fair Draw & Safe Export

    Three real excerpts from js/hulog-core.js: how the payout calendar is built, how the seeded bunutan works, and how CSV cells are made safe for Excel.

    // js/hulog-core.js
    /**
     * Build the list of payout dates.
     * @param {string} start  first possible payout date (YYYY-MM-DD)
     * @param {string} freq   weekly | biweekly | semimonthly | monthly
     * @param {number} count  number of rounds
     * @param {string} sundayRule 'none' or 'monday' (move Sunday payouts to Monday)
     */
    function payoutDates(start, freq, count, sundayRule) {
      var out = [];
      var i, d;
      if (!isYmd(start) || count < 1) return out;
      if (freq === 'weekly' || freq === 'biweekly') {
        var step = freq === 'weekly' ? 7 : 14;
        for (i = 0; i < count; i++) out.push(addDays(start, i * step));
      } else if (freq === 'semimonthly') {
        d = nextSemimonthly(start);
        for (i = 0; i < count; i++) {
          out.push(d);
          d = nextSemimonthly(addDays(d, 1));
        }
      } else {
        // monthly: same day as the start, clamped to short months (Jan 31 -> Feb 28 -> Mar 31)
        var s = parseYmd(start);
        var y = s.getUTCFullYear(), m = s.getUTCMonth(), day = s.getUTCDate();
        for (i = 0; i < count; i++) {
          var mm = m + i;
          var yy = y + Math.floor(mm / 12);
          mm = mm % 12;
          out.push(toYmd(new Date(Date.UTC(yy, mm, Math.min(day, daysInMonth(yy, mm))))));
        }
      }
      if (sundayRule === 'monday') {
        out = out.map(function (x) { return weekday(x) === 0 ? addDays(x, 1) : x; });
      }
      return out;
    }
    // js/hulog-core.js: the bunutan (seeded, repeatable shuffle)
    function hashSeed(str) {
      // FNV-1a 32-bit
      var h = 0x811c9dc5;
      var s = String(str);
      for (var i = 0; i < s.length; i++) {
        h ^= s.charCodeAt(i);
        h = Math.imul(h, 0x01000193) >>> 0;
      }
      return h >>> 0;
    }
    
    function drawOrder(group, seed) {
      var slots = [];
      group.members.forEach(function (m) { for (var i = 0; i < m.hands; i++) slots.push(m.id); });
      var rand = mulberry32(hashSeed(seed));
      for (var i = slots.length - 1; i > 0; i--) {
        var j = Math.floor(rand() * (i + 1));
        var t = slots[i]; slots[i] = slots[j]; slots[j] = t;
      }
      return slots;
    }
    // js/hulog-core.js: safe CSV export
    function csvCell(v) {
      var s = String(v == null ? '' : v);
      // Stop spreadsheet formula injection (=, +, -, @ at the start).
      if (/^[=+\-@\t\r]/.test(s)) s = "'" + s;
      if (/[",\n\r]/.test(s)) s = '"' + s.replace(/"/g, '""') + '"';
      return s;
    }

    Development Roadmap & Milestones

    Version 1.0.0 is released. The next milestones come from the project's roadmap:

    1

    v1.0.0: Core Planner (Released)

    Four payout frequencies, multiple ulo, seeded bunutan, hulog tracker, per-member totals, organizer fee, chat summary, CSV, backup and offline support.

    2

    Next: Partial Payments & Reminders

    Record half payments and advance payments, and copy a friendly reminder for each member who still owes hulog.

    3

    Planned: Read-Only Share Link

    A link the organizer can post in the group chat so every member can see the schedule and tracker without editing it.

    4

    Planned: Filipino & Cebuano Interface

    A language switch so organizers in Bukidnon and across Mindanao can use the app in the words their members use.

    User Interface & Feature Showcase

    1Tue, Sep 15Ate LizaPaid out
    2Wed, Sep 30Kuya JunPaid out
    3Thu, Oct 15MaeLate hulog
    4Sat, Oct 31GraceCollecting
    5Mon, Nov 16RodelUpcoming
    Schedule

    Every Payday, Every Recipient

    Kinsenas at katapusan dates with a Sunday-to-Monday rule and a clear status per round.

    R1R2R3R4R5 Ate Liza Bong Grace Rodel
    Hulog Tracker

    Tap to Mark, Red When Late

    Green is paid, red is late after the payout date, and gold marks each member's own payout round.

    PALUWAGAN: Barkada sa Opisina
    Hulog: ₱1,000 per ulo
    Pot per round: ₱10,000
    
    [x] 1. Sep 15 - Ate Liza
    [x] 2. Sep 30 - Kuya Jun
    [!] 3. Oct 15 - Mae
    [>] 4. Oct 31 - Grace
    
    Waiting for hulog from: Rodel, Bong
    Share

    Ready for the Group Chat

    One tap copies a Messenger-ready summary; CSV and JSON backup are one more tap away.

    Project Links, Code & Documentation

    Open the Live App

    Use it right now in your browser with the sample group, then create your own. Add it to your home screen to use it offline.

    Launch the Planner

    GitHub Repository

    Browse the source, download the v1.0.0 release, open an issue or suggest a feature. Free and open source under the MIT License.

    View on GitHub

    How It Was Built

    A plain-language build log: the languages used, every step in order, the test results and the problems fixed along the way.

    Read the Build Log
    Engineering Takeaway

    A Filipino Habit, Made Clear and Fair

    A paluwagan runs on trust. Hulog backs that trust with a schedule everyone can see, a draw anyone can re-check and a tracker that shows exactly who has paid. Want a version branded for your cooperative, office or school, or a custom tool built around how your group works?

    Frequently Asked Questions

    Is Hulog Paluwagan Planner free to use?

    Yes. It is free and open source under the MIT License, so you can use it, change it and use it for client work.

    Do I need to install anything or create an account?

    No. It runs in any modern browser on a phone or computer, with no sign-up and no server. You can open the live demo, add it to your home screen, or host the files on GitHub Pages or any web hosting.

    Is our group's data uploaded anywhere?

    No. Names and payments are saved only in the browser on the device you use, and nothing is sent to a server. Save a backup from the Share & backup tab before clearing your browser or changing phones.

    How does the bunutan (draw lots) stay fair?

    The group agrees on a seed word, such as the date and the group name, and the app shuffles the payout order from that seed. The same seed always gives the same order, so any member can enter it and check the result.

    Can one member hold two slots, and does it support kinsenas at katapusan?

    Yes. A member can hold up to five ulo and pays and receives once per ulo. Payouts can be weekly, every two weeks, on the 15th and last day of the month, or monthly, and Sunday payouts can move to Monday.

    Can you set this up for my business website?

    Yes. I can install it on your website or domain, brand it for your cooperative, office or community group, and add features such as payment reminders. Contact me here.

    The sample groups and member names in the demo are fictional. Hulog is a planning tool: it does not hold, collect or move money.

    Efraim Ray
    Written by

    Efraim Ray

    Software Developer and AI Specialist. BS Information Technology graduate. I pride myself on being conscientious, attentive to detail, and always open to learning — because the best solutions come from listening, taking notes, and exploring what's next.

    Comments