Complete health challenges with friends.
This is a very experimental project in its early stages. It is currently under casual development by just myself in my spare time.
TODO(Arie): List features / roadmap once I ship a janky-but-working prototype.
The project is developed with Postgres, Elixir, Phoenix, and LiveView.
- Install correct Elixir/Erlang versions in
.tool_versions
withasdf install
. - Copy
.env-template
to.env
and fill in environment variables. Then,source .env
to set in shell. - Install dependencies with
mix deps.get
- Assuming you already have Postgres installed, create and migrate your database with
mix ecto.setup
. - Start Phoenix endpoint with
mix phx.server
or inside a REPL withiex -S mix phx.server
Now you can visit localhost:4000
from your browser.
- Run all tests with
mix test
- Run a specific test with
mix test test/open_book_web/view_utils_test.exs
- This project takes advantage of elixir doctests which are an easy way to write tests in documentation. Refer to view utils to see an example.
I deploy on fly.io. I mostly followed the simple instructions on the Phoenix fly deploy guide.
Some helpful commands:
-
fly deploy
-
fly status
-
fly logs
(tail) -
fly ssh console
- Will require
fly ssh issue
first to get ssh certs - Once you have a console,
app/bin/open_book remote
to open up IEX connected to the prod instance. - As always
use IexHelpers
is a helpful macro for getting all common imports. - From there, you have a console to prod, eg:
Repo.all User
...
- Will require
In production we use logflare to retain and analyze our logs. The dashboard is here.
You can enable logging to logflare in dev (to test logs are as expected). Refer to .env-template to see the ENV variable flag to flip. The dev dashboard is here.
You can search in logflare with Logflare Query Language, eg:
m.level:"info"
m.level:"error"
"[EVENT]"
"[EVENT]" m.current_user:<some_user_id>