Coursework case study

Nīkau

Activity matching for disability support workers, built with Jove Tondo

A web app that helps New Zealand disability support workers and coordinators find community activities for their clients. An AI service ranks activities from a checked catalogue and explains each one in plain language. The worker makes the decision.

Deployed MVP, November 2026. The live app is behind a staff login, so this page shows it instead.

View code on GitHub (opens in new tab)
Frontend React, TypeScript, Vite
Services Two FastAPI services: Core API and AI matching
Data and auth Supabase (PostgreSQL), row-level security
Model Gemini Flash-Lite, structured JSON output
Hosting Three Vercel projects, hosted Supabase
Testing pytest, SQL access-rule tests, GitHub Actions

Community participation is a standard goal in New Zealand disability support plans. In practice, finding suitable activities depends on what each support worker or coordinator already knows. The matching happens in their head, so it is limited to what they already know to look for. From experience in disability support, workers often do this research in unpaid time.

Activity recommenders do exist, but most are built for the end user rather than the person planning support. Few explain why they suggested something.

Nīkau compares a client's goals, interests and support needs against a catalogue of activities and returns a short list of leads to follow up.

  • Client profiles with goals, interests, and access and support needs
  • A shared activity catalogue, where an activity only shows once its provider has given consent
  • AI suggestions, each with why it fits, what it doesn't cover and what to ask the provider
  • Catalogue search as the fallback when matching is unavailable
  • Saved leads, and a matching log with CSV download for coordinators
  • Role-based access: workers see only the clients assigned to them, coordinators see their whole organisation

I built the AI matching service, the pre-filter that runs before it and the API contract between the two services. I also set up the repository, Supabase and Vercel. Jove built the database access rules and most of the screens.

Nīkau suggested activities page for a made-up client. A banner lists what was shared with the matching service and what was not: name, birth year, contact details and address. The first suggestion, Community kapa haka, says why it fits, notes that its high sensory load is above the client's limit, and suggests asking whether the hall is step-free.
A made-up client. The AI flags the sensory load instead of hiding it.

Unknown is not a fail. The pre-filter removes an activity only when both values are known and they clash, such as a physical demand above the client's limit. If either value is missing, the activity stays on the shortlist and the AI lists it as a question for the provider.

The AI sees as little as possible. Only allow-listed fields leave the platform. The model never sees the client's name, birth year or contact details. It gets an age band (child, youth or adult) instead of a birth year, and the AI service rejects any field it doesn't expect.

The reply is checked, not trusted. It has to match a JSON schema. My checks then drop any activity that wasn't on the shortlist, remove duplicates, renumber the ranks and cut each list to three lines. If Gemini fails fast with a 503, the service retries once, inside a 13 second budget that leaves room before the Core API stops waiting at 15 seconds.

"Nothing fits" is an allowed answer. A matcher that always suggests something can push a poor match onto a client. When nothing fits, the page says so and offers the catalogue.

Before building the service, I ran a spike: 40 calls to Gemini Flash-Lite with made-up clients, comparing two versions of the prompt.

Only 16 of the 40 calls got a reply. The rest failed with Google's "high demand" errors or ran past our time limit. Every reply that did arrive was valid JSON, and none named an activity that wasn't on the shortlist. Successful calls took a median of 4.0 seconds, but four took over 10.

So the output was reliable and the availability wasn't. That made the catalogue fallback a required path rather than a nice-to-have, and every failure is logged.

Does running matching as its own service help?

The live matching log recorded 25 requests between 9 and 18 November, all on made-up clients. After a setup fault on the first day, 18 of the 19 requests that reached the AI service succeeded. Successful requests took a median of 3.5 seconds, usually 2 to 4.5, and the slowest took 10.6. When the AI failed, the app showed the fallback and kept working. We also redeployed the AI service in Vercel without redeploying the Core API.

What we couldn't answer: the proposal planned to compare this with the same logic called directly inside the Core API. We ran out of time to build that path, so there is no baseline, and we can't say whether the separate service was faster or slower. The redeploy also used the same code, not a real change.

Nīkau matching log for the last 7 days: 21 requests, 17 succeeded (81%), median response time 4.0 seconds and fallback shown 4 times, above a table of requests, all called as a separate service, with response times from about 2 to 10.6 seconds.
The log stores timing and outcome only, with no client details.

Can workers trust and act on the explanations?

The plan was for support workers to review sample explanations. We lost access to them, so we reviewed the explanations ourselves against a checklist. We compared two versions of the prompt across five made-up clients, 30 runs in total, shuffled with the version labels removed. Claude did the first scoring pass, and I re-scored a sample and reviewed the judgement calls.

Version 3 made fewer false claims than version 2 (47 against 59). It was written for the worker in all 15 of its runs against 5, and raised the real unknown in 9 against 3. It was worse in one way: it leaked field names in 6 runs. Only one run of each version had no false claims. This tests accuracy, not whether workers trust the explanations.

A staff member couldn't be deleted. While reviewing Jove's pull request for the database rules, I ran tests against the migrations locally and one failed. Deleting a staff member clears the creator link on the clients they created, and a rule that stops anyone changing a client's creator blocked it. Staff who had left could never have been removed. I posted the failure with two fixes I had tested and left the choice to Jove. Jove combined them: the link can only be cleared, and only by the database as part of a delete. I re-tested it and it merged the same day.

My enums didn't match what we had agreed. While reviewing my API contract pull request, Jove found that my enum migration used different values from our agreed attribute list, such as "independent" where the list said "own". Jove fixed the migration before it merged, and we added a rule to the contract: the migrations are the source of truth.

Before I built the AI service, I thought AI would make matching easy. I hadn't expected how tightly privacy would limit what it could see. Reviewing the scored runs, I saw that even the better prompt still made false claims. The checks I built only test the form of an answer. They can't tell whether an explanation is true.

Next time I build with AI, I'll decide what it's allowed to see before I write the prompt. I'd also check earlier that the research plans fit the time we have, because we cut both of ours late.

  • Made-up data only. A real version would need a paid AI tier that doesn't train on prompts.
  • Built desktop first. The phone layout passed 20 of 22 checks on one Android phone, and no tablet was tested.
  • The explanations can contain small wording slips, like "step--free" in the screenshot above.
  • No support worker has reviewed the explanations yet.
  • Activities are entered by hand, so the catalogue grows slowly, and the details that decide a match are often not published anywhere.

The full report is available on request. Get in touch.