2022-06-26
Admin

Create the first administrator

The SAAS Starter Kit comes with an administration (admin) area. This Post shows you how to get create the first admin and login.

There are two ways to setup the first administrator.

  1. Through the web interface
  2. Though the IEX console

Create an admin through the web interface

To create the initial admin in the webinterface, all you have to do is to start the server and visit /admin.

Since you are not logged in, you will be prompted with an info message informing you that there is no current admin. Type the email address and press "CREATE AND LOGIN". You will get an autogenerated password that you can change in the admin pages.

Create an admin through the IEX console

Open up the console for your app by typing:

iex -S mix

and type:

MyApp.Admins.GenerateAdmin.generate_admin("my_email@example.com")

Note that you need to replace MyApp with the name of your app. Also, in this case, there will be an autogenerated password.