An open API service indexing awesome lists of open source software.

https://github.com/matsjfunke/diet_code

fullstack react/fastapi web app about my passion for deleting code
https://github.com/matsjfunke/diet_code

axios docker docker-compose fastapi react traefik

Last synced: 3 months ago
JSON representation

fullstack react/fastapi web app about my passion for deleting code

Awesome Lists containing this project

README

          

# Diet Code

a web app that ranks developers productivity based on amount of deletions and spreads the gospel of deleting code

## Run locally

```sh
docker-compose up --build
```

**Backend:**

- access localhost:8000/docs for fastapi dashboard -> for testing specific endpoints
- access localhost:8000/openapi.json to generate the OpenAPI documentation

**Frontend:**

- access localhost:3000 and interact with the UI

## Deployment on Server

```sh
# rsync files to server
cd diet-code
rsync -av --exclude-from='.rsyncignore' -e "ssh -i ~/.ssh/" . @:diet-code

# ssh into server

ssh -i ~/.ssh/diet-code root@

# use the deployment script to automate docker & docker-compose installation, and starting docker containers
chmod +x deploy.sh
./deploy.sh
```

go to https://diet-code.dev/taste and try to taste the diet code ranking for any public repo with contributors (try: https://github.com/matsjfunke/psychopy-install-setup)

to stop containers use:
```sh
docker-compose -f docker-compose.prod.yml down
```

### Deploy on VPS with another webapp running

to deploy diet-code along with another webapp on one server use `docker-compose.prod.shared.yml`

```sh
# Build the images
docker-compose -f docker-compose.prod.shared.yml build

# Connect Traefik to the diet-code network
# Network name is prefixed with directory name (diet-code_) by Docker Compose
docker network connect diet-code_diet-code-web traefik

# Start the services
docker-compose -f docker-compose.prod.shared.yml up -d
```