Skip to content

API

Our REST API is built using NestJS. For a quick introduction to NestJS, we recommend this video.

Modular Structure

In Nest, modules are used to organize the application into smaller, manageable pieces. Each module contains a group of related controllers, services, pipes, guards, and filters that all work together to perform a specific function or set of functions.

Controllers handle the incoming HTTP requests, and are responsible for handling the request, validating the inputs, and returning a response. Services are used to encapsulate the business logic of the application, and can be used by multiple controllers.

OpenAPI

The NestJS Swagger module is used to automatically generate the OpenAPI specification for the application. This is stored in
the form of an openapi.json file. In Open Data Capture, this specification is used with redoc to document our core REST API.