← AyurGate

Build with AyurGate

Vertical SaaS for Ayurveda clinics. Next.js 16 / Prisma 7.5 / TypeScript / multi-tenant. We're looking for integrators, white-label partners, and module contributors.

Become a partnerRequest repo access📥 Download brief PDF

Stack

FrontendNext.js 16 App Router · React 19 · TypeScript 5 · Tailwind 4 · PWA
BackendNext.js API routes · JWT auth · CSRF protection · cron with shared secret
DataPrisma 7.5 · SQLite (Postgres planned) · ~80 models · multi-tenant via clinicId
PDFs@react-pdf/renderer (server-side) — invoices, receipts, audits, Casetrust forms
CommsWhatsApp Cloud API · SMTP · Twilio (planned)
HostingRailway · cron via Railway scheduled jobs

Architecture

Multi-tenant via clinicId column on every row. Tenant resolved from JWT in middleware, then `getTenantPrisma(clinicId)` returns a scoped client. Never use raw `prisma.x` in tenant code.

Auth: JWT (jose) + bcrypt + TOTP 2FA + recovery codes + trust-device cookie. Super-admin uses env-var creds + TOTP via `PlatformSettings`.

RBAC: 7 roles (owner, admin, doctor, therapist, receptionist, accountant, branch_manager). Branch-restricted via `getRestrictedBranchId` + `assertBranchAccess`.

Audit: every mutation calls logAudit(). Every PDF served at /api/{entity}/[id]/pdf renders server-side via @react-pdf/renderer (no browser print artifacts).

Integration opportunities (paid contracts available)

Razorpay payment intent flow

Payments · Q3 2026

Stripe subscription billing

Payments · Q3 2026

WhatsApp 2-way webhook handler

Comms · Q3 2026

Google Calendar 2-way sync

Calendar · Q3 2026

Twilio SMS fallback

Comms · Q3 2026

Insurance pre-auth (AIA, GE, NTUC)

Insurance · Q4 2026

Module ideas (open to proposals)

  • Native iOS / Android wrap (Capacitor)
  • AI scribe (consult audio → clinical note)
  • AI dosha pre-screen (photo + chat)
  • Telehealth video (Daily.co)
  • Yoga / asana prescription module
  • Loyalty / referral program
  • Diet plan generator (per-dosha menus)
  • Postgres migration
  • Background job queue (Bull/Redis)
  • Email queue + retry

Partner programs

White-label

Sell AyurGate under your brand to your clients. Rev share TBD.

Integration partner

Build add-on apps (PMS, lab, insurance) that consume our API.

Implementation partner

Onboard clinics, do migrations, train staff.

Content partner

Ayurveda-specific protocols, panchakarma templates, dietary databases.

Code conventions

  • TypeScript 5 strict, no `any`
  • UI: bespoke styles in `lib/styles` — no UI libraries
  • State: React local + URL params, no global state lib
  • PDFs: server-rendered (NOT browser print) via @react-pdf/renderer
  • `route.ts` for JSON APIs, `route.tsx` only when JSX needed (PDFs)
  • Multi-tenant: never use raw `prisma.patient.findMany()` — always `getTenantPrisma(clinicId).patient...`
  • Every mutation calls `logAudit()`
  • Commits: prefix with module, never amend, always new commit

Talk to us

Tell us what you want to build. We'll send repo access + a scoped contract.

Email partners@ayurgate.com

Founder direct: ayurcentresg@gmail.com