My App
BoardKitBackend

Backend Overview

Overview of the @hfu.digital/boardkit-nestjs package

The @hfu.digital/boardkit-nestjs package provides a complete backend for collaborative whiteboards in NestJS applications.

What's Included

ComponentDescription
BoardModuleNestJS dynamic module for registration
BoardServiceBoard and page CRUD operations
CollaborationServiceRealtime session management with state machine
PermissionServiceRole-based access control (viewer/editor/owner)
AssetServiceFile upload with size and type validation
ExportServicePNG, SVG, and PDF export
BoardStorageAbstract storage interface for boards, pages, elements, members, shares
AssetStorageAbstract storage interface for file uploads
EventLogStorageAbstract storage interface for event logging and snapshots
BoardAuthGuardAbstract authentication interface
PrismaBoardAdapterPrisma storage adapter
BoardGatewaySocket.IO WebSocket gateway for realtime collaboration
5 REST ControllersBoard, Page, Asset, Export, Share endpoints
Rate LimiterPer-user message rate limiting middleware
Size GuardRequest body size limiting middleware
Testing UtilitiesInMemoryBoardStorage, InMemoryAssetStorage, InMemoryEventLogStorage, MockAuthGuard

Peer Dependencies

{
    "@nestjs/common": "^10.0.0 || ^11.0.0",
    "@nestjs/core": "^10.0.0 || ^11.0.0",
    "@nestjs/websockets": "^10.0.0 || ^11.0.0",
    "@nestjs/platform-socket.io": "^10.0.0 || ^11.0.0",
    "rxjs": "^7.0.0"
}

Quick Start

import { Module } from '@nestjs/common';
import { BoardModule } from '@hfu.digital/boardkit-nestjs';

@Module({
    imports: [
        BoardModule.register({
            storage: myBoardStorage,
            assetStorage: myAssetStorage,
            eventLogStorage: myEventLogStorage,
            authGuard: myAuthGuard,
        }),
    ],
})
export class AppModule {}

See Module Setup for the full configuration reference.

On this page