jclem / template-phoenix

A template for Phoenix apps on Fly.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Phoenix App Template

This is a template repository for Phoenix apps deployed to Fly.io.

This app has a default name and module, "PhxAppTemplate" and a script in script/rename for changing it.

Provide a module name followed by an app name to rename it:

$ script/rename MyApp my_app

To enable deployments:

  • Create a Fly app
  • Set ADMIN_USERNAME/ADMIN_PASSWORD secrets
  • Set DATABASE_URL secret
  • Set RELEASE_COOKIE secret (using mix phx.gen.secret is fine)
  • Set FLY_API_TOKEN repository secret
  • Un-comment the deployment job in .github/workflows/ci-deploy.yml and update its environment URL

To start your Phoenix server:

  • Run mix setup to install and setup dependencies
  • 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.

Additions

  • Libcluster on Fly.io
  • LiveDashboard enabled via basic auth in production
  • script/observer for opening observer on the running app
  • Other small ergonomic changes (e.g. use PhxAppTemplate, :schema, see phx_app_template.ex)

Learn more

About

A template for Phoenix apps on Fly.io


Languages

Language:Elixir 69.9%Language:HTML 20.4%Language:Shell 2.9%Language:Dockerfile 2.7%Language:JavaScript 2.5%Language:TypeScript 1.4%Language:CSS 0.1%