Skip to content

@zyno-io/dk-server-foundationServer Foundation Library

TypeScript foundation library built on Deepkit for building robust server applications

DevConsole Dashboard

Quick Start โ€‹

bash
npm install @zyno-io/dk-server-foundation
# or
yarn add @zyno-io/dk-server-foundation
typescript
import { createApp, BaseAppConfig, createMySQLDatabase } from '@zyno-io/dk-server-foundation';

class AppConfig extends BaseAppConfig {
    MY_SETTING!: string;
}

class MyDB extends createMySQLDatabase({}, [UserEntity]) {}

const app = createApp({
    config: AppConfig,
    db: MyDB,
    cors: config => ({ hosts: ['https://example.com'], credentials: true }),
    controllers: [UserController],
    providers: [UserService]
});

app.run();

DevConsole Screenshots โ€‹

The built-in DevConsole provides a comprehensive development dashboard:

Dashboard โ€‹

DevConsole Dashboard

Routes โ€‹

DevConsole Routes

OpenAPI Schema โ€‹

DevConsole OpenAPI

HTTP Requests โ€‹

DevConsole Requests

SRPC โ€‹

DevConsole SRPC

Database โ€‹

DevConsole Database

Health Checks โ€‹

DevConsole Health

Mutex Monitor โ€‹

DevConsole Mutex

Interactive REPL โ€‹

DevConsole REPL

Workers โ€‹

DevConsole Workers

Features at a Glance โ€‹

  • Application Factory: createApp() sets up Deepkit with opinionated defaults
  • Configuration: Environment-based config with @zyno-io/config integration
  • Database: Extends Deepkit ORM with MySQL/PostgreSQL support, transaction hooks, and session locks
  • HTTP: Custom kernel with middleware, CORS, uploads, and error handling
  • Workers: BullMQ background job processing with @WorkerJob() decorator
  • SRPC: Bidirectional WebSocket RPC with HMAC authentication
  • Leader Election: Redis-based distributed leader election for single-instance tasks
  • Mesh Networking: Typed RPC between distributed application instances
  • Mail: Email via Postmark or SMTP with template system
  • Telemetry: OpenTelemetry and Sentry integration
  • Testing: Comprehensive test utilities and fixtures
  • CLI Tools: REPL, provider invoke, migration commands, and more

License โ€‹

MIT License - see LICENSE for details.

Released under the MIT License.