Skip to main content

ApiHelper

The @churchapps/apihelper package provides server-side utilities for all ChurchApps Express.js APIs. It depends on @churchapps/helpers.

What's Included

  • CustomBaseController — base class for API controllers
  • Auth middleware — JWT authentication via CustomAuthProvider
  • Database utilitiesDB.query, EnhancedPoolHelper for MySQL connection management
  • AWS integrations — helpers for S3, SSM Parameter Store, and other AWS services
  • Inversify DI setup — dependency injection container configuration

Setup for Local Development

  1. Clone the repository:

    git clone https://github.com/ChurchApps/ApiHelper.git
  2. Install dependencies:

    cd ApiHelper && npm install
  3. Build the package (compiles TypeScript to dist/):

    npm run build
  4. Make it available for local linking:

    npm link

Key Commands

CommandDescription
npm run buildCompile TypeScript to dist/
npm run lintRun ESLint
npm run lint:fixRun ESLint with auto-fix
npm run formatFormat code with Prettier
info

This package is a dependency of every ChurchApps API. When making changes, use npm link to test against an API locally before publishing.