Case StudyFull-stack buildArchitectureDesign systems

Kyloth

A family of business tools I'm building, organised around everyday work

Client
Kyloth
Role
Own product · In development
Year
2026
Scope
Full-stack build, Architecture
Prabir Singh, profile photoPrabir Singh·8 min read
Screenshot of the Kyloth public website, showing its Commerce introduction and product-family navigation.

Website preview · Product in development

Project
Kyloth, my business software platform in development.
Status
Actively building. Not fully built or launched.
Product family
Commerce, Desk, Table, Clinic and Class, all in development.
Public website
kyloth.com
Architecture
A Next.js application in a Bun and Turborepo workspace, with a shared database package.
Engineering focus
Reusable storefront rendering, merchant-scoped data access and consistent checkout totals.
Availability
The public website introduces the project. The product has not launched, and new sign-ups are not open, as of 23 October 2026.
StackNext.jsReactTypeScriptBunTurborepotRPCTanStack QueryTanStack TableZodPostgreSQLDrizzleBetter AuthRazorpayTailwind CSSCloudinaryPlaywright

I'm building Kyloth as a family of tools for everyday business. It is still in active development, not fully built or launched. This is a look at the work so far and the decisions behind it, not a finished-product launch story.

The plan brings five kinds of business work into one product family. A shop needs to handle orders; a customer team needs to follow up; a restaurant, clinic and school each have their own daily routines. Each product in development has a distinct scope, so a business could eventually start with the one that fits its work.

Visit the Kyloth website

A decision log, not a launch announcement

Decision visible in the implementationWhy it mattersEvidence still needed before release
Share the storefront renderer with theme previewsReduce drift between a preview and the actual storefrontBrowser checks across theme variants and publishing states
Scope merchant access inside a database transactionKeep pooled connections from carrying context into another requestTests using the restricted application role, including rejected cross-merchant operations
Compare checkout display with stored order componentsFind mismatches that a total-only unit test can missRepeatable end-to-end results for payment and recovery paths

The repository contains the implementations and tests described here. This portfolio review inspected their structure; it did not run Kyloth's database or checkout suite. A test file is evidence of the intended verification strategy, not a fresh passing result.

For a small, runnable introduction to state guarantees, the developer field guide walks through duplicate requests and trustworthy selection. Those examples belong to this portfolio; they are not a Kyloth product demo.

Five products in development, five kinds of work

ProductFocus
CommerceProducts, orders, delivery, returns and repeat business.
DeskEnquiries, customer relationships, quotes, support and follow-ups.
TableMenus, stock, kitchen operations, service and bills.
ClinicBookings, queues, patient records, billing and follow-up care.
ClassAdmissions, teaching, attendance, fees and school life.

One application, distinct surfaces

The repository brings the public website, theme discovery, merchant workflows and customer storefronts into a Next.js application. Bun and Turborepo manage the workspace, while shared database and configuration packages provide the foundation.

The server API is organised into tRPC routers for catalogue management, imports, onboarding, themes, store configuration, orders, checkout, customers, inventory, discounts and analytics. Zod validates inputs, and TanStack Query handles client-side data access. This keeps the interface connected to typed operations instead of duplicating request shapes across the browser and server.

The architecture, at a glance

This map shows the commerce implementation inspected on 23 October 2026. These are boundaries inside the current workspace, not a collection of independently deployed microservices. Desk, Table, Clinic and Class are also in development as of 5 November 2026. This earlier commerce map does not document their implementation.

01 / System architectureIn development

Explore left to right · swipe or use arrow keys when focused

Kyloth commerce architecture: two access paths, one shared databaseInside one Next.js application, merchants use the workspace, authenticated tRPC procedures and a restricted tenant transaction. Customers browse the shared storefront renderer, backed by store resolution and explicitly filtered public database reads. Both paths depend on PostgreSQL through the shared Drizzle database package. These are application modules, not separate deployed services.NEXT.JS APPLICATIONBun + Turborepo workspace · application modules01 / MERCHANT OPERATIONS02 / PUBLIC STOREFRONTsessionmerchant IDMerchantSigned inWorkspaceCatalogue · ordersProtected APISession · tRPC · ZodwithTenantRestricted role + RLSpage datastore scopeCustomerPublic accessStorefrontShared rendererStore resolverSlug + access checksPublic readsAdmin role + filtersPostgreSQLDrizzle / shared DBTenant-scoped operationsExplicitly filtered public reads
Read left to right: arrows show dependencies and access paths within the commerce implementation. Merchant operations and public reads reach the same database through different access controls. These modules are not separate deployed services. Source inspected 23 October 2026.

An implementation map, not a launch claim. Arrows show dependencies and access paths; they do not imply separate servers.

The two access paths matter. Merchant operations use a restricted database connection through withTenant. Public storefront reads have no merchant login, so their resolver uses an administrative connection with explicit store and merchant filters and publication/access checks. That path needs its own review; drawing a database box does not magically give every query the same protection.

Authentication and authorised staff access resolve the acting merchant on the server. The database policy then enforces that scope. It cannot decide whether the application chose the right merchant in the first place.

The preview is the storefront

The commerce implementation uses shared rendering components for gallery previews and the storefronts merchants would publish. A theme supplies its content, visual tokens and composition choices. Those choices include header structure, navigation, hero treatment and collection layout, so variation extends beyond changing colours.

Container queries let the renderer respond to the space it actually occupies. The same storefront can sit inside a small gallery preview or fill a browser window. That matters because a preview should demonstrate the product a merchant will publish, rather than a separate mock-up that gradually drifts from it.

Platform styles and storefront styles use separate CSS variable namespaces. A merchant's brand colour belongs to their shop; it should not change the dashboard around it. Cloudinary supplies responsive image delivery through a shared loader.

Tenant isolation belongs in the database

The database package separates administrative access from the lower-privilege connection used for tenant work. Its transaction wrapper sets the merchant identifier locally for each transaction. PostgreSQL row-level security policies use that scope to restrict access.

Making the scope transaction-local is an important detail with pooled connections: one merchant's context must not survive into another request. The repository includes database tests for cross-merchant access and policy coverage, alongside membership tests.

02 / Request sequenceIn development

Explore left to right · swipe or use arrow keys when focused

Merchant request sequence and transaction-local tenant isolationThe browser sends an authenticated request. Server context verifies the session and resolves authorised merchant membership or staff access. A protected tRPC procedure requires that merchant. Within withTenant, PostgreSQL begins a transaction, sets the merchant scope locally and enforces row-level policies on queries. The transaction ends, then the result returns to the browser. Missing authentication or merchant authorisation prevents reaching the protected database operation.BrowserMerchantServer contextSession + membershiptRPC procedureProtected operationPostgreSQLRestricted connectionwithTenant / TRANSACTION01 · authenticated request02 · resolve authorised merchantMembership or authorised staff context03 · require merchant context04 · BEGIN + local merchant scope05 · query → RLS policy check06 · result / transaction ends07 · response to merchantSolid arrow: call / queryDashed arrow: return
The shaded area is one transaction. Merchant scope is local to that transaction, so it does not persist into the next request on a pooled connection. Public checkout validates its own entry path before a tenant-scoped write.

The ordinary merchant request path. Public checkout takes a different entry point: it resolves the merchant from the store slug, rechecks products and prices on the server, then uses withTenant for the order write. Public does not mean “trust the total from the browser.”

Try the rule: requested workspace is not permission

Illustrative TypeScript, written for this article. This is a small membership exercise with fictional workspace IDs, not Kyloth’s production authorisation code.

type Membership = { userId: string; workspaceId: string };
 
function chooseWorkspace(
  userId: string,
  requestedId: string,
  memberships: readonly Membership[],
): string {
  const allowed = memberships.some(
    m => m.userId === userId && m.workspaceId === requestedId,
  );
  if (!allowed) throw new Error("Workspace access denied");
  return requestedId;
}

Give demo-user membership of workspace-a, then request workspace-b. The call should fail. A dropdown selection is a request, not a permission slip.

In a real application, the user identity and memberships must come from verified server-side sources. This example omits staff access, roles, revocation and database transactions. After authorisation, the database policy still needs the correct transaction-local scope. PostgreSQL’s row-security documentation also explains why tests must use the intended restricted role: privileged roles can bypass those policies.

Checkout needs more than a correct total function

Commerce workflows bring together products, variants, inventory, discounts, delivery charges and payment-method rules. A correct calculation in isolation is only one part of the job. The amount shown to a customer must agree with the order the system records.

The Playwright checkout suite exercises that relationship by comparing the displayed purchase with the stored order, including its individual components. Targeted tests also cover stock, discounts, receipt tokens and concurrent checkout behaviour. These are examples of the repository's verification strategy, rather than claims about production transaction volume.

A clear starting point for each business

The public website lets visitors explore each product, compare its scope, and review website designs relevant to their business. Product pages distinguish what visitors can explore today from work still to come. Demonstration storefronts and catalogues are labelled as examples.

The product family also separates access from ownership of records: one login does not automatically grant access to every product or its data. Each product's permissions remain part of its own workflow.

What would make the next stage convincing?

The useful question for a product still being built is not “how many features are listed?” It is “which complete workflow can be trusted?” For Kyloth, I want the commerce path to make sense from merchant setup through storefront preview to an order whose amounts reconcile.

These are acceptance criteria for continued development, not an announcement that every item is complete:

ScenarioEvidence I want before calling it ready
Two merchants create similar productsEach sees and edits only their own records
A request supplies another merchant's identifierMembership and data-access checks reject it
A pooled connection is reusedNo tenant context survives the transaction
A merchant edits a live themeDraft, preview and published state have deliberate boundaries
A payment response is delayed or repeatedThe order remains recoverable without duplicate fulfilment

PostgreSQL's row-security documentation explains an important caveat: table owners and privileged roles can bypass policies. Tests therefore need to exercise the restricted application role, not only an administrative connection. A policy that works only in a diagram is not tenant isolation.

What I am trying to share, and what should stay separate

Five products do not mean five copies of authentication, navigation and infrastructure. Those foundations can be shared. But a patient record, a restaurant order and a school attendance entry have different permissions, retention needs and workflows. I would rather earn a shared abstraction through repeated needs than force all five into one universal record.

That is the tension behind one repository: share stable foundations while keeping domain rules understandable. The buyer-focused product approach supplies the other constraint: each product needs a clear everyday job before the family resemblance matters. OWASP's authorisation guide is a useful companion when designing those boundaries.

Where the build stands

As of 5 November 2026, Commerce, Desk, Table, Clinic and Class are all in development. Kyloth has not launched. The architecture described above reflects work in the commerce implementation, not completed capabilities across all five products or evidence of production usage. The public website introduces the direction; it is not an announcement that the product is ready to use.

Explore the Kyloth product family

ShareXLinkedInFacebook
Prabir Singh, profile photo

Prabir Singh

Full-stack engineer in Mumbai. Twenty years in sales taught me why people buy; seven years of code taught me how to build what they'll pay for. I still read error messages the way I once read objections: as the most honest feedback of the day. More about me or start a project.

More work

Concept illustration of an exploded building model with structural floors, glass facade and a highlighted beam.
Full-stack product engineer·2026

A Whole Building in a Browser Tab

A browser-native BIM platform: heavy IFC building models converted on the server, so anyone can click a wall in the browser and read the exact engineering data behind it. No install, no plugin, no license.

Full-stack buildArchitecture3D / WebGLPerformance
IT Origin live homepage showing its cybersecurity services introduction over a security operations centre video.
Full build and ownership·2026

IT Origin

A cybersecurity firm's whole web presence in one self-hosted Next.js codebase: marketing site, admin CMS, lead engine, and an AI chat desk

Full-stack buildArchitecturePerformanceAI integration