Skip to content

Instantly share code, notes, and snippets.

@zachdaniel
Last active September 5, 2023 12:28
Show Gist options
  • Save zachdaniel/85ffae949efb0766601969092abb92f6 to your computer and use it in GitHub Desktop.
Save zachdaniel/85ffae949efb0766601969092abb92f6 to your computer and use it in GitHub Desktop.
Useful links and snippets for Ash Training

Welcome!

This is a small cheat sheet that contains some useful links and commands. Thank you for joining us on this adventure!

Link to project repository: https://github.com/ash-project/quix

Schedule

This schedule is flexible, and certain sections may go longer or shorter depending on how things go and how the group is doing.

8:30 AM - 10:00 AM
  • What is Ash?
  • Project setup
  • Intro to resources
10:00 AM - 10:30 AM Break
10:30 AM - 12:00 PM
  • Actions, actions, actions!
  • Building your core logic
12:00 PM - 1:30 PM Lunch
1:30 PM - 3:00 PM
  • APIs
  • Authentication
  • UIs
3:00 PM - 3:30 PM Break
3:30 PM - 5:00 PM
  • Security
  • Adding your own extensions
  • Incremental adoption

Setup

git clone git@github.com:ash-project/quix.git

asdf Version Manager

# confirm your setup
mix deps.get
mix compile
mix ecto.create

Branches

Each branch is named after the section that was just completed. We start on main.

If you want to commit your work before changing branches:

git add -A
git commit -m "Following along with class"

And then you can checkout the next branch

git checkout intro-to-resources-1
git checkout actions-actions-actions-2
git checkout apis-authentication-uis-3

Useful commands

# fetch dependencies
mix deps.get

# compile your application
mix compile

# create your local database and migrate it
mix ash.setup

# migrate your local database
mix ash.migrate

# drop, recreate, and migrate your local database
mix ash.reset

AshAuthentication

Tutorial

Gist: UserAuth, after setting up AshAuthentication

Gist: Guessing LiveView

Generating a LiveView

mix ash_phoenix.gen.live Quix Quix.Quiz --plural-name quizzes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment