# blch challenge task

## Usage

### Clone repository
> If ssh available

```shell
git clone ssh://git@gitlab.ost.ch:45022/ost-study-groups-rc/blch-challenge-task.git
```

> otherwise

```shell
git clone https://gitlab.ost.ch/ost-study-groups-rc/blch-challenge-task.git
```

### Run containers

```shell
docker login --username="<username>" registry.gitlab.ost.ch:45023/ost-study-groups-rc/blch-challenge-task
docker compose pull
docker compose up
```

## Architecture

### Context

![context](./admin/C4%20Model-Context.drawio.png)

### Container

![container HSC app](./admin/C4%20Model-Container%20HSC%20App.drawio.png)
![container blockchain tools](./admin/C4%20Model-Container%20Blockchain%20Tools.drawio.png)

### Components

#### Contract
- solidity
  - openzeppellin

#### Backend
- golang
  - gin
  - go-ethereum

#### Frontend
- svelte
  - typescript
  - shadcn
  - chartjs

#### container
- docker
  - docker-compose
- gitlab ci/cd

## Design decision
- solidity/golang/svelte
  - openzeppelin
  - solidity showcased in lectures
  - golang/svelte because two people are working with it in their SA
- infura over self hosted node
  - easier
- dockerization
  - comfortable platform independent execution
- gitlab
  - ci/cd - gitlab runner
  - gitlab container registry
- gin
  - most recommended
  - lower entry barrier compared to other serve services (for example swaggerui)
- shadcn
  - most recommended
- chartjs
  - most recommended
- uniswap
  - outsourcing because of time constraints
  - tried with sushiswap, but had issues importing our coins
- why usdc?
  - usdc's rate is 1:1 with usd
  - usdc is a low volatility transfer-asset to USD
