Inspiration
Food assistance needs to be usable where families can reach it. In the Philippines, sari-sari stores are small neighborhood shops that sell everyday essentials. They are a natural place to buy food, but they cannot accept a program's food credits unless they are approved redemption partners.
The Philippines already has food-credit programs. The DSWD implementation guidelines recognize retailer-access challenges in underserved areas. We focused on how a program could include neighborhood stores without requiring dedicated payment terminals or smartphones for every guardian.
That became BANTAYOG: a phone-based food-credit system with a printed pass for families and purchase records for program operators.
What it does
BANTAYOG helps Local Government Units and aid programs manage nutrition-restricted credits. The current prototype serves children and guardians in the First 1,000 Days program, which focuses on nutrition from conception through a child's first two years.
A guardian carries a printed QR Nutri-Pass. An approved merchant uses a smartphone to build a food basket, scan the pass, and accept the guardian's PIN. Gemini helps identify photographed products and estimate prices. The server checks purchases against the program's food rules.
PayPal supports two separate flows:
- Program funding. A funder contributes through PayPal sandbox checkout. The server verifies the completed capture and records the contribution, fee, and net amount. New grants require sufficient net funding.
- Store claims. A merchant requests payment for confirmed, unpaid sales. Server price checks and Gemini assist the review. A program officer approves the claim, and BANTAYOG creates and sends a PayPal invoice.
BANTAYOG marks an invoice paid only after checking its status with PayPal. In this prototype, that payment goes to the program account. The program must pay the store separately; a paid invoice does not prove the store received that transfer.
How we built it
We built the interface with Next.js, React, TypeScript, and Tailwind CSS. A separate Hono API handles business rules and PayPal calls. Supabase provides PostgreSQL and authentication, while Upstash Redis supports rate limits and PIN lockout.
Database transactions keep credit deductions, merchant balances, and receipts consistent. Database constraints prevent duplicate captures and repeat claims. Funding reservations prevent concurrent grant requests from using the same available contribution twice.
Google Gemini supports product recognition and claim summaries. It cannot change claim amounts, release a server-enforced hold, or approve payment. Those boundaries keep AI useful without giving it control of the funds.
Stellar testnet provides the ledger layer using a mock peso-denominated PHPC asset. It is not a live payment rail.
What changed since October 1
BANTAYOG existed before this hackathon. During the submission period, we added PayPal Orders v2 contributions, PayPal Invoicing v2, Gemini-assisted claim review, and an administrator funding ledger.
We also connected grant issuance to verified net contributions. Earlier demonstration credits did not require this funding check. New grants now reserve captured funding before issuance.
Challenges we ran into
The hardest part was deciding what counted as proof at each step. Returning from checkout does not prove payment. An approved order does not prove capture. A recorded sale does not prove that a store received cash.
Fees also affect how much funding can support credits. We therefore track gross contributions, fees, and net funding separately.
Retries created another challenge. A user can double-click, lose a connection, or return after a timeout. We designed repeat requests to recover the existing order, receipt, or claim rather than create another one. Unresolved grant attempts retain their funding reservation until an operator checks what happened.
Accomplishments we're proud of
We completed a local sandbox invoice test with real Gemini review. Gemini held a synthetic rice sale because it lacked a reference price. A test officer reviewed and released it, approved the claim, and sent the invoice. After a PHP 50.00 sandbox payment, BANTAYOG retrieved the paid status. A second claim could not reuse the sale.
We also completed a sandbox contribution and verified that concurrent capture retries returned the same receipt. The latest recorded checks passed 882 automated tests, including funding, payment, database, and interface tests.
What we learned
The funding balance, food-credit balance, invoice status, and store payout are different records. A useful system must show those differences clearly.
We also learned to give AI a specific role. Product recognition and review summaries can help people work through a purchase or claim. Payment approval and exact amounts need explicit rules and accountable operators.
What's next
Our next steps are to verify a successful funded grant on Stellar testnet, complete the remaining checkout-to-ledger integration, and test the workflow with prospective merchants and program operators.
The current build uses synthetic records, PayPal sandbox funds, and Stellar testnet. It does not connect to DSWD systems or accept existing EBT balances. Direct store payouts and fully offline checkout remain future work.
We want to test whether this approach can make food-credit redemption easier to access. We have not yet measured travel savings, merchant costs, or nutrition outcomes.
Built With
- fast-check
- google-gemini
- hono
- mobile
- next.js
- node.js
- paypal
- paypal-invoicing-api
- paypal-orders-api
- pnpm
- postgresql
- react
- serwist
- stellar
- supabase
- tailwind-css
- typescript
- upstash-redis
- vitest
- zod