Case study: Multi-tenant SaaS

A multi-tenant AI form builder SaaS

A B2B form platform with natural-language form generation, a drag-and-drop builder, company workspaces with plan limits, approvals and analytics.

Client
A B2B software client, name withheld
My role
Lead engineer, discovery through go-live
Engagement
Delivered through Torch Solutions

I worked on this as a Senior Software Engineer at Torch Solutions, the engineering firm contracted by the client. The product belongs to the client.

Illustrative mockup of the form builder canvas beside an AI generation panel

These are illustrative mockups of the form builder under an invented product name. The client's interface and data are not shown.

Project overview

The form builder lets a team describe a form in plain language, get a working draft, and refine it in a drag-and-drop builder before publishing.

I owned the build from requirements through architecture, implementation and go-live, and handed over a product the client could run without me.

The business problem

Teams wait on engineering tickets for forms, and one-shot AI generators produce a blob nobody can edit. A sellable product needs more than either.

AI output has to be editable

Generated fields must land in a real builder as typed components a person can change.

Companies need isolation and limits

Separate workspaces, roles and plan quotas are what make a form tool a business.

Publishing needs review

Collaboration requires approval and comments before a form goes live.

Usage has to be measurable

Quotas and product metrics both depend on a reliable record of events.

My role and responsibilities

End-to-end ownership of the product build.

  • Turned ambiguous requirements into personas, an activation funnel and phased delivery slices
  • Designed tenancy, the field schema, the AI generation pipeline and analytics events
  • Built the Next.js application and the Django API
  • Prepared environments, migrations and deployment, and completed the client handover

Technical challenges

Reliable structured output from a language model

The model has to return fields that exist in the product's widget catalog, with valid options for choice fields, every time.

A flexible field schema that still persists cleanly

Around twenty widget types with their own options, ordering, bulk creation and incremental saves.

One authoring loop

Drag-and-drop, AI insert and unsaved-change guards have to behave as a single editor.

Plan gates without a rewrite later

Role, company and plan status need to be enforced at the API and reflected immediately in the interface.

Solution and implementation

A multi-tenant SaaS where AI accelerates authoring and every generated field stays reviewable and editable.

AI form generation

  • A multi-step pipeline: prompt, theme, field schema, preview, then insert into the builder
  • Field types constrained to the product's catalog, with templates for choice-field options
  • A sandboxed preview before anything is inserted

Drag-and-drop builder

  • Around twenty widget types across inputs, choices, media and layout
  • Per-field styling options and a draft, published, archived lifecycle
  • Bulk creation for new fields and incremental updates for changed ones

Workspaces and plans

  • The company workspace is the tenant boundary for users, forms and analytics
  • Owner, manager and employee roles, with email invitations
  • Plan limits for users, forms, submissions and fields, carried in JWT claims

Approvals and analytics

  • An approvals list with live preview and comment threads
  • A company event log for quotas and product metrics, plus per-form counters
Next.js application → Django REST APIJWT with role, company and plan claims for gatingOpenAI generation pipeline: theme → fields → previewPostgreSQL, with flexible JSON options per field
Generalized architecture. Internal infrastructure details are omitted.
Illustrative mockup of the form builder's workspace dashboard with form, submission and view totals
Workspace dashboardForms, submissions, views and weekly trends for one company workspace.
Illustrative mockup of the form builder's team screen with roles and invitations
Teams and rolesOwners, managers and employees, with invitations and form access.
Illustrative mockup of the form builder's submissions list with status filters and export
SubmissionsStatus filters, export and per-form response tracking.

Technology stack

Frontend
Next.js, React, TypeScript, Tailwind CSS, Zustand, TanStack Query, react-dnd
Mobile
Expo (React Native) for submissions
Backend
Django, Django REST Framework, SimpleJWT
AI
OpenAI SDK
Data
PostgreSQL
Delivery
Docker, environment-based configuration

Outcomes

Only results that are documented are listed here.

  • Delivered on schedule with a complete client handover
  • AI generation that inserts editable, catalog-valid fields into a real builder
  • Tenancy with roles and plan limits enforced at the API
  • Approvals and analytics that make collaboration and usage measurable

Lessons learned

  • Constrain the model to your product's vocabulary. A fixed catalog turns unreliable output into a validation problem.
  • Show generated work before committing it. A preview step is cheap and removes most of the distrust.
  • Build tenancy and plan limits into the first version. They shape the data model too much to add later.
  • AI Product Development: Taking an AI product from idea or prototype to production-ready software: architecture, backend, frontend, integrations, testing and deployment.

More case studies

Working on something similar?

If your product has the same kind of constraints, I am glad to talk through how I would approach it.

Or email sarmadkhalique001@gmail.com