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.
- Run the following commands:
git clone https://github.com/riverrun/phauxth-example.git
cd phauxth-example
- Get dependencies:
mix deps.get
- Build the javascript assets:
(cd assets && npm install && node node_modules/brunch/bin/brunch build)
- Set up the database:
mix ecto.setup
- Set up the bamboo email library (see below)
- 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
- Get dependencies:
mix deps.get
- Set up the database:
mix ecto.setup
- Set up the bamboo email library (see below)
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.
- To start your Phoenix server, run
mix phx.server
oriex -S mix phx.server
- you can now visit
localhost:4000
from your browser
- you can now visit
- To run tests, run
mix test
- To reset the database, run
mix ecto.reset