Inspiration

After a disaster, relief NGOs move money fast and under pressure. Months later, auditors, boards and grant makers ask the same questions: who approved this payment, on what evidence, and which appeal did the money come from? Too often the answer lives in spreadsheets, inboxes and someone's memory.

We wanted those answers to be built into how the money is recorded, so that an NGO running relief funds on PayPal is audit-ready by default. That became ClearAid: every relief dollar, accounted for.

What it does

ClearAid is a financial-controls (governance, risk and compliance) tool for NGOs running disaster-relief funds on PayPal. It traces every dollar from its source (PayPal gifts, bank transfers, grants), to the fund it belongs to, to the payee it went to, and keeps the evidence attached.

  • Tracing with tracking codes. Each fund has codes such as #ASHA-MED. PayPal gifts and bank lines that carry one are traced automatically. Everything else waits in a single Untagged queue with the reason.
  • AI-audited payments. A local AI model reads each receipt and checks delivery photos. Fixed rules catch reused receipts, reused photos, photos taken before the crisis, over-priced units and budget breaches. They also flag photos taken far from the affected area.
  • No one moves money alone. Only people assigned to a fund can sign its payments, and large ones need two different approvers. Payouts go only to verified payees, through PayPal Payouts.
  • Tamper-evident records. Each fund's ledger and the NGO-wide audit log are SHA-256 hash chains that can be re-verified in the browser.
  • Privacy by design. All AI runs locally, so no donor, beneficiary or bank data goes to a cloud AI service. Bank statement lines are anonymised by fixed rules before they are stored.
  • Controlled publishing. Nothing is public by default. An admin picks, block by block, what a public embed shows.
  • Copilot. Staff ask in plain language where money came from and went. A local Llama 3.1 model answers from the records and cites them, and it only searches the funds that person may see.

How we built it

  • Frontend: Next.js 16, React 19 and Tailwind 4, with AG Grid and AG Charts for the ledger, transactions and money-flow views.
  • Backend: Hono on Node 22 with TypeScript and Zod. It holds every business rule, both hash chains, sign-in, and the PayPal and Plaid integrations.
  • PayPal: JavaScript SDK buttons and Orders v2 for donations, Payouts for approved payments, capture refunds for returning leftover money, signature-verified webhooks, Partner Referrals for connecting an NGO's account, and Transaction Search for reconciliation.
  • Banks: CSV statement upload or Plaid.
  • AI: Ollama running llama3.1:8b, llava for photos and nomic-embed-text for search, plus a small Python service for FAISS search and OCR. The AI recommends and people decide: a failed rule check can never be auto-approved.
  • Storage: a JSON-file datastore for the hackathon build, behind a single data layer so it can be swapped for Postgres.

Each ledger entry stores the hash of the one before it:

$$h_n = \mathrm{SHA256}\left(\text{entry}n \,|\, h{n-1}\right)$$

Changing any past entry breaks every hash after it.

When a fund closes with money left over, donors who asked for their share back receive:

$$\text{return}_i = \text{leftover} \times \frac{\text{gifts}_i}{\text{raised}}$$

Challenges we ran into

  • Exact money math. Splitting payments and leftovers across donors has to add up to the cent. We keep all amounts as whole cents and distribute rounding remainders so the parts always sum to the total.
  • Not counting money twice. PayPal gifts later arrive in the bank as transfers, and a payment recorded from a receipt later appears as a bank line. Both have to be matched, not added again.
  • Useful AI without the cloud. Small local models are less capable, so we constrain their output to a fixed format, validate it, and back every AI feature with deterministic rules and a non-AI fallback.
  • Anonymising bank statements. Telling a person's name from a business name in free text is hard to do by rules alone, and ours still misses some cases.
  • Publishing safely. The public embed is built only from the blocks an admin switched on, so donor names, staff names and bank references can't leak through it.
  • PayPal's limits on partner access. When an NGO connects its own PayPal account, PayPal lets ClearAid take payments and refund but not send payouts from that account. Returns by payout from those accounts are flagged for the NGO to do by hand.

What we learned

  • Controls work best when they are part of the workflow, not a report written afterwards.
  • AI is most trustworthy as an adviser beside fixed rules and human sign-off, not as the decision-maker.
  • Privacy shapes architecture: choosing local AI changed how we built almost every feature.
  • PayPal's APIs cover the whole money journey, from donation to payout to refund, which let us keep one traceable record end to end.

What's next for ClearAid

  • PayPal Multiparty with delayed disbursement, so money stays with PayPal until an approved payment releases it.
  • An approvals inbox, and a vendor portal where payees submit their own requests with receipts and photos. Today an admin registers and verifies vendors.
  • Donor choice on closing a fund: a refund or carrying their share forward. Fund-level carry-forward already works.
  • Single sign-on, multi-factor authentication, and a production database (Postgres).

Built With

Share this project:

Updates

Submission history