Skip to content

Latest commit

 

History

History
71 lines (48 loc) · 2.31 KB

CONTRIBUTING.md

File metadata and controls

71 lines (48 loc) · 2.31 KB

Contribution guidelines

Prerequisites

Quick start

npm ci
npm run dev

Docker is required: nginx, simple-directory and mongo run in containers; the api and the ui run in the terminal (Ctrl+C stops them, their logs are in dev/logs/). The app is available at http://localhost:5950/events/dev.

Then, in another terminal:

npm test

Pull images at first and then once in a while:

docker compose --profile '*' pull

Run the development servers

The UI is a Vue project built with Vite.

The API is a small Express server.

The default ports (5950-5957) are in dev/default.env, copied to .env the first time: .env overrides dev/default.env and is never overwritten. npm run dev-deps only starts the containers (extra arguments go to docker compose, e.g. npm run dev-deps -- --profile maildev); npm run dev accepts the same arguments.

Each dev process has its own npm script and reads its settings from environment variables (every key of dev/default.env): npm run dev-setup (idempotent builds, no container), then npm run dev:api and npm run dev:ui, each in its own terminal with the variables of .env exported. The production names (MONGO_URL, PRIVATE_DIRECTORY_URL...) override the development config. DEV_LOG_DIR (default dev/logs) and DEV_LOG_PREFIX set where npm run dev writes the logs of the processes.

The fixed ports mean one environment per machine: stop the containers of one checkout (npm run stop-dev-deps) before starting another.

To send notifications in the dev environment you can edit and run send-notifications.ts, with the organization that sends them and optionally the user shown as their originator:

npm run dev-send-notifications -- <organization id> [<user id>]

Working on types

Update the types based on schemas:

npm run build-types

Building docker images

Build images:

docker build --progress=plain --target=main -t data-fair/events:dev .