Back to work

Live

ClinicFlow

A staff-only clinic management platform: appointments, billing, patient records and reports, in Arabic and English.

ClinicFlow dashboard with revenue, today’s schedule and pending confirmations (fictional demo data)
ClinicFlow dashboard on a phone (fictional demo data)
Status
Live
Contribution
Designed and built end to end by Mohamed Hassan as an independent CRM product.
Visit live project
https://www.clinicflow.fit/

A staff-only clinic management platform: appointments, billing, patient records and reports, in Arabic and English.

Objective

Replace paper appointment books, phone scheduling and spreadsheets in small and mid-sized private clinics with one system for appointments, billing, patient records, follow-ups and role-based reports. Patients are data records only; every action is performed by clinic staff.

Engineering approach

Next.js App Router with Server Actions as the only write path, and Supabase Postgres where row-level security on every table is the main guard. Appointment status changes are enforced by a database trigger and billing runs as transactional Postgres functions, so a charge cannot half-succeed. Four roles with per-user page overrides, audit records for sensitive changes, and an AI assistant limited to a curated set of tools (also reachable on WhatsApp through a separate worker). Covered by 270 unit tests plus Playwright, with an evaluation gate for the assistant in CI.

Responsibilities

  • Product and interface design for the staff workflows: appointments, billing, patient records, follow-ups and reports.
  • Full Stack development: Next.js interface, Server Actions, database schema and security policies.
  • Testing and CI: unit tests, Playwright, and an evaluation gate for the AI assistant.
  • Arabic and English localisation of the whole product.

Engineering decisions

  1. Server Actions as the only write pathEvery change to data goes through one server-side entry point, so validation and permission checks cannot be skipped from the client.
  2. Row-level security as the main guardPolicies on every table keep access rules inside the database itself, not only in application code.
  3. Business rules enforced in the databaseAppointment status changes are guarded by a database trigger, and billing runs as transactional Postgres functions.
  4. An AI assistant with a fixed set of toolsThe assistant can only call a curated set of tools, and it is also reachable on WhatsApp through a separate worker.

Technical challenges

  1. A charge that cannot half-succeedBilling is written as transactional Postgres functions, so a charge either applies completely or not at all.
  2. Different staff, different accessFour roles with per-user page overrides, plus audit records for sensitive changes.

Trade-offs

  1. Staff-only by designPatients are data records and never sign in, which keeps the permission model small but means there is no patient self-service.
  2. Predictable assistant over open-ended assistantLimiting the assistant to curated tools gives up flexibility in exchange for behaviour that can be tested in CI.

Technologies

  • Next.js
  • React
  • TypeScript
  • Supabase
  • PostgreSQL
  • Tailwind CSS
  • shadcn/ui
  • Zod
  • Recharts
  • next-intl
  • Vercel AI SDK
  • WhatsApp Business API
  • Vitest
  • Playwright
  • Vercel
Skip screens

Visual evidence

Visual evidence

ClinicFlow sign-in screen
Sign in
ClinicFlow dashboard with revenue, today’s schedule and pending confirmations (fictional demo data)
Dashboard
ClinicFlow analytics: appointments over time, insurance breakdown and department engagement (demo data)
Analytics
ClinicFlow weekly appointments calendar (fictional demo data)
Appointments
ClinicFlow patient directory grouped by department (fictional demo data)
Patients
ClinicFlow patient record with billing and documents (fictional demo data)
Patient record
ClinicFlow revenue and sales report (fictional demo data)
Reports
ClinicFlow settings: services and pricing by department
Services and pricing

Next project

Projecty