- Frontend URL: https://rn-iii-frontend.eks-test-default.mpg-chm.com
- Backend URL: https://rn-iii-backend.eks-test-default.mpg-chm.com
Development environment is defined in docker-compose-dev.yml
file. To simplify
docker-compose usage, one can set docker-compose-dev.yml
as an environmental
variable in .env
file: COMPOSE_FILE=docker-compose-dev.yml
.
Set up the development environment (it can take several minutes first time):
docker-compose -f docker-compose-dev.yml up
NOTE: you can use --build
flag to rebuild images and -d
to run in detached
mode.
To run only the backend containers one can use the following command:
docker-compose -f docker-compose-dev.yml up -d database fastapi
Stop everything and remove all volumes:
docker-compose -f docker-compose-dev.yml down --volumes
- React: http://localhost:9000/
- Storybook: http://localhost:6006/
- FastAPI: http://localhost:5000/
- Swagger UI FastAPI: http://localhost:5000/docs
Create the virtual environment in the backend folder:
# cd backend
python3 -m venv venv
source venv/bin/activate
python3 -m pip install --upgrade pip
pip --no-cache-dir install -e .
pip install -r requirements_pytest.txt
Run pytest:
cd backend/app
# set the environment variables
export BACKEND_USER=admin
export BACKEND_PASSWORD=admin
# run pytest
python -m pytest -vv -s
See pytest docs for more details.
apiTypes.ts
file is generated in the server.py
each time FastAPI server is
restarted and then copied in frontend src
folder.
Useful commands to clean up the system:
docker system df # check disk usage
docker system prune --all --force # clean up unused images and volumes
docker system prune --volumes --force # clean up unused volumes
- Frontend and backend pipelines are triggered by the parent
pipeline
.gitlab-ci.yml
. - In order to run two separate pipelines from the same repo, we need to copy the
content of
frontend
andbackend
folders to the root of the repo before running the corresponding child pipeline (.gitlab-ci-frontend.yml
or.gitlab-ci-backend.yml
). frontend
folder should be deleted before thebuild
stage of the.gitlab-ci-frontend.yml
pipeline. This is necessary to avoid typescript errors when building the frontend.