Skip to content

camino-school/lanttern

Repository files navigation

Lanttern

To start your Phoenix server:

  • Run mix setup to install and setup dependencies
  • source .env
  • Start Phoenix endpoint with mix phx.server or inside IEx with iex -S mix phx.server

Now you can visit localhost:4000 from your browser.

Ready to run in production? Please check our deployment guides.

.env expected variables

export GOOGLE_CLIENT_ID="********"
export ROOT_ADMIN_EMAIL="[email protected]"

Localization

We use Gettext for localization.

mix gettext.extract # to extract gettext() calls to .pot
mix gettext.merge priv/gettext # to update all locale-specific .po

Currently supported locales are en (default) and pt_BR.

git_hooks issue

We need to run mix git_hooks.install before commiting for the first time. See this issue

Deployment

We're currently running Lanttern on fly.io, connected to a managed Supabase Postgresql database, and we use GitHub Actions for automation.

The main secrets/env vars that we need for this are the following:

On GitHub

  • FLY_API_TOKEN for each environment

On fly.io

From Supabase

  • DATABASE_HOST - used in repo's ssl_opts server_name_indication
  • DATABASE_SSL_CERT - using \n string for line breaks
  • DATABASE_URL
  • SUPABASE_PROJECT_API_KEY - used for Supabase client (interface with Storage)
  • SUPABASE_PROJECT_URL - also used for Supabase client (interface with Storage)

From Google

  • GOOGLE_CLIENT_ID

Others

  • PHX_HOST - e.g. lanttern.org
  • SECRET_KEY_BASE - Phoenix generated

Learn more