@lucaapp/service-utils
TypeScript icon, indicating that this package has built-in type declarations

1.65.1 • Public • Published

service-utils

service-utils is a shared package that provides functionality for backend services to reduce code duplication. It includes utilities for:

  • Logging and monitoring
  • API validation and OpenAPI documentation
  • Error handling
  • Database operations
  • Authentication and authorization
  • Kafka messaging
  • HTTP client operations
  • And more

Development Setup

  1. Navigate to packages/service-utils
  2. Run yarn link
  3. Navigate to services/backend
  4. Run yarn link @lucaapp/service-utils

This will connect your local sources for @lucaapp/service-utils. When making changes:

  1. Run yarn build in packages/service-utils to compile changes
  2. Run yarn package-development in services/backend to test changes

Required environment variables for local development:

export DB_HOSTNAME=localhost
export KAFKA_BROKER=localhost:9094
export REDIS_HOSTNAME=localhost

Ensure your docker stack has database, kafka, and redis running (but not backend).

Available Scripts

  • yarn build - Compile TypeScript to JavaScript
  • yarn ts:check - Type check without emitting files
  • yarn lint - Run ESLint
  • yarn test - Run tests with Vitest
  • yarn test:coverage - Run tests with coverage report
  • yarn test:ci - Run tests in CI environment
  • yarn audit - Run security audit (ignoring dev dependencies)

Publishing

The package is automatically published when changes are merged to dev. Follow semantic-release conventions in commit messages to trigger appropriate versioning.

Dependencies

The package uses modern versions of key dependencies:

  • TypeScript 5.5.3
  • Node.js 18
  • Express 4.21.2
  • Sequelize 6.32.0
  • Zod 3.22.3
  • Vitest 3.0.5 for testing

See package.json for a complete list of dependencies.

Readme

Keywords

none

Package Sidebar

Install

npm i @lucaapp/service-utils

Weekly Downloads

4,352

Version

1.65.1

License

Apache-2.0

Unpacked Size

132 kB

Total Files

126

Last publish

Collaborators

  • christopher.kruegelstein
  • duncanluca
  • philipp.berger
  • mtroskot