I merged eight separate repositories into one monorepo with shared OpenAPI and Zod contracts, shipping four web apps for clubs, coaches, ops and AI review, plus SwiftUI iOS and a WeChat mini program for teaching, assessments, feedback and bookings.
The team shipped the first release in 6 weeks, covering course management, enrollment, player development records and the coach workspace. The pilot began across 13 clubs in November 2026.
Four-layer modular monolith and contracts
I extracted a standalone Node.js and PostgreSQL Platform service as the sole writer for product data, then refactored it into a four-layer modular monolith checked by AST boundary rules. The backend passes 374/374 API contract checks and 1,300 automated tests, cutting source circular dependencies from 24 to 0 and cross-module violations from 98 to 0.
- ClientsFour web apps for clubs, coaches, ops and AI review share UI components and design tokens, alongside SwiftUI iOS and the WeChat mini program consuming the same Zod-generated OpenAPI contract.
- Platform APINode.js, TypeScript and PostgreSQL handle accounts, courses, enrollment, payments and refunds, assessments and development records. Staff roles, coaching relationships and sharing consent are checked on the server.
- Platform WorkerConsumes a transactional outbox under leases with backoff retries for analysis jobs, booking messages, assessment notifications and media cleanup, forwarding video analysis to the AI backend over SQS.
- AI BackendPython services separate video ingest, analysis and human review, persisting job state and scoring artifacts before returning approved results to Platform over internal APIs.
AWS migration and on-demand scaling
I led the full-stack migration from legacy managed services to AWS. Self-hosted auth now covers every client with Better Auth, iOS App Attest short-lived token reuse and MFA. Historical records and media moved through idempotent ETL and byte-verified copy tools with rollback support.
With AWS CDK, I set up SQS-driven GPU scaling that drops to zero when idle, blue-green traffic switching with circuit-breaker rollback and CloudWatch checks. Video confirmation and outbox events commit in one database transaction. Before dispatch, the worker rechecks submission versions and media provenance, and recipients deduplicate with idempotency keys.
Human review, court check-in and AI recommendations
I rebuilt the AI human-review workbench (Review Web) across backend and frontend so reviewers inspect clips, edit reports and pick recommended courses. Publication rechecks clip and course state and saves operation receipts. I also shipped fixed court QR check-in across clients so attendance stays separate from lesson recording.
Course recommendations use LLMs only to extract grounded training needs while a rule engine handles ranking and explanations, backed by a leak-proof offline eval suite. Live-model runs caught high scores being misclassified as training gaps, letting us fix the evidence filter. Delivery currently covers the pipeline and offline eval suite, before production API wiring.
Video Agent Harness (demo)
A separate Video Agent prototype supports match review. It indexes shot events and clips upfront, exposing YOLO, OpenCV and SAM tools so the model queries segments, cuts highlights and writes scores and coaching notes without reprocessing full videos.
Execution sets tool-call, time and token budgets, checks cited sources and metrics in code, and separates model output from template fallback. It remains evaluated in a standalone demo and has not shipped as a platform feature.
Performance work and operating records
Read-transaction tuning, connection reuse, bounded retries and circuit breakers kept foreground availability at 100% with a 24.8 ms P95 and 100% idempotent outbox delivery under PostgreSQL concurrency stress testing at 25 RPS with fault injection. Combining 2-second video GOPs, optional private CloudFront signed CDN, client caching and iOS App Attest token reuse lowered course search P95 from 113.2 ms to 1.06 ms.
Blue-green deployment on AWS supports zero-traffic candidate checks, traffic switching and rollback, recording zero outages across the first two pilot weeks. A historical production measurement on November 12, 2026 covered 300 successful /v1/ requests over 24 hours with an application P95 of 309.2 ms, about 310 ms, including auth and business logic but excluding client network time.