Skip to content
/ base_ash_template Public template

Base template for new projects with some common stuff implemented

Notifications You must be signed in to change notification settings

collava/base_ash_template

Repository files navigation

AshBaseTemplate

Base project using Ash and Phoenix, with authentication, authorization, email sending, security for apis, error tracking and more.

Features

  • Github actions setup for all checks and deployment to Fly.io
  • Formatters configured
  • Authentication and authorization samples
  • Protected admin
  • Simple User roles
  • Automatic version update, tag and release creation.
  • Dependabot and Renovate setup for all dependencies (pick 1)
  • Honeybadger and Sentry and in project error tracking

After cloning

Install pre-commit

https://pre-commit.com/#install

Rename all folders and modules according to your project

Get dependencies

mix deps.get

Setup the database

mix ash.setup

Test pre-commit

pre-commit run --all-files

Start the project

mix phx.server

Pre commit to run:

  • Dialyzer
  • Sobelow
  • mix format
  • credo
  • mix tests, with bash script to only run tests related to modifications we have done

Other features:

  • Oban for background jobs, and ObanLiveDashboard for monitoring.
  • Error tracking / reporting using Tower.
  • Email sending with Swoosh.
  • Auth using AshAuthentication.
  • Security for APIs with OpenApiSpex and Plug.Cors.
  • Error reporting with TowerErrorTracker.
  • Testing with ExUnit, Mneme, Mox, and Smokestack.
  • Code quality with Credo, Styler.
  • Security scanning with Sobelow, Hammer and MixAudit.