Building KidsCare: a kindergarten platform that works when the Wi-Fi doesn't
How I built KidsCare, a multi-tenant kindergarten platform with a Laravel API and a Next.js front end, and the design decisions behind tenancy, privacy and offline care logging.
5 min read

A kindergarten educator's day is a stream of small facts: who ate their lunch, who napped and for how long, whose temperature is a little high, which parent called to say their child is staying home. Most of it still ends up on paper, in a group chat, or in someone's memory at pick-up time.
KidsCare is my attempt to fix that. It's a multi-tenant platform for kindergartens and preschools (ages 3–6) built as two projects: kids-care-api, a Laravel 13 / PHP 8.5 API, and kids-care-web, a Next.js 16 front end. This post walks through what it does and the decisions I'm most happy with.
One product, five very different users
The hardest part of KidsCare isn't any single screen. It's that five kinds of people use it, and each one needs to see a different slice of the same child:
- Educators log daily care for the classrooms they're assigned to, ideally in seconds on a phone
- Nurses keep health profiles, allergies and health checks across the whole kindergarten, and acknowledge abnormal temperature alerts
- Families see a friendly, non-medical view of their own child: an allowlisted timeline, opt-in photos, absence notices and requests
- Directors run the kindergarten: classrooms, staff, reports, compliance exports and billing
- Platform admins provision kindergartens, plans and invoices
The guiding principle I wrote at the top of the plan was simple: reduce educator typing while keeping every record attributable and keeping families informed. Almost every technical decision below comes back to one of those three things.

The API: tenancy you can't forget to check
Every kindergarten is a tenant, and a user can belong to several. In a product that holds children's health data, "oops, a query forgot its where facility_id = ?" isn't an option, so isolation is enforced in layers rather than trusted to discipline:
- Policies, not UI checks. Every rule (an educator only sees children in classrooms they're actively assigned to; a parent only sees actively linked children) lives in a Laravel Policy. The front end hides buttons for convenience, never for security.
- Scoped route bindings. Nested routes use scopeBindings() or explicit facility checks, and a cross-tenant mismatch returns 404, not 403, so the API doesn't even confirm a record exists.
- The database agrees. Child-related tables use composite foreign keys like ['facility_id', 'child_id'], so a row physically can't point at a child in another kindergarten.
The rest of the structure is deliberately boring: FormRequests validate input, focused Action classes run multi-step workflows inside short transactions, and JsonResources act as strict allowlists for what leaves the server. Audit logs and child history are written explicitly in the same transaction as the change, never hidden in model observers, so you can read a single Action and know everything it does.
Idempotency: the same lunch, logged once
Kindergartens have patchy Wi-Fi, and educators tap "Save" again when nothing seems to happen. So every write that can be retried takes an idempotency_key, a UUID the client generates once per action.
On the server, the Action does a firstOrCreate on that key, catches the unique-constraint race if two requests land at once, and then compares the payload. Same key and same data: you get back the original record. Same key and different data: 409 Conflict, because that's a bug, not a retry. Notifications to parents are only dispatched when the record was genuinely created, so a retried meal log never sends a parent two pushes.
The web app: the browser never talks to the API
kids-care-web uses a backend-for-frontend pattern. The browser only ever talks to the Next.js app; a catch-all route handler forwards requests to Laravel and attaches the Sanctum token from an httpOnly cookie. The token never reaches JavaScript.
That proxy is small, but it's where a lot of the hardening lives: it validates path segments, rejects cross-origin mutations, adds correlation IDs for tracing a request end to end, and times out slow upstream calls cleanly. On top of that, proxy.ts sets a per-request CSP nonce, and the signed-in app keeps connect-src 'self'. Third-party analytics only load on the public marketing pages, and only with consent.

Offline care logging, without leaking data
This is the feature I'm proudest of. When the connection drops mid-shift, six kinds of writes (care events and their corrections, health checks, incidents, family requests and absence notices) keep working. Instead of building a separate sync engine, the outbox is just TanStack Query mutations: they pause while offline and replay in order on reconnect. Because each queued write carries its idempotency key, replaying is always safe.
Persisting those writes, though, means storing children's health data on a shared tablet. So the durable outbox is encrypted:
BFF derives a per-user key (HKDF, server secret)
→ browser imports it as a non-extractable AES-GCM CryptoKey
→ IndexedDB stores only ciphertext, with a 12-hour TTL (one shift)
→ logout or a user switch wipes the storeA lost device or a logged-out tab can't read what was queued, and a write only replays if the same user and facility are still signed in.
Keeping two repos honest
With two repositories, the classic failure is the front end drifting from the API. KidsCare treats the contract as a build artifact. The API exports an OpenAPI 3.1 spec with php artisan api:export-openapi, and the web app generates its TypeScript types from it with pnpm api:sync. Both sides have a --check mode and a test, so a route or enum change that isn't synced fails CI instead of failing in a classroom.
Beyond daily care
Once the foundations were solid, the rest of the product could be built on top of them: a classroom care board and shift handovers between educators, an emergency transfer packet for a child, seven operational reports with async CSV/PDF exports, audited downloads for every document and photo, generic email notifications that never include health details, and per-enrolled-child B2B billing with invoices and a platform console.
What I'd tell myself at the start
- Write the access matrix first. A one-page table of who can do what saved me from re-deciding the same question in every controller.
- Make retries boring. Idempotency keys turned "what if this gets sent twice?" from a scary question into a non-event, and they made offline mode almost free.
- Put privacy in the architecture, not the copy. The BFF, the encrypted outbox and the 404-on-mismatch rule protect children's data even when someone makes a mistake.
KidsCare's V1 is built; the next step is a pilot with a real kindergarten, walking through an actual educator's day to check the assumptions against reality. If you run or work at a kindergarten and want to be part of that, or you'd like to talk about building something similar, I'd love to hear from you.
Want something like this built? Let's talk.
Keep reading

2 December 2026
Building CareCircle: care-home software where a double-tap can't double a dose
How I built CareCircle, a multi-tenant elderly-care platform with a Laravel API and a Next.js front end, and the design decisions behind medication rounds, family updates, offline shifts and pilot readiness.

2 December 2026
What I learned shipping my portfolio
Rebuilding raducea.eu: a design that shows the craft instead of describing it, moving from Slice Machine to the Prismic CLI, and why the content mattered more than the code.
1 December 2026
Why this portfolio runs on Prismic
How I use Prismic and Next.js to keep content out of the code, and how I publish posts straight from Markdown files.