---
title: Tiny Solutions
description: Early Intervention case management
section: craft
tags: [project, production-healthcare]
genre: reference
stability: stable
lastUpdated: 2026-04-19
url: https://fardiniqbal.com/docs/craft/projects/tiny-solutions
---


Multi-tenant case management for NY Early Intervention agencies. A Rails
8.1 monolith that runs the intake, clinical, and billing pipeline for
pediatric therapy agencies coordinating developmental services for
children ages 0–3. Row-level tenant isolation, immutable audit trail,
Packwerk-enforced domain boundaries, 158 migrations under version
control.

## What it is [#what-it-is]

Agencies receiving Early Intervention referrals from NY municipalities
need to move a child from referral to evaluation to ongoing service
delivery to insurance claim inside a single system that keeps a clean
HIPAA audit trail. This app is that system.

The codebase is organized as concept-driven Rails —
`app/concepts/{ai, audit, billing, claim, client, compliance, evaluation,
export, lock, note, role, search, sharing, tenant}` — each with its own
`package.yml` Packwerk boundary. Every tenant-scoped query is scoped by
`agency_id` via `acts_as_tenant`. Every clinical write is versioned by
PaperTrail with field-level diffs. A Next.js rewrite of the same domain
is in progress in `tiny-solution-next`; this page covers the Rails
system that is the authoritative implementation today.

## By the numbers [#by-the-numbers]

| Metric                | Value                                   |
| --------------------- | --------------------------------------- |
| Rails version         | 8.1                                     |
| Ruby version          | 3.4                                     |
| Database migrations   | 158                                     |
| Packwerk domain packs | 14                                      |
| Multi-tenancy         | Row-level via `acts_as_tenant`          |
| Audit trail           | PaperTrail 17.x (immutable, per-tenant) |
| EDI formats           | X12 837P (claim) + 835 (remittance)     |
| Accessibility bar     | WCAG 2.1 AA (axe-core in system tests)  |
| Test framework        | Minitest + Capybara + Cuprite           |
| CI                    | Sharded across parallel runners         |

## Architecture [#architecture]

```
              Browser (Turbo + Stimulus + ViewComponent)
                              |
                       Rails 8.1 monolith
                              |
  app/concepts/
    ai/           AI-assisted clinical note quality (AWS Bedrock)
    audit/        PaperTrail wiring, audit read models
    billing/      Rate tables, fee schedules
    claim/        EDI 837P generation, 835 remittance reconciliation
    client/       Child, guardian, sibling, demographics
    compliance/   Consent, state-mandated forms, expirations
    evaluation/   Initial / ongoing evaluation workflows
    export/       Report generation (xlsx, PDF)
    lock/         Record locking, edit coordination
    note/         Session notes, AASM state machine
    role/         Custom roles, per-user permission overrides
    search/       OmniSearch: PostgreSQL full-text across tenants
    sharing/      Cross-agency data sharing contracts
    tenant/       Agency context, multi-agency switching
                              |
           Packwerk check (boundary enforcement in CI)
                              |
        PostgreSQL (Neon, us-east-1) — single data plane
                              |
       Solid Queue / Solid Cache / Solid Cable on Postgres
                     (no Redis dependency)
```

Each pack declares its boundary in `package.yml`. Cross-pack calls go
through public APIs. `packwerk check` runs in CI. PaperTrail records
immutable versions with field-level `object_changes` on every clinical
mutation, scoped per-tenant, never deleted.

## Key features [#key-features]

* **Kanban intake pipeline** — referral staging with drag-through
  workflow from initial intake to active case.
* **Child records with ICD-10 codes** — structured demographics,
  diagnoses, and sibling linking across families.
* **Auto-save on blur** — clinical forms persist field-by-field, no
  explicit submit.
* **OmniSearch full-text** — PostgreSQL `tsvector` indexes across child,
  guardian, and note records, scoped per tenant.
* **State-mandated form generation** — Active Storage for consent
  documents with `hexapdf` AcroForm fill for NY DOH PDFs.
* **EDI 837P / 835** — X12 837P medical claim generation and 835
  remittance parsing via `stupidedi`.
* **HIPAA-compliant audit trails** — PaperTrail immutable versions
  satisfying 45 CFR 164.312(b), scoped per tenant.
* **AASM state machines** — workflow models (e.g.
  `DemographicEditRequest`) with typed transitions.
* **Packwerk domain boundaries** — 14 concept packs with explicit public
  APIs and dependency declarations, enforced in CI.
* **Pundit authorization** — plain-Ruby policies per concept, no DSL.
* **Soft-delete** — `discard` gem; no destructive deletes on clinical
  tables.
* **Strong migrations** — dangerous migrations caught at dev time before
  they reach production.
* **Cross-agency sharing contracts** — explicit sharing concept governs
  what data a referring agency can expose to a receiving one.
* **Record locking** — dedicated `lock/` pack coordinates concurrent
  edits on clinical records.
* **AI-assisted note quality** — AWS Bedrock checks clinical notes for
  completeness before they advance in the state machine.
* **OCR pipeline** — `rtesseract` + `ruby-vips` for extracting text from
  uploaded consent scans.

## What makes it stand out [#what-makes-it-stand-out]

* **Concept-driven Rails.** 14 Packwerk packs with declared public APIs
  — the monolith reads like a well-bounded modular system, not a
  Rails-ball-of-mud.
* **Row-level tenant isolation at the model layer.** Every clinical
  table scopes by `agency_id` through `acts_as_tenant`; isolation is
  not a controller concern.
* **Single-Postgres data plane.** Solid Queue, Solid Cache, and Solid
  Cable all run on the same Neon instance — jobs, cache, and WebSockets
  with zero Redis.
* **Audit-first by construction.** PaperTrail records immutable,
  field-level diffs on every clinical mutation, scoped per tenant and
  never deleted — 45 CFR 164.312(b) satisfied structurally.
* **Accessibility enforced in tests.** Capybara + Cuprite system tests
  assert WCAG 2.1 AA via axe-core; a11y regressions fail CI, not
  review.
* **EDI done properly.** `stupidedi` for X12 837P claim generation and
  835 remittance reconciliation — the billing pipeline talks the
  format insurers actually accept.
* **158 migrations, all versioned.** Schema history is the system-of-
  record for how the domain evolved; `strong_migrations` catches
  dangerous changes at dev time.

## Stack [#stack]

| Layer            | Technology                               |
| ---------------- | ---------------------------------------- |
| Web framework    | Rails 8.1                                |
| Language         | Ruby 3.4                                 |
| Database         | PostgreSQL (Neon, us-east-1)             |
| Frontend         | Turbo + Stimulus + ViewComponent 4.x     |
| Multi-tenancy    | `acts_as_tenant` (row-level)             |
| Audit trail      | `paper_trail` 17.x                       |
| Authorization    | `pundit` 2.5                             |
| State machines   | `aasm` 5.5                               |
| Background jobs  | Solid Queue                              |
| Cache            | Solid Cache                              |
| WebSockets       | Solid Cable                              |
| EDI              | `stupidedi` (837P / 835)                 |
| PDF              | `hexapdf` (AcroForm fill)                |
| OCR              | `rtesseract` + `ruby-vips`               |
| Soft delete      | `discard`                                |
| Migration safety | `strong_migrations`                      |
| AI               | AWS Bedrock (clinical note quality)      |
| Deploy           | Kamal                                    |
| Testing          | Minitest + Capybara + Cuprite + axe-core |

## Links [#links]

* **Source:** [github.com/FardinIqbal/tiny-solution](https://github.com/FardinIqbal/tiny-solution)
* **Next.js rewrite:** [github.com/FardinIqbal/tiny-solution-next](https://github.com/FardinIqbal/tiny-solution-next)
