@saltsquareio/nestjs-backend-platform
v0.2.0
Published
NestJS platform library
Readme
@saltsquareio/nestjs-backend-platform
Reusable NestJS platform library for SaltSquare backend services: configuration, database + migrations, logging, HTTP client, health, exceptions, rate limiting, scheduling, audit logging, auth primitives, WebSocket tokens, observability, and an optional AI module.
Pre-1.0 (
0.x). Every release may contain breaking changes — pin an exact version.
Install
npm install @saltsquareio/nestjs-backend-platformMost capabilities are framework-aligned peer dependencies (install the ones your
app uses — @nestjs/*, typeorm, pino, etc.). The AI stack (ai, @ai-sdk/*,
mem0ai) and newrelic are optional peers.
Quick start
// main.ts
import { initialize } from '@saltsquareio/nestjs-backend-platform';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await initialize(AppModule);
await app.listen(process.env.PORT ?? 3000);
}
void bootstrap();// app.module.ts
import {
ConfigurationModule,
DatabaseModule,
LoggerModule,
HealthModule,
} from '@saltsquareio/nestjs-backend-platform';
@Module({
imports: [
ConfigurationModule.forRoot(),
LoggerModule,
DatabaseModule.forRootAsync(),
HealthModule,
],
})
export class AppModule {}The AI module is imported from a subpath so its heavy deps stay optional:
import { AiModule } from '@saltsquareio/nestjs-backend-platform/ai';
// AiModule.forRoot({ defaultModel, safety, summarization, costRates, memory })Documentation
- Configuration — env model, namespaces, defaults, extension
- Database — config, overridable defaults, transactions
- Migrations — the
platform-dbCLI and what the lib vs consumer owns - Modules — catalogue of what the library provides
- AI — providers, memory, cost, safety, summarization (business-agnostic)
- Releasing — conventional commits + release-please
License
MIT — see LICENSE.
