| title |
| Development workflow documentation |
Getting started
Prerequisites
Install:
- Git
- Docker Desktop or Docker Engine with Docker Compose
- Node.js, but only if you want to run frontend or backend commands directly on your host
Clone the repository and initialize both Git submodules:
$ git clone https://gitlab.cs.ut.ee/devops/teams/provisioners/discourse
$ cd discourse
$ git submodule update --init
$ docker compose up --build
This starts up development stack with hot-reloadable servers for both frontend and backend.
- Frontend is available at
http://localhost:5173
- Backend is available at
http://localhost:5000
- Swagger UI is available at
http://localhost:5000/api-docs
- Postgres DB is available at
localhost:5432
- Garage object-storage administration UI is available at
http://localhost:8080
- Garage S3 API is available at
http://localhost:3900
Testing, linting, and formatting
The commands below are run separately from the backend and frontend directories. Install Node.js and npm if running them locally, then run npm install once in each directory.
The frontend linting and formatting checks also run automatically in GitLab CI for merge requests and the default branch. See the separate DevOps pipeline documentation for details.
Run tests in backend repository:
npm test
Run linters in backend and frontend repositories:
npm run lint
or
npm run lint:fix
Run formatters in backend and frontend repositories:
npm run format:check
and/or
npm run format:write
Useful Docker commands
Stop the containers while preserving database and Garage data:
docker compose down
To remove the containers and persistent volumes as well, but it deletes local database and object-storage data:
docker compose down -v