API

The API is built on routing-controllers, a lightweight framework that gives controllers validation and type safety. It uses class-validator and class-transformer to manage deserializing and validating request data.

We are considering moving to TsED.io which looks better maintained and seems to have better features for automatically generating documentation. It is also based on class-validator and class-transformer so migration shouldn't be too hard 🤞

We currently use TypeORM to manage mapping data to database models.

Reading materials

Must read:

Optional:

Structure

The codebase is broadly split into a few different parts

  • beabee core

    Shared between all services (API, webhooks and legacy)

    ./src/core
    ./src/models - Data models and database entities
    ./src/config - Config loader
  • API service

    ./src/api
  • Webhook service

    Handlers for webhooks from beabee's integrations (currently GoCardless, Mailchimp and Stripe)

    ./src/webhook
  • Legacy app

    This is slowly being removed, with business logic being moved into the API and frontend into the new frontend.

    ./src/apps
    ./src/static
    ./src/views
  • Tools

    Various tools for administration, including nightly cron jobs

    ./src/tools
  • Database migrations

    Autogenerated by TypeORM

    ./src/migrations

Last updated

Was this helpful?