Feat: Auth Setup Wizard `#discuss`
- Dominant language
- Elixir
- Stars
- 141
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
At present, when a required environment variable is not set, the `auth` (`v1.6.6`) app will not start.
Instead we see an error message of the form:
```sh
09:06:28.149 [error] ERROR: ADMIN_EMAIL Environment Variable is not set
** (FunctionClauseError) no function clause matching in Auth.Person.get_person_by_email/1
The following arguments were given to Auth.Person.get_person_by_email/1:
# 1
nil
Attempted function clauses (showing 1 out of 1):
def get_person_by_email(email) when not (email == nil)
(auth 1.6.7) lib/auth/person.ex:261: Auth.Person.get_person_by_email/1
(auth 1.6.7) lib/auth/init/init.ex:76: Auth.Init.create_admin/0
(auth 1.6.7) lib/auth/init/init.ex:30: Auth.Init.main/0
```
This is a _lot_ better than the _old_ (_cryptic_) error messages we had before [`envar`](https://github.com/dwyl/envar) but it's still lame. 🤦♀️
Someone `new` running the `auth` app on their `localhost` for the first time shouldn't see this kind of thing!!
What we should have _instead_ is:
# Story
As a prospective contributor or deployer of the `auth` project,
I want a Web UI-based Setup Wizard
that _helpfully_ and ***progressively*** guides me
through the process of inputing the required values
So that I _know_ what I need to do to get everything working!
> **Note**: Progressive UI/UX is described in https://github.com/dwyl/product-roadmap/issues/43
# `/init` is _nice_ but not enough ...
At present we have the following "init" page: https://authdemo.fly.dev/init #176

That informs people which environment variables are defined.
This was a make-shift page we created just for our own deployment needs.
But if more people are going to run and _contribute_ to the `auth` app,
the "onboarding" for new devs needs to be _significantly_ streamlined.
# Only 2 Environment Variables Required to Startup
Of the environment variables _currently_ listed on the `/init` page,
the only **two** that are **_really_ needed** are **`DATABASE_URL`** and **`SECRET_KEY_BASE`**.
And even these two _shouldn't_ be required to boot the `auth` app ... 💭
We have demo Apps running on Fly.io that don't use `PostgreSQL` and therefor don't _need_ a `DATABASE_URL` ...
But given that `auth` will _always_ have DB tables in order to _work_ ...
and we know from experience of deploying to Fly.io (_and on `localhost`_)
that the `mix ecto.setup` or `mix ecto.migrate` fails when there is no DB, so the app simply won't boot.
So the `DATABASE_URL` and `SECRET_KEY_BASE` are probably "_baseline_" ... 🙄
OK, Let's operate under the assumption/understanding that these two are the _only_ require environment variables.
And that everything `else` is defined progressively. i.e. when added they "unlock" features in the `auth` App.
Thoughts? 💭
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.