Skip to content

Documentation

@zyno-io/ts-server-foundation is a TypeScript server foundation for HTTP APIs, dependency injection, configuration, database access, workers, SRPC, logging, telemetry, and development tooling.

The TSF compiler emits reflected type metadata used by validation, OpenAPI, routing, DI, config, and database schema extraction. Application code should use the TSF APIs documented here.

Core Docs

DocumentDescription
Feature OverviewCapability map, architecture boundaries, operational model, and links to every detailed feature guide.
Getting StartedInstallation, app creation, module options, DI, lifecycle, and environment requirements.
Public APIPackage export surface, root imports, OTel bootstrap imports, and app.http boundary.
Dependency InjectionProviders, scopes, request contexts, module exports, and controller/service lifecycle.
ConfigurationBaseAppConfig, Env, env-file loading, child-process env preservation, and built-in config keys.
EnvironmentEnv, snapshots, process-env conversion, config loading behavior, and test patterns.
DatabaseMySQL/PostgreSQL database layer, active record, sessions, transactions, raw SQL, locks, and schema tools.
SQLSQL fragments, bindings, identifiers, joins, rendering, and trusted raw SQL escape hatches.
MigrationsMigration files, schema diffing, migration runner, reset, charset, and CLI options.
HTTPHTTP router, explicit request parameter annotations, multipart uploads, raw streaming, and responses.
UploadsMultipart parsing, FileUpload, temporary-file cleanup, cached body reads, and raw request streams.
OpenAPIRoute/schema serialization, explicit query/body rules, ApiResponse<T, Status>, and generation commands.
AuthenticationJWTs, request helpers, auth middleware, basic auth, password hashing, and reset tokens.
Health Checks/healthz, HealthcheckService, custom checks, and request logging.
LoggingPino logging, pretty output, context data, request logs, and error reporting.
TypesRuntime and schema type annotations, including DB/OpenAPI effects for custom types.
Type ReflectionPublic runtime reflection, annotation readers, custom validators/deserializers, and shared aliases.
Type Reflection ArchitectureCompiler metadata policy shared by validation, OpenAPI, and database extraction.

Services

DocumentDescription
WorkersBullMQ-backed workers, in-process execution, cron scheduling, recording, and DI-owned job handlers.
RedisRedis options, cache, mutex, broadcast channels, distributed methods, and BullMQ prefixes.
DevConsoleDevelopment dashboard for routes, OpenAPI, requests, SRPC, DB queries, mutexes, and workers.
SRPCWebSocket RPC with generated proto types, authentication hooks, bidirectional calls, and byte streams.
Leader ServiceRedis-backed leader election.
MailDI-registered SMTP/Postmark mail service and templates.
Mesh ServiceRedis-backed cross-node typed messaging and broadcasts.
Mesh Client TrackingCross-node client registry, invocation, and SRPC mesh integration.

Utilities And Operations

DocumentDescription
HelpersAsync context, promises, objects, JSON, streams, crypto, validation, dates, errors, UUIDs, and Redis helpers.
TelemetryOpenTelemetry bootstrap, span helpers, metrics endpoint, shutdown, and Sentry helpers.
TestingTesting facade, mock HTTP requests, isolated test databases, seed hooks, and assertion helpers.
CLI Toolstsf, tsf-dev, application REPLs, tests, migrations, protobuf generation, and app scaffolding.
ReleaseBuild, test, OpenAPI generation, package contents, tarball inspection, and publish checklist.
Documentation MaintenanceHow to keep the docs aligned with implementation changes.

Released under the MIT License.