OSS-first docs

These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.

AI index

Data & Backend

A collection of robust, platform-agnostic libraries for building the backend infrastructure of your LSSM applications.

Libraries

@lssm-tech/app.cli-database

Prisma Wrapper & CLI. Provides a unified way to manage database schemas, migrations, and clients. Includes seeders and factory patterns for testing.

@lssm-tech/lib.bus

Type-Safe Event Bus. Decouple your architecture with typed events. Supports in-memory dispatch for monoliths and can be extended for distributed message queues (Redis, SQS).

@lssm-tech/lib.logger

High-Performance Logging. Optimized for Bun and structured JSON output. Includes plugins for ElysiaJS to log HTTP requests automatically.

@lssm-tech/lib.contracts-spec/results

Standardized Errors. Build a `ContractProblem` with `contractFail` (standard codes like `NOT_FOUND`, `UNAUTHORIZED`, `CONFLICT`) and `throw new ContractSpecError(...)` for consistent HTTP status and error handling across services.

@lssm-tech/lib.exporter

Data Export. Generate CSV and XML files from your data. Platform-agnostic and streaming-friendly.

Example: Unified Backend Flow

import { logger } from '@lssm-tech/lib.logger';
import {
  ContractSpecError,
  contractFail,
} from '@lssm-tech/lib.contracts-spec/results';
import { db } from '@lssm-tech/app.cli-database';
import { EventBus } from '@lssm-tech/lib.bus';

export async function createUser(email: string) {
  logger.info({ email }, 'Creating user');

  const existing = await db.user.findUnique({ where: { email } });
  if (existing) {
    throw new ContractSpecError(
      contractFail('CONFLICT', undefined, { detail: 'User already exists' })
        .problem,
    );
  }

  const user = await db.user.create({ data: { email } });

  await EventBus.publish('user.created', { userId: user.id });

  return user;
}