# Activities in Zurich

## Overview

A project for the module DSy (Distributed Systems) in FS 2023. Created by Lukas Gächter and Anian Gabathuler. Our goal is to build a webpage to easily find all kinds of activities (e.g. restaurants, bars, museums) in Zurich. The data is provided by the official [Open Data API](https://data.stadt-zuerich.ch) of the city of Zurich.


## Architecture
Our architecture is built for the following use case:
The user sends a web request from a clients web browser. The request reaches the traefik load balancer. Treafik forwards the request to the web service containers. The web service containers send a request to the api service container, which connects to the db container and returns the data stored in the db. Now the response is sent back to the web browser of the user's client and the page with all information is loaded. 

![Overview of the network architecture of the project](documentation/architecture/dsys_nw_diagram.drawio.png)


## Usage

Run environment (from folder activities-in-zurich/docker)

```
docker-compose up
```

Update API data

```
python3 fetch-data.py 
```

## Requirements
The following five points are the requirements for this project. 

1. Load balancing with scalable service

![traefik UI snippet showing load balancer service and corresponding hosts](documentation/requirements/loadbalancing.png)

2. Failover of a service instance

If one of the Web Service Containers is shut down, the other one responds to the requests, so failover works. 


3. Dockerized and Frontend connects via HTTP/3

![browser dev tools snippet of used protocol version](documentation/requirements/http3.png)

4. Persistant storage (storage does not need to be scalable, but you can build it scalable if you want)

![docker-compose.yaml snippet showing volume of db service](documentation/requirements/persistentstorage1.png)
![docker-compose.yaml snippet showing volume for db data](documentation/requirements/persistentstorage2.png)

5. Use latest stable releases of chosen libraries and frameworks

All images in the dockerfiles have the tag :latest. Therefore, the newest stable version of the image is used. 


