Skip to content

Latest commit

 

History

History
76 lines (51 loc) · 1.87 KB

README.md

File metadata and controls

76 lines (51 loc) · 1.87 KB

Phauxth authentication example Phoenix app

An example Phoenix app using the Phauxth authentication library.

You can clone this repository and use the app as it is, or you can generate it using the Phauxth installer.

Cloning this repo and using the app

  1. Run the following commands:
git clone https://github.com/riverrun/phauxth-example.git
cd phauxth-example
  1. Get dependencies:
mix deps.get
  1. Build the javascript assets:
(cd assets && npm install && node node_modules/brunch/bin/brunch build)
  1. Set up the database:
mix ecto.setup
  1. Set up the bamboo email library (see below)

Using the Phauxth installer

  1. Install the Phauxth installer and run phauxth.new:
mix archive.install https://github.com/riverrun/phauxth_installer/raw/master/archives/phauxth_new.ez
mix phx.new forks_the_egg_sample # or any other suitable app name
cd forks_the_egg_sample
mix phauxth.new --confirm --remember --no-backups
  1. Get dependencies:
mix deps.get
  1. Set up the database:
mix ecto.setup
  1. Set up the bamboo email library (see below)

Setting up bamboo email library

The bamboo email library is configured in the config/config.exs, using the LocalAdapter, and config/test.exs, using the TestAdapter, files.

The LocalAdapter is great for development, but to actually send emails to users, you will need to setup a different adapter. For more information about the available adapters, see the bamboo README.

Useful commands

  • To start your Phoenix server, run mix phx.server or iex -S mix phx.server
  • To run tests, run mix test
  • To reset the database, run mix ecto.reset