Saltcorn code base
The core Saltcorn code base is located in the Saltcorn GitHub repository. This is a monorepo, meaning that it contains multiple packages, in the
packages/ directory. The monorepo is managed by the lerna tool, which helps to tie together and synchronise the different packages, and the npm package manager which installs dependencies.
The most important packages are:
This package is the core of the project and it deals with the definition of entities (tables, fields, pages etc.) and their persistence to a database.
tags module which exports functions that generate HTML.
Defines the routes and the core HTTP server process, which handles both the administration and serving data to the user. The Saltcorn server is based on the express framework.
Code for the command line interface executable
saltcorn based on the oclif commandline framework.
This uses a library called chaos-guinea-pig to randomly test applications. The idea is to randomly click links, submit forms on a website before we encounter a error with code >=400.
Design by Contract
A lot of the code uses a design by contract library called contractis to annotate functions and to check their arguments and return values.
Run tests with the
run-tests cli command.
The full test suite is outlined in the GitHub action https://github.com/saltcorn/saltcorn/blob/master/.github/workflows/nodejs.yml. This consists of:
- the full run-tests suite, including the puppeteer e2e tests, against PostgreSQL
- The automated python security test, https://github.com/saltcorn/saltcorn/tree/master/infosec-scan/py-sectest
- The saltcorn-data and server package test against SQLite