refactor(config): use secret files in dev mode

- Refactor `config/dev.exs` to use `config/dev.secret.exs` instead of
  fetching the SMTP information from the environment and using hardcoded
  database credentials. This is useful when different developers have
  different database credentials and they use different SMTP adapters
- Add a sample `dev.secret.exs` in `config/dev.secret.sample.exs`. Also
  gitignore the origin `dev.secret.exs` file
- Add instructions on how to setup the config file for development in
  `README.md`
- Add `Plug.Swoosh.MailboxPreview` plug on "/mailbox" route in
  development mode for easier development with e-mails

Signed-off-by: Akshit Garg <garg.akshit@gmail.com>
This commit is contained in:
Akshit Garg committed 2021-08-21 16:47:31 +05:30
1 parent 74ed02c4da
commit 12ec98d15e
5 files changed
+35 -36

No files matched your search

+2
View File
@@ -2,6 +2,8 @@
To start your Phoenix server:
* Copy `config/dev.secret.sample.exs` to `config/dev.secret.exs`
* Fill in the SMTP and database configuration in `config/dev.secret.exs`
* Install dependencies with `mix deps.get`
* Create and migrate your database with `mix ecto.setup`
* Install Node.js dependencies with `npm install` inside the `assets` directory