---
# System prepended metadata

title: README

---

# README

## Docker Deployment

We use a single docker container for deploying front- and backend.
The backend is used to serve the frontend which is a singular `index.html`. All static files are served under `/`, while requests to the API are routed over `/api`.

### Building

The frontend is built via `npm build` as we create the image, and the compiled assets are served statically by our backend.

Since the backend doesn't need to be compiled, the sources are simply copied into the image and then started by an ASGI server, namely [`uvicorn` ](https://www.uvicorn.org/). 

### Running

The docker container can be started via

```
docker run -it --rm -p 8000:8000 fenedor/waecm-2021-group-18-bsp-1:1.0.0
```

and the SPA can then be accessed by loading `localhost:8000`. 

## Technology Stack
### Backend
In the backend we use `Python 3.9` with the `fastapi` micro-framework which handles the rest communication. `fastapi` has a lot of stars on github and is said to be one of the new up and coming python rest-frameworks, which is why we decided to check it out for this project.

* `python`
* `fastapi`, micro-framework
* `flake8`, for running linting on the server codebase.
* `mypy`, for checking type hints in the server codebase.
* `black`, for formatting the server codebase.
* [`uvicorn` ](https://www.uvicorn.org/), for running the backend application.
*  [`poetry`](https://python-poetry.org/), for managing dependencies and virtual environments.

### Frontend
We decided on the well-established `react` framework for our frontend, which all of our teammembers have experience with.

* `typescript`
* `react`, powering the whole SPA.
    * Supported by Typescript, to achieve the best type-safety possible with `react`.
* [`bulma`](https://bulma.io/)
    * We chose this framework because it is a pure css framework (no javascript) and easy to use with predictable behaviour.
* `eslint`, which can be run via `npm run lint`.
* `prettier`, to format the client codebase.
* `npm`, for bundling assets and providing a development server useful for development.

### Database

We decided to use postgres SQL as it offers a document store as well as structured queries. As we do not know what we are going to need exactly over the course of this project we deemed this the most suitable solution because of its flexibility. Additionally we, as a team, have made good experiences with this technology.