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 currently use TypeORM to manage mapping data to database models.
Reading materials
Must read:
Intro to routing-controllers: https://github.com/typestack/routing-controllers
Intro to class-validators: https://github.com/typestack/class-validator
Intro to TypeORM: https://typeorm.io/
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?