Skip to content

About

The task board of the team: a hyperlane server with an euv page.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

org-hyperlane-taskboard

A task board built with the Hyperlane server framework and the euv UI framework.

The server keeps the tasks of the board in memory and answers them through a small JSON API. The browser page of the board is a WebAssembly application of the euv framework that draws itself with the components of the euv-ui component library.

The stack

Part Crate What it does
Server hyperlane The HTTP server, its routes, its middleware and its hooks
Page euv, euv-ui The reactive UI of the browser page and the components it draws itself with
Build euv-cli, wasm-pack Builds the page into WebAssembly and into the static resource directory of the server

The layout of the repository

application/    the layers of the server: controller, service, repository, domain, model, view
bootstrap/      the wiring of the server: environment, logger, database, configuration, server
config/         the constants of the server
plugin/         the plugins of the server: environment, logger, database, process, shutdown
resources/      the static assets, the SQL scripts, the images and the environment files
frontend/       the browser page: the shared crate and the page packages
frontend_build/ the helpers of the build script that builds the pages
tests/          the end to end tests and the audit of the interface

The API of the board

The board answers every endpoint with the same envelope: the business status code, the message that describes the result, the payload and the timestamp of the answer.

Method Path What it does
GET /api/task/list The tasks of the board, narrowed by the filters of the query string
POST /api/task/create Writes a task on the board
GET /api/task/stats The counters of the board
GET /api/task/get/{id} One task of the board
POST /api/task/update/{id} Changes one task of the board
POST /api/task/delete/{id} Removes one task of the board

The filters of the list endpoint are status, priority, assignee and search. A filter that names something the board does not know is refused rather than answered with every task, so a caller never reads an empty board as an empty filter.

Running the server

The server reads its configuration from resources/env/dev/server.env in a debug build and from resources/env/release/server.env in a release build. The environment of the process overrides the file, so the port can be changed without touching the file:

SERVER_PORT=65011 SERVER_HOST=127.0.0.1 cargo run

The page of the board is then on http://127.0.0.1:65011.

The build of the server builds the page with it, so the page of the board is served as soon as the server starts. The build of the page needs the euv-cli command line interface and wasm-pack on the path:

cargo install euv-cli --version 0.32.6 --locked
cargo install wasm-pack --version 0.15.0 --locked

The build of the page is skipped when EUV_FRONTEND_SKIP is set, and the binary that builds the pages can be named with EUV_CLI.

The tests

The server carries its tests in application/tests, and the page carries its tests in frontend/pages/taskboard/tests:

cargo test --workspace --all-features
cd frontend && cargo test --workspace --all-features

The end to end tests drive a running server through a browser and live in tests/e2e. The audit of the interface reads the stylesheet the page really carries and asks the browser for the styles the boxes really have; it lives in tests/ui. Both need a running server and a browser that speaks the Chrome DevTools Protocol:

cargo build --release
SERVER_PORT=65031 SERVER_HOST=127.0.0.1 ./target/release/org-hyperlane-taskboard &
E2E_BASE_URL=http://127.0.0.1:65031 node tests/e2e/run.mjs
E2E_BASE_URL=http://127.0.0.1:65031 node tests/ui/run.mjs

The audit also checks the narrow layout of the page: the metrics stand in two columns, the fields of the form stand in one column and a task stands in one column. The browser is started by the tests themselves. A browser that is already running is used instead when its debugging port is named in E2E_CDP_PORT:

E2E_BASE_URL=http://127.0.0.1:65031 E2E_CDP_PORT=9222 node tests/e2e/run.mjs

The license

The project is released under the MIT license.

About

The task board of the team: a hyperlane server with an euv page.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages