Comprehensive app model
Developer map of the complete Tiny Solutions product, architecture, and domain model.
This is the target-state model of Tiny Solutions for developers: a multi-agency Early Intervention operating system for service coordination, evaluation, provider work, billing, payroll, reporting, and compliance.
This page is intentionally comprehensive. It can mention implementation maturity, code-area boundaries, and source files. It still must not include secrets, credentials, real child data, production environment values, or anything that would weaken HIPAA controls.
Product in one picture
Tiny Solutions is one complete application. Every agency receives every work area. Server-enforced role, relationship, and minimum-necessary access decide what a person may read or change; configurable feature switches do not.
Current implementation
The product is in active development with synthetic data only. The target model is implemented directly; there is no compatibility layer for earlier schemas or earlier agency configurations. A service agency stores only the authorization facts it needs to deliver, document, staff, and bill its own services for a child.
| Area | Status | Current route or code surface |
|---|---|---|
| Marketing and public docs | Shipped | src/app/(marketing), src/app/docs, content/docs |
| Auth and account recovery | Shipped | src/app/(auth), convex/auth.ts, convex/authOrchestrator.ts, convex/authRecovery.ts |
| Agency provisioning | Shipped | convex/lib/tenantProvisioning.ts, convex/agencyConfigs.ts |
| Home | Shipped as onboarding-only | src/app/(dashboard)/home/page.tsx |
| Children list | Shipped | src/app/(dashboard)/children/page.tsx, convex/children.ts |
| Child record | Shipped | src/app/(dashboard)/children/[childId], child tabs for basic info, medical, insurance, documents, notes, activity |
| New child | Shipped core flow | src/app/(dashboard)/children/new/page.tsx, convex/children.ts, convex/drafts.ts |
| Medical info | Shipped | convex/medicalInfo.ts, child Medical Info tab |
| Insurance | Shipped | convex/insurance.ts, convex/childInsurancePolicies.ts, child Insurance tab |
| Documents and notes | Shipped | convex/documents.ts, convex/notes.ts, child Documents and Notes tabs |
| Case activity timeline | Shipped | child record activity surface backed by audit and domain events |
| Member roster | Shipped | src/app/(dashboard)/members/page.tsx, convex/members.ts. Settings Members is a next.config door to /members. |
| Settings | Shipped | agency, billing, security, sessions, SSO, recovery, audit, document types |
| Subscription billing | Shipped | convex/billing.ts, convex/billingActions.ts, Stripe |
| Audit log | Shipped | convex/audit.ts, convex/lib/withAudit.ts |
| Agency service delivery | Active development | convex/serviceDelivery.ts, convex/schema/serviceDelivery.ts |
| Assignment and coordinator designation | Active development | convex/assignment.ts, convex/schema/children.ts |
| Schedule, payroll, reports | Available and active development | /schedule, /payroll, /reports |
Architecture model
The app is a full-stack reactive monolith. Next.js owns routes and UI. Convex is the database, server function layer, storage layer, scheduler, and HTTP endpoint host. Better Auth stores identity data in Convex through its adapter. Stripe and Resend are external services with narrow boundaries.
Route and surface map
Domain class model
This is UML-style, but encoded as a Mermaid flowchart so it renders in the docs site. Edge labels carry the multiplicities and relationship meaning.
Child Stage and Referral
A Child has one Stage. Stage is the Agency's word. Tiny never computes it.
The generated Case stage machine lives in docs/state-diagrams.md.
A Referral is a record of what the Agency sent. It has no status of its own (ADR-0021). The Child exists from the first keystroke of a Referral. If the Referral comes back, the Agency records the Initial Service Coordinator authorization. Stage may then move by the Agency mapping. If it does not come back, the Agency changes Stage. Nothing on the Referral changes.
Tiny does not copy EI Hub's Open or Closed referral status, and it does not arm the 45-day clock.
Member and access lifecycle
Document lifecycle
Documents are file-backed records. The final target keeps the same foundation and adds a richer inbox and library for agency-wide filing work.
Billing lifecycle
Product dependency map
All work areas share the same agency, child, member, file, and audit foundations.
Work-area availability
Every work area is part of the product for every agency. Implementation maturity is not an entitlement boundary and must never hide a destination or produce an upgrade state.
| Work area | Product contract |
|---|---|
| Child and referral operations | Referral intake, child record, notes, documents, transitions, and role-aware work queues. |
| Evaluations | MDE assignment, scheduling, evaluation documents, outcomes, and evaluator workload. |
| Agency service delivery | Service authorization facts, amendments, staffing, visits, notes, and reports for this agency only. |
| Billing | Subscription management plus EI claims, remittances, denials, and financial work queues. |
| Payroll | Pay-rate rules, payable activity, exports, and reconciliation. |
| Reports | Compliance, operational, billing, payroll, and audit reports. |
| Directory and documents | Shared professional and agency records, filing, verification, and templates. |
Developer ownership map
| Subsystem | Primary source |
|---|---|
| Docs site | content/docs, src/app/docs, src/components/mdx.tsx, source.config.ts |
| Navigation | src/lib/nav-config.ts, src/components/shared/AppSidebar.tsx |
| App shell | src/app/(dashboard)/layout.tsx, shared shell components |
| Auth | convex/auth.ts, convex/betterAuth, src/lib/auth.ts, src/lib/authKit.ts |
| Agency scope | convex/lib/tenantScope.ts, convex/lib/permissions.ts |
| Children | convex/children.ts, convex/schema/children.ts, src/app/(dashboard)/children |
| New child | convex/children.ts, convex/drafts.ts, /children/new |
| Insurance | convex/insurance.ts, convex/childInsurancePolicies.ts, src/components/insurance |
| Documents | convex/documents.ts, convex/files.ts, convex/documentTypes.ts |
| Notes | convex/notes.ts, convex/notesActions.ts |
| Medical info | convex/medicalInfo.ts, child Medical Info components |
| Agency service delivery | convex/serviceDelivery.ts, convex/lib/serviceDelivery, convex/schema/serviceDelivery.ts |
| Assignment and coordinator designations | convex/assignment.ts, convex/schema/children.ts |
| Members and roles | convex/members.ts, src/components/members, members routes |
| Billing | convex/billing.ts, convex/billingActions.ts, src/components/billing |
| Audit | convex/audit.ts, convex/lib/withAudit.ts, settings audit route |
| Security settings | sessions, trusted devices, SSO, recovery, assurance, break-glass access |
| Static guards | scripts/check-*.ts, scripts/guards.ts, docs/enforcement.md |
Invariants developers must preserve
- Public Convex functions use agency-scoped wrappers. Do not expose raw unscoped database reads from public functions.
- Audit logs are append-only. Domain writes log through the established audit helpers and never patch, replace, or delete audit rows.
- Email contains no PHI. Resend messages use opaque links and generic text.
- Convex is the server state path. Dashboard data uses Convex queries and mutations, not ad hoc REST fetches.
- Role and capability checks happen on the server. Browser navigation filtering is only a convenience layer.
- Files are private storage objects with agency-scoped metadata and signed access paths.
- The product surface is complete for every agency. Role, relationship, and record authorization may restrict an action; feature switches may not.
- Public docs can describe architecture and roadmap, but must never publish credentials, secrets, real PHI, or environment-specific private values.
Implementation maturity
Implementation maturity is tracked in Linear, not encoded as agency configuration. An unfinished flow stays an engineering issue against its final workflow contract; it does not become an enable/disable switch, hidden route, upgrade prompt, compatibility mode, or alternate data model.
How to extend this model
When a new concept lands, update this page in the same change set as the implementation. Add it to the domain model and developer ownership map. If it introduces a new lifecycle, add a state diagram. Every agency receives the complete application; do not introduce agency feature switches.