Application Runtime
createApp, lifecycle hooks, app.http server APIs, health checks, CORS, request handling, and request-scoped DI.
TypeScript server foundation with reflected type metadata
corepack yarn add @zyno-io/ts-server-foundation
corepack yarn tsf-installtsf-install configures the TypeScript transform and compiler dependencies. The TSF compiler emits reflected type metadata and compiler-recognized annotation markers used by DI, HTTP parameters, config classes, entities, validation, and OpenAPI generation. See Getting Started for the manual configuration.
import { BaseAppConfig, createApp, createDatabase, http } from '@zyno-io/ts-server-foundation';
class AppConfig extends BaseAppConfig {
APP_ENV = 'development';
}
@http.controller('/hello')
class HelloController {
@http.GET()
hello() {
return { ok: true };
}
}
class AppDatabase extends createDatabase('mysql', {}, []) {}
export const app = createApp({
config: AppConfig,
db: AppDatabase,
controllers: [HelloController]
});TS Server Foundation owes a great deal to the open-source projects that made its architecture possible. Deepkit inspired many of the design ideas behind its runtime type reflection, dependency injection, and metadata-driven server APIs. We are especially grateful to Deepkit's maintainer, Marc J. Schmidt, for showing how powerful a cohesive, type-aware TypeScript framework can be.
Typia and ttsc provided the essential compiler groundwork for bringing those ideas to TypeScript 7. TSF builds on their type-analysis and transform infrastructure to generate the runtime metadata at the heart of the framework. Our sincere thanks to Jeongho Nam and every contributor to these projects for making that work available to the TypeScript community.