Development setup
Folder structure
The benchmark is split into three separate packages:
./: integration tests and linters for Typescript and CSS./app: our React frontend./wrapper: our backend + electron to wrap everything up and build a single binary
Installation
- install NodeJS version
14.xor later - install a C++ compiler and add it to your PATH
- the easiest way to accomplish this on Windows is installing the VisualStudio BuildTools for C++ (+ reboot)
- install Python3 for your distribution
- run
npm installin./,./appand./wrapper
Python3 and C++ are required to build the native extensions for sqlite3.
Running
Manual
- run
npm start-apiin./wrapperto start the backend - run
npm startin./appto start the frontend and open a browser
If you want to start the electron wrapper:
- run
npm run release-appin./to build and copy the app to./wrapper - run
npm run erebuildin./wrapperto recompile the dependencies to the NodeJS version of electron - run
npm run startin./wrapperto start backend and frontend inside electron - run
npm run rebuildin./wrapperto recompile the dependencies back to the global NodeJS version
VSCode
Run the Start Stack compound to start frontend and backend and open Chrome. You can now use breakpoints in ./app and ./wrapper/api.
Building
- run
npm run releasein./to build the frontend and backend and package them in an executable file - the executable will be located at
./wrapper/build/<platform>/
Testing
- run
npm run lintornpm run lint-fixin./to lint the project - run
npm run testin./(integration tests),./app(frontend tests) and./wrapper(backend tests) to test the project - the integration tests require a running instance of the backend and the frontend
- use
npm run test-cito automatically start frontend and backend before running the integration tests
Backend API
The backend API can also be reached directly. Have a look at our REST API specification for details.
Command Line Arguments
The backend supports the following command line arguments:
--storageDirectory path/to/directory: Where the database and configuration files live- default if starting via
npm run start-api:.../wrapper/storage - default if starting via
npm run startor executable: electronsuserDatafolder --inMemory: If present, an in memory database will be used. This increases the performance. Keep in mind that any changes made will be lost when the process is stopped.- default: not present
--hostname example.org: The API will be available on this hostname only.- default:
localhost --port 12345: The API will be available on this port.- default:
8123 --headless: If present, does not show the UI but starts the API directly.- default: not present
--limitMemory 100000000: If present, limit the amount of memory (RAM). The allocated memory grows linear with this number. Incrementing the amount by one will increase the maximum amount of memory by a few bytes to a few hundred bytes.- default: not present
Those arguments can be passed to
npm run startandnpm run start-apiin./wrapper(do not forget to use--to separate thenpmcommand and the arguments)- the built executable file