Aller au contenu

Architecture

Ce contenu n’est pas encore disponible dans votre langue.

Repository Structure

Open Data Capture is written in TypeScript, with all source code located in a monorepo managed by Turborepo.

  • Répertoire.bruno/
  • Répertoire.github/
  • Répertoire.husky/
  • Répertoireapps/
    • Répertoireapi/ A REST API built using NestJS (“Core API”)
    • Répertoiregateway/ An Express application with React SSR
    • Répertoireoutreach/ A static site built with Astro (this website)
    • Répertoireplayground/ A React SPA for building instruments
    • Répertoireweb/ A React SPA for internal platform access
  • Répertoireblog/
  • Répertoiredocs/
  • Répertoirepackages/
    • Répertoirecrypto/
    • Répertoiredemo/
    • Répertoireesbuild-plugin-runtime/
    • Répertoirei18next/
    • Répertoireinstrument-bundler/
    • Répertoireinstrument-interpreter/
    • Répertoireinstrument-library/
    • Répertoireinstrument-renderer/
    • Répertoireinstrument-runtime-env/
    • Répertoireinstrument-stubs/
    • Répertoireinstrument-utils/
    • Répertoirejson-utils/
    • Répertoirelicenses/
    • Répertoireprisma-client/
    • Répertoirereact-core/
    • Répertoireruntime-resolve/
    • Répertoireschemas/
    • Répertoirestats/
    • Répertoiresubject-utils/
    • Répertoiretailwindcss/
    • Répertoirevite-plugin-plausible/
    • Répertoirevite-plugin-runtime/
  • Répertoireruntime/
    • Répertoirev1/
  • Répertoirescripts/
  • Répertoiretesting/
    • Répertoirek6/

Applications

The outreach website and playground are not relevant to the general functionality of the platform as such and are not discussed further. The other three components are independent of each other, in so far as they could be replaced with an alternative providing equivalent interfaces without impacting the functioning of other services.

Internal Packages

Within the packages directory, there are a variety of different internal packages. A given package may depend on one or more other internal packages, which is indicated in the package.json file located in the root of the directory for that package.

Databases

Open Data Capture uses two databases:

  1. A MongoDB database (also referred to as “Core Database”)
  2. An SQLite database (also referred to as “Gateway Database”)

Predictably, the Core Database is used to store almost all application data and is accessed exclusively by the Core API, while the Gateway Database is used to store encrypted data stored on the gateway.

In both cases, schemas are defined using Prisma and stored in the packages/prisma-client folder. This package exports both schemas, which can later be consumed by the appropriate application. The purpose of this setup is to allow other libraries to consume the autogenerated type definitions for the database schemas, as well as to prevent clashing between the different Prisma clients in node_modules.