Back to all projects
Healthcare EngineeringActive Repository

MedicaMS

Clinical access, structured safely.

Clinic management platform with multi-tenant role-based access and an embedded custom database query editor.

DatabasePostgreSQL + Drizzle
AuthBetter Auth RBAC
FeaturesAdmin Query Editor

The Problem Space

Medical clinic administrators and doctors need unified patient record access, scheduling, and custom analytical queries without exposing patient health info to unauthorized staff.

The Architecture & System

Developed a Next.js and PostgreSQL clinic system with Drizzle ORM schemas and Better Auth role management, including an admin query interface with validation safeguards.

Next.js App Router, Server Actions, PostgreSQL database deployed with Drizzle ORM migrations, Better Auth session authentication.

Key Technical Decisions

  • Enforced strict row-level security and role-based permissions (doctors vs staff vs patients).
  • Added a sandboxed query editor for clinic analytics with schema inspection.