-
Notifications
You must be signed in to change notification settings - Fork 1
Deployment diagram
It's as easy as running npm run build
(don't forget npm install
when using it for the first time).
See here for npm installation and this for instructions to set up nvm.
To run the API locally, clone this repository on your computer. Next, set up the back-end docker container with the following commands:
cd be/docker/
docker-compose up --build
or docker-compose up -d --build
to run it in the background.
Note that running the docker container in the background requires running docker logs
to view the logs.
If you encounter any errors regarding migrations
run the following commands while the docker container is running:
docker exec -it osoc-be python manage.py makemigrations
docker exec -it osoc-be python manage.py migrate
Please refer to the docker and docker compose documentation if any other errors occur.
You should now be able to surf to http://localhost:8000/
in your browser or use a cli tool such as httpie to view the API.
The API is built using Django Rest Framework which allows for easy and intuitive navigation. The API is also fully hyperlinked so you can click through every step of the workflow. In the upper right corner you will also see the current possible actions you can take on the current endpoint. On some pages there will also be a form which you can fill in to create or update an object.
To view the API in an interactive UI environment, head to http://localhost:8000/swagger/
. This automatically generated page makes it very easy to see all API endpoints at once. We used swagger and drf-yasg for this. However, for some endpoints Swagger is not sufficient. Usage examples of those endpoints can be found here.
When finished, shut down the docker container by pressing ctrl+C
in the terminal or typing the following command when running it in the background:
docker-compose down
To remove the data you have created use the following command:
docker-compose down --volumes