Skip to content

likes-gay/dict

Repository files navigation

Dict

Site

See it live: https://dict.likes.gay

This site is hosted in a Docker container on a Raspberry Pi.

About

Frontend

  • Written in TypeScript
  • Compiled using the first job in the GitHub Action

Backend

  • Written in Python
  • FastAPI used to run the API and serve static files
  • TinyDB used to store the words

GitHub Actions

  • Compiles the TypeScript
  • Compiles Docker Image
  • Pushes to Docker Hub

How to run

Production

The easiest and most secure way to run this is using our offcial Docker image.

  • Make sure to replace the SECRET_KEY in the command
  • The default port it runs on is 8000. Change the first port to change the host port.
  • The volume sets where the database file should be stored, so it persits. This defaults to the directory the command is run in.
  • The detach argument runs the container in the background.
  • The name argument sets the name
docker run -e SECRET_KEY="SET_SECRET_KEY_HERE" --publish 8000:8000 --volume $(pwd)/dict-data:/backend/dict-data --detach --restart always --name Dict likesgay/dict

The Docker container can automatically be updated to the latest image using Watchtower.

Dev

  1. Run npm run build:dev in frontend
  2. Run uvicorn main:app --reload in backend

We also have a dev branch.

And dev_run.sh installs all the dependencies and runs those commands.