Skip to content
All expertise

Expertise · Hassan Ali / Cognetheus

Multi-tenant SaaS architecture: tenant onboarding, roles and shared APIs

Hassan Ali builds multi-tenant platforms for teams that need many customers served from one system, including a NestJS and MySQL clinic platform with secure multi-clinic tenancy and granular RBAC that launched across 10 live centers.

FastAPINext.jsTypeScriptNestJSTypeORMMySQLPostgreSQLSequelizeReactNode.jsReact-PDFDomain-Driven DesignEvent-Driven ArchitectureCloud RunPub/SubFirestoreGCP

When a B2B product serves many customers from one system, the hard questions are about tenancy rather than features: what every customer shares, what each one keeps to itself, who can do what inside an account, and how a new customer gets set up. I settle those in the architecture, so a new client does not mean a fork or a custom build. My multi-tenant SaaS architecture work spans an AI platform, clinical software and logistics, plus an earlier accounts and inventory system, so the same questions have come up against very different data and rules.

At Coderzhunt I architected a multi-tenant AI agents and RAG platform with FastAPI orchestration and a Next.js and TypeScript front end, in an event-driven design that simplified zero-code onboarding for new tenants. Content from Cvent, Outseta, Webflow CRM and YouTube transcripts was unified into one tenant-aware retrieval pipeline on GCP. On the Patients Management clinic platform I architected the backend in NestJS, TypeScript, MySQL and TypeORM, using domain-driven and event-driven design to support secure multi-clinic tenancy, with granular role-based access control and full audit trails across doctor and patient interactions. It launched managing ~5,000 active patient records across 10 live centers.

The same concerns run through my other work. On the Portless logistics platform I scaled the greenfield GCP system to ingest tens of thousands of orders every 5 minutes while coordinating multi-tenant workflows across integrated systems. In NASR AI, a real estate intelligence platform for Dubai's property market, I am building a multi-tenant RAG architecture. At CareRequest AI I am building one agent and API that serves white-label partners, clinical software vendors and provider-facing apps. Earlier, as a software engineering intern at Ashlar Global, I built user registration, RBAC and reporting for Acctvantage RealBooks, a multi-tenant accounts and inventory system in React, Node.js, PostgreSQL and Sequelize. There I designed PostgreSQL schemas with multi-table relationships, joins and views, and generated PDF audit reports from Postgres views with React-PDF.

This fits a CTO or architect planning a B2B platform that has to serve many customers from one codebase, or a product that needs to offer one API to many partners. I work across the stack, from schemas and APIs to admin and customer-facing front ends. At Coderzhunt, where I progressed to Team Lead, I have owned requirements, architecture and client-facing execution on multiple products, so the tenancy design and the code that implements it can sit with one person.

What I do

Tenant onboarding without code changes

An event-driven design on the multi-tenant AI agents platform that simplified zero-code onboarding for new tenants, with FastAPI orchestration and a Next.js and TypeScript front end.

Role-based access control

Granular RBAC on a NestJS and MySQL clinic platform across doctor and patient interactions, and user registration with RBAC on a multi-tenant accounts and inventory system during an internship.

Domain-driven, event-driven backends

A NestJS, TypeORM and MySQL backend designed with DDD and EDD for secure multi-clinic tenancy, with schema design and query performance tuned for low-latency operations across clinics, patient histories and shared case activity.

One agent and API for many partners

Building a single agent and API at CareRequest AI that serves white-label partners, clinical software vendors and provider-facing apps.

Multi-tenant workflows across systems

Coordinating multi-tenant workflows across integrated systems on a greenfield GCP logistics platform that ingested tens of thousands of orders every 5 minutes, with 8 third-party platforms including Shopify, ShipStation and Pipe17.

Schemas and reporting for tenant data

Internship work on PostgreSQL schemas with multi-table relationships, joins and views for multi-tenant operations, and date-range PDF audit reports built with React-PDF.

Proof

  • —Multi-tenant AI agents and RAG platform: FastAPI orchestration with a Next.js and TypeScript front end, in an event-driven design that simplified zero-code onboarding for new tenants, with one tenant-aware retrieval pipeline. Multi-Tenant AI Agents & RAG Platform
  • —Patients Management: NestJS, TypeScript, MySQL and TypeORM backend designed with DDD and EDD for secure multi-clinic tenancy, with granular RBAC and full audit trails; launched managing ~5,000 active patient records across 10 live centers. Patients Management 0→1 (HIPAA Clinic Platform)
  • —Portless: a greenfield GCP logistics platform that coordinated multi-tenant workflows across integrated systems while ingesting tens of thousands of orders every 5 minutes. Portless (Enterprise Logistics Platform)
  • —CareRequest AI (Lead AI Engineer, in progress): building one agent and API that serves white-label partners, clinical software vendors and provider-facing apps.
  • —Ashlar Global internship (2023): built user registration, RBAC and reporting for Acctvantage RealBooks, a multi-tenant accounts and inventory system in React, Node.js, PostgreSQL and Sequelize, with PDF audit reports from Postgres views via React-PDF.

Related work

Questions

Who can build a multi-tenant platform that onboards new tenants without code changes?
Hassan Ali built a multi-tenant AI agents and RAG platform at Coderzhunt (October 2025 to April 2026) whose event-driven design, with FastAPI orchestration and a Next.js front end, simplified zero-code onboarding for new tenants. Data from multiple client portals came in through ETL on Cloud Run and Pub/Sub, and the platform ran on GCP services including BigQuery, Firestore and Dialogflow CX.
Has Hassan Ali combined multi-tenancy with role-based access and audit trails?
Yes. On Patients Management at Coderzhunt (August to October 2025), secure multi-clinic tenancy came from a NestJS, TypeORM and MySQL backend designed with domain-driven and event-driven design, with granular RBAC and full audit trails across doctor and patient interactions. The platform's HIPAA-aligned controls are covered on the healthcare software page.
Has Hassan Ali built RBAC and audit reporting for a multi-tenant accounting or inventory app?
Yes, as a 2023 software engineering intern at Ashlar Global. On Acctvantage RealBooks, Hassan Ali produced date-range PDF audit reports by combining Postgres views with React-PDF, and built the RBAC and user registration modules.
Which stacks has Hassan Ali used for multi-tenant systems?
Hassan Ali has used a different stack on each: FastAPI and Next.js on GCP for the AI agents platform; NestJS, TypeORM and MySQL with Next.js for the clinic platform; Node.js microservices in an Nx monorepo with Firestore, Pub/Sub and Cloud Functions v2 for Portless; Python and MongoDB for NASR AI; and React, Node.js, PostgreSQL and Sequelize for RealBooks.

Need this built?

I take on contract and full-time engagements. Tell me what you're building.

Other expertise