Files
3dverse-testtask/README.md
T
2023-06-13 14:05:09 -04:00

1.4 KiB

3Dverse test task

Solution

Technology choosen

  1. deno instead of nodejs as platform.
  2. deno kv for database.
  3. nix flake as build system

Development environment

If the developper has nix flake installed. nix develop will install all the system dependencies. Otherwise, deno is required; hey, and psrecord are two useful tool to benchmark the server.

Running the tests.

The best way to build the test is to run nix build .#test which will output a report in ./result. Otherwise, deno test --unstable --allow-read=tests tests should run all the tests.

Running the project.

The main file to run the server is src/server.ts. To command line deno run --unstable --allow-net src/server.ts will run the server locally. One can add the flag --v8-flags=--max-heap-size=50 to limit the allowed memory to, in this example, 50mb.

In a similar fashion, it is possible to run the application without checking out the code using the command line

deno run  --v8-flags=--max-heap-size=50  --unstable --allow-net https://gitlab.com/didiercrunch/3dverse-testtask/-/raw/master/src/server.ts

Architecture

sequenceDiagram
    title: Persist file
    client->>RestAPI: HTTP request
    RestAPI->>FileService: Persist file metadata
    FileService->>BlobService: Persist file