# Mine Drive

Is a Web platform for sharing WorldEdit structures with your friends. This project has a focus on high availability of the Web services.

# Start up

You will need to have Docker installed with Linux containers enabled.

```
docker compose up -d
```

The Web application runs on port 80. For database administration, you can use adminer which runs on port 8080.

# Architecture

![Architecture](DSysArch.png)

## PostgreSQL instances

We are using PostgreSQL as our database to store the WorldEdit structures with name, description, and a count of likes. It was chosen due to the familiarity of the team with it.

## Web instances

The Web instances are responsible for serving the Web application and handling Web API requests. The frontend is built with React and Material UI. The backend
is built with Node.js and Express. The web instances can be scaled horizontally.

## Redis instances
Redis is used as broker for Server-Sent Events (SSE) and WebSocket connections. This enables real-time updates for the Web application while allowing the Web instances to scale horizontally.

## HAProxy instance

HAProxy is used as a load balancer for the Web instances. It is configured to balance the load between the Web instances in a round-robin fashion. It checks the health of the Web instances by sending HTTP requests to the `/api/health` endpoint.
