Skip to main content

System Overview

A Labkit application has three contracts:

  • server runtime contract: Nest GraphQL, auth, config, database, logging;
  • browser runtime contract: Relay, auth state, realtime, theme, routes;
  • GraphQL contract: generated schema plus browser-owned Relay operations.

The server and browser never import each other's implementation files. They meet at GraphQL.

Ownership Map

AreaLabkit ownsApp owns
Auth contractprincipal/payload shapes, bearer helpers, websocket auth namesbusiness auth policy
Server authprovider contracts, guards, sessions, transport helperspassword hasher, JWT service, resolvers
Databaseconfig parsing, manifests, migration safetyDataSource, feature entities, migration execution
GraphQLNest module/context helpersDTOs, resolvers, schema publishing
Relaynetwork, subscription, route preload helpersgenerated operations and route files
Realtimereconnect/watchdog statepub/sub backend and UI
UItheme mechanics, class helpercomponents, tokens, visual design

The reference app demonstrates this split with apps/server, apps/webapp, and a generated GraphQL contract package. Labkit extracts the reusable parts so new apps can start from the same constraints.