Couro — AI Biomechanical Analysis Platform
AI-powered running biomechanics for athletes — coaches upload video, the platform returns a composite Couro Score, joint-level scores, pose-overlay clips, and AI-generated form insights, delivered through a Next.js web app and a React Native mobile app.
Overview
Couro is an AI-powered biomechanical analysis platform for athletic running performance. Coaches and athletes upload a running clip (treadmill or track) and the system returns:
- A composite Couro Score (0–100)
- Four joint-level scores — shoulder, elbow, hip, knee
- A pose-estimation overlay video
- A stride-isolated video
- AI-generated textual insights on running form
Results are tracked longitudinally per athlete with score-trend charts and session-over-session comparison. Built at Codecubics as a cross-platform monorepo: a React Native mobile app and a Next.js 14 web app, both backed by Supabase + an external AI/Patient API. 30% measurable improvement in athlete performance metrics, 95% production uptime across staging and prod via Terraform-provisioned AWS.
Architecture
A distributed monolith with a BFF pattern — Next.js API routes proxy to an external AI service while owning the auth, billing, and webhook surface.
┌─────────────────────────┐ ┌─────────────────────────────┐
│ React Native │ │ Next.js (App Router) │
│ • Auth screens │ │ • Server + Client comps │
│ • Athlete management │ │ • API routes (BFF) │
│ • Video upload │ │ • Server actions │
│ • Score display │ │ • Auth-guard middleware │
│ • IAP billing │ │ │
└────────────┬────────────┘ └──────────────┬──────────────┘
│ │
▼ ▼
┌────────────────────────────────────────────────┐
│ BFF / API Layer │
│ Auth proxy → External API + Supabase │
│ Patient proxy → api.couro.io │
│ Session proxy → api.couro.io/sessions/* │
│ Billing → Stripe SDK │
│ Webhooks → Stripe + Apple S2S │
│ Account → Supabase direct │
└────┬──────────────┬────────────────┬──────────┘
▼ ▼ ▼
┌─────────┐ ┌──────────┐ ┌──────────────────┐
│ Supabase│ │ Stripe │ │ External AI API │
│ Auth │ │ Billing │ │ Pose estimation │
│ Postgres│ │ Subs │ │ Score generation │
│ RLS │ │ Portal │ │ AI insights │
└─────────┘ └──────────┘ └──────────────────┘Highlights
Cross-platform delivery
A React Native 0.74 app for iOS + Android (couro-mobile-app) and a Next.js 14 web app (couro-web-app) share the same Supabase auth and external AI backend, so a coach can record on iPhone and review on a desktop browser without re-uploading.
Video → AI pipeline
Video uploads are base64-streamed to the BFF, forwarded to the external API for pose estimation and joint-angle scoring, and returned as structured JSON + S3 video URLs. The frontend renders the pose-overlay and stride-isolated clips through react-player (web) and react-native-video (mobile).
Longitudinal tracking
Per-athlete score history is rendered with Recharts + Chart.js on web and react-native-chart-kit on mobile, with bezier interpolation between sessions so coaches can read the trend, not just the spikes. Session detail views use circular progress gauges (react-native-svg-circular-progress) for joint-level scores.
Multi-rail subscriptions
- Web — Stripe Checkout + Customer Portal (
@stripe/react-stripe-js, serverstripeSDK). - iOS — Apple In-App Purchases (
react-native-iap) with server-to-server receipt verification. - IAP receipts are validated against Apple's certificate chain using
@peculiar/x509+node-forgefor x.509 parsing — no third-party verifier in the loop. - Token-based consumption model (100 / 1000 tokens-per-month tiers) keeps web and iOS billing reconciled in Supabase.
Multi-provider auth
Email/password + Google + Apple + Facebook OAuth via Supabase Auth, with @supabase/ssr for App Router cookie sessions and a 15-day HTTP-only accessToken on web; AsyncStorage on mobile.
PDF report generation
Printable session summaries via react-to-print + html2canvas-pro keep rendering on the client and the BFF stateless.
Infrastructure-as-code
Terraform-provisioned multi-environment AWS (prod + staging) — ASG-backed EC2 (1–3 instances) behind ALB, with stateless Next.js for horizontal scale.
Tech Stack
Mobile (couro-mobile-app)
| Category | Tech |
|---|---|
| Framework | React Native 0.74.3 + TypeScript 5 |
| Navigation | React Navigation 6 (Stack + Bottom Tabs) |
| State | React Context (Auth / Trainer / Toast) |
| UI | React Native Paper, FontAwesome, Reanimated |
| Charts / Video | react-native-chart-kit, react-native-video |
| IAP | react-native-iap |
| Storage | @react-native-async-storage/async-storage |
Web (couro-web-app)
| Category | Tech |
|---|---|
| Framework | Next.js 14 App Router (Server + Client Components) |
| Styling | Tailwind CSS + SCSS modules |
| Charts | Recharts + Chart.js |
| Forms | Formik + Yup |
| Animation | Framer Motion |
| Payments UI | @stripe/react-stripe-js |
| react-to-print + html2canvas-pro |
Backend / BFF
| Category | Tech |
|---|---|
| Runtime | Next.js API Routes (Node 18) |
| Auth | Supabase Auth, JOSE / jsonwebtoken / jwt-decode / jwks-rsa |
| Payments | Stripe Node SDK |
| Apple IAP verification | @peculiar/x509, node-forge (cert-chain validation) |
| Webhooks | Raw-body parsing via micro |
| Infra | Terraform → AWS ASG + ALB |
// more projects
Let's work together
Have a project in mind? Reach out and let's build something great.