The Brief
The parenting support ecosystem is fundamentally broken. Parents facing behavioral challenges, developmental concerns, or the overwhelming uncertainty of raising a child have two options: wait weeks for an in-person appointment with a child psychologist, or scroll through contradictory advice on the internet. ProParent was built to democratize access to expert parenting guidance. The platform connects parents with certified child psychologists through three distinct engagement modes: live video seminars (one-to-many expert sessions with real-time Q&A), 1-on-1 therapy sessions (private video consultations), and school-sponsored credit programs where institutions can fund access for their parent communities. The product spans four stakeholder groups — parents, experts, school administrators, and platform admins — each with radically different workflows, trust requirements, and interaction patterns. Parents need simplicity and reassurance. Experts need scheduling control, earnings visibility, and session tools. Schools need bulk onboarding and credit distribution. Admins need full platform visibility. Building for all four simultaneously, with concurrency-safe financial transactions and real-time video that never drops during an emotional conversation, was the defining challenge.
The Challenge
The multi-stakeholder complexity was the central engineering challenge. Parents, experts, admins, and schools each need fundamentally different flows through the same platform — different onboarding, different dashboards, different notification patterns, different payment interactions. A single AdonisJS codebase had to serve all four without the complexity leaking between boundaries. The credit wallet system introduced concurrency hazards that most platforms never face. When a parent books a session, credits must be atomically deducted from the correct balance (purchased credits vs. school-granted credits) with row-level locking to prevent double-spending during simultaneous transactions. The dual-balance model — where parents can hold both self-purchased and school-sponsored credits with different burn priorities — required careful transaction design. Real-time video reliability in a therapeutic context raised the stakes beyond typical video calls. When a 100ms call drops while a parent is describing their child's behavioral episode, the cost is not a reconnection delay — it is broken trust. The parent may not come back. The Clerk authentication integration added its own complexity: multi-role provisioning where a single signup automatically creates the correct stakeholder record (Parent, Expert, or Admin) with role-based endpoint access across 65 API endpoints.
Four stakeholder groups (parents, experts, schools, admins) with distinct flows through a single codebase
Concurrency-safe dual-balance wallet with row-level locking and smart burn logic
Clerk OAuth integration with automatic multi-role provisioning across 65 API endpoints
Real-time video reliability in a therapeutic context where dropped calls break trust
The Approach
ProParent's architecture was built on AdonisJS v6 with a strict service layer pattern — thin controllers that delegate all business logic to dedicated service classes. This separation was non-negotiable for a platform where a single function might touch authentication, credit transactions, video room creation, and notification dispatch. Every service is independently testable, every transaction boundary is explicit, and VineJS validation gates every request before it reaches business logic.
Service Layer Architecture
The AdonisJS v6 backend follows a strict thin-controller pattern. Controllers handle HTTP concerns (parsing requests, returning responses) and delegate all business logic to service classes — WalletService, SeminarService, BookingService, SchoolService, ExpertService. Each service encapsulates its domain: WalletService owns credit transactions, SeminarService owns live event lifecycle, BookingService coordinates 1-on-1 session scheduling. VineJS validators gate every endpoint with runtime type checking, creating a double safety net alongside TypeScript's compile-time guarantees. This architecture gave us confidence to move fast on a complex domain without fear of cross-cutting side effects.
Concurrency-Safe Wallet System
The credit wallet uses a dual-balance model: every parent has both a purchased credit balance and a school-granted credit balance. When credits are spent, smart burn logic deducts school credits first (they have expiration dates) before touching purchased credits. The critical engineering challenge was concurrency safety — when a parent books a session during a live seminar purchase, both transactions must see consistent balances. We implemented row-level locking with Lucid ORM's forUpdate() within database transactions, ensuring that concurrent wallet operations serialize correctly. Every credit movement creates an immutable ledger entry for full auditability.
100ms Video Integration
Live video uses the 100ms SDK with JWT-based room management. When a seminar is scheduled, the system pre-creates a 100ms room with configured capacity. Experts join as hosts with broadcast permissions; parents join as viewers with Q&A messaging capability. For 1-on-1 therapy sessions, rooms are created on booking confirmation with two-participant limits. The JWT auth token generation encodes role permissions (expert vs. parent), session duration limits, and recording consent flags. Broadcast messaging enables the live Q&A flow where parents submit questions during seminars without interrupting the expert's presentation.
Multi-Role Authentication
Clerk OAuth handles authentication with automatic stakeholder provisioning. When a user signs up, a webhook from Clerk triggers the creation of the appropriate platform record — Parent, Expert, or Admin — with role-specific default settings, notification preferences, and access permissions. The middleware layer checks Clerk session tokens and resolves the user's platform role on every request, gating access to the correct subset of the 65 API endpoints. Experts go through an additional verification pipeline before their accounts are activated for consultations.
School Integration Module
Schools can onboard their parent communities through a bulk CSV import system — upload a spreadsheet of parent emails and phone numbers, and the system creates pending accounts with pre-allocated credit grants. When a parent signs up with a matching email, the system automatically links them to their school and applies the sponsored credits to their wallet. School administrators get a dedicated dashboard showing credit utilization, active parents, popular seminars, and ROI metrics. The credit grant distribution supports both one-time allocations and recurring monthly grants.
Technical Deep Dive
ProParent's technical architecture reflects the reality that a platform handling children's mental health data cannot afford shortcuts. Every layer — from the Clerk authentication to the credit ledger to the 100ms video rooms — was built with defensive programming, explicit transaction boundaries, and comprehensive audit logging. The AdonisJS v6 + Lucid ORM combination gave us TypeScript-first database operations with the transactional safety required for financial operations.
AdonisJS v6 + Lucid ORM
The backend is a monolithic AdonisJS v6 application organized by domain modules. Lucid ORM provides TypeScript models with relationship definitions, query scoping, and — critically — transactional support with forUpdate() row locking. Every database operation that touches credits runs inside an explicit transaction. The service layer pattern means business logic is decoupled from HTTP concerns: the same WalletService that handles API-driven credit purchases also handles school-grant distributions and admin adjustments, with identical validation and audit logging regardless of the entry point. Dependency injection via AdonisJS's IoC container keeps services testable in isolation.
Credit Wallet Architecture
The wallet system tracks two balance types per parent: purchased credits (bought via Razorpay) and school credits (granted by institutions). The smart burn algorithm always depletes school credits first — they carry expiration dates tied to the school's grant cycle. Atomic transactions ensure that a credit deduction, ledger entry creation, and booking confirmation happen as a single unit of work. If any step fails, the entire operation rolls back. The ledger is append-only: corrections are recorded as compensating transactions, never as mutations to existing records. This gives administrators a complete, tamper-proof history of every credit movement in the system.
100ms Real-Time Video
Room management is handled through the 100ms server-side API. Seminar rooms support configurable participant limits with role-based permissions — experts get publish (audio + video + screen share) and subscribe rights, while parents get subscribe-only with messaging capability for Q&A. JWT auth tokens are generated per-session with embedded role claims, expiration times, and room IDs. The broadcast messaging system powers live Q&A: parents submit questions through a structured message format, experts see a moderated queue, and selected questions are broadcast to all participants. Session recordings are stored with access controls requiring explicit consent from both parties.
Inertia.js Admin & Expert Portals
The admin and expert dashboards use Inertia.js to bridge AdonisJS directly to React components — delivering single-page-app interactivity without a separate API layer. Admins manage expert verification workflows, view platform-wide credit flows, monitor seminar attendance, and handle dispute resolution. Experts manage their availability schedules, view upcoming sessions, track earnings, and access session history. Both portals share the same AdonisJS validators and authorization policies as the mobile API, ensuring that admin and expert operations are subject to identical security constraints. This eliminated an entire class of "admin bypass" vulnerabilities.
Expo React Native Client
The parent-facing mobile app is built with React Native and Expo, featuring a custom animated tab bar with Lottie animations for visual delight. React Query manages server state with optimistic updates for booking flows — the UI confirms a booking instantly while the transaction commits on the server. The Razorpay checkout integration handles credit purchases with webhook confirmation, and deep linking supports push notification flows that land parents directly on the relevant seminar or session screen. The app supports 20+ screens across onboarding, discovery, booking, wallet management, session history, and profile settings.
Key Features
Live Video Seminars
One-to-many expert sessions with real-time Q&A capability. Experts broadcast to configurable audience sizes while parents submit questions through a moderated queue. Seminars are scheduled, promoted, and tracked through the admin portal with attendance analytics.
1-on-1 Therapy Booking
Private video consultations between parents and certified experts. The booking flow checks expert availability in real-time, deducts credits atomically from the parent's wallet, and pre-creates the 100ms room with two-participant limits and recording consent flags.
Credit Wallet System
Dual-balance wallet supporting purchased credits (via Razorpay) and school-granted credits with smart burn logic. School credits deplete first due to expiration constraints. Every transaction is recorded in an append-only ledger with full audit trail.
School Integration
Bulk CSV onboarding for school parent communities with automatic credit grant distribution. Parents are linked to their school on signup via email matching. School dashboards show credit utilization, active parents, and seminar engagement metrics.
Expert Availability Management
Experts set recurring weekly schedules with exception handling for holidays and personal time. The scheduling engine prevents double-booking with optimistic locking and sends automated reminders to both parties before each session.
Live Q&A Moderation
During live seminars, parents submit questions through structured messages. Experts see a real-time moderated queue and can select, dismiss, or flag questions. Selected questions are broadcast to all participants, creating an interactive experience without audio chaos.
The Results
ProParent shipped as a comprehensive teleconsultation platform serving four stakeholder groups through a unified AdonisJS v6 codebase. The service layer architecture enabled rapid feature development — 65 API endpoints across 19 data models with 27+ database migrations, all maintaining strict transactional safety for credit operations. The credit wallet system handles concurrent transactions with zero double-spend incidents through row-level locking. The 100ms video integration supports both one-to-many seminars and private 1-on-1 sessions with role-based room permissions. The Expo React Native client delivers 20+ screens with a custom animated tab bar and Razorpay-integrated credit purchases. The school integration module enables bulk onboarding with automatic credit distribution, creating a B2B channel alongside the direct-to-parent model. Three monetization tiers — individual credit packs, subscription bundles, and school-sponsored grants — provide flexible access paths to expert parenting guidance.

