Tech Notes for Hack Week

For Hack Week, we're going to attempt to bring Phoenix LiveView into Lucidboard to create a snappy, interactive experience for our users. This post is just some notes to help us in the room.

phoenix_live_view_example

phoenix_live_view_example has many great hints as to how LiveView works. I found the easiest way to get it going is to clone, then:

  1. Open config/dev.exs, find the Demo.Repo config at the very bottom, and add port: 9977.
  2. Launch a postgres instance with docker run -v demo_db_data:/var/lib/postgresql/data -p 9977:5432 --restart=always --name=demo_db -d postgres
  3. Follow the other setup instructions in the example repo's README.md.
  4. Launch the app! (iex -S mix phx.server) By default, it's accessible at http://localhost:4000

Ignoring SSL Security

In the example repo, you might get an error from hex about ssl certificates. To solve this, export a variable. In fish, use set -x HEX_UNSAFE_HTTPS 1. In bash, use export HEX_UNSAFE_HTTPS=1.

Show Comments