Skip to content

Development and Contributing

Kieran edited this page May 22, 2024 · 8 revisions

Pinchflat is written in Elixir - a functional programming language that runs on the Erlang VM. It uses the Phoenix web framework and SQLite for the database. The frontend is mostly normal server-rendered HTML with a little Alpine.js as-needed.

Elixir is a personal favourite of mine and is ideal for building fault-tolerant systems. It's also a joy to work with and has a great community. If you're interested in contributing, I'd be happy to help you get started with Elixir - just open an issue with some questions and we can chat!

Local setup

  • docker compose build --no-cache
  • docker compose up -d && docker attach pinchflat-phx-1
  • After a few minutes the app should be accessible at localhost:4008
    • Please let me know if you run into any hiccups here - I haven't had to bootstrap the app from scratch in a long time and I might have forgotten something
  • Media downloads and config will be stored in the tmp directory. Not the OS's /tmp directory, but the one in the root of the project

Running tests and linting

  • Open a shell with docker compose exec phx bash
  • Run mix test to run the tests
  • Run mix check to do a full testing, linting, and static analysis pass

Top tips

  • Look for any module that ends in *_worker.ex - these are where the interesting stuff happens and you can trace back from there to see how the app works. lib/pinchflat/slow_indexing/media_collection_indexing_worker.ex is a good place to start
  • There is a database ERD that's stored at priv/repo/erd.png

Clone this wiki locally