- Add a
.envfile in the root of the project to set the DB env variables:
export DB_NAME=
export DB_HOSTNAME=
export DB_USER=
export DB_PASSWORD=- Run
source .env
source .env- Install dependencies:
mix deps.get- Create the database and populate it:
N.B the env variables above should be valorized. If you have done it now re-run the source .env command
mix arke.init- Create your first project:
mix arke_postgres.create_project --id $PROJECT_NAME- Create the all the data (arkes,parameters,groups) written in the
*.jsonfiles underlib/registry/
mix arke.seed_project --project $PROJECT_NAME- Create a super admin member
mix arke_postgres.create_member --project $PROJECT_NAME - If you did not set a username and a password, use the credentials below to access the app:
username = admin
pwd = admin
- Start Phoenix endpoint inside IEx:
iex -S mix phx.server- If it is necessary clean old deps (
for local developement):
mix deps.update --all- Enjoy your app on
localhost:4000
There is a folder rel which is the output of the mix phx.gen.releae command.
To know more about phoenix releases see.
The release written above is used to create the docker image of our app. In order to do so run:
docker build -t your/tag --build-arg MIX_ENV=yourenv .Once the docker image has been built you need these variables to make it work:
DB_NAMEDB_HOSTNAMEDB_USERDB_PASSWORDRELEASE_NAMESECRET_KEY_BASErunmix phx.gen.secretSECRET_KEY_AUTHrunmix guardian.gen.secretHEADLESS_SERVICE_NAME
The docker image created is meant to be used in a kubernetes environment.
If you want use it somewhere else please edit the runtime.exs file accordingly.
Look for the libcluster topologies and set the right strategy.
Remember to edit also the env.sh.eex file which export RELEASE_NODE=phoenix_starter@${POD_IP}, where POD_IP is inherited from the k8s pod.
To use the mailer you must set the following environment variables:
export MAIL_APIKEY=
export MAIL_DOMAIN=
export MAIL_DEFAULT_SENDER=- Then run
source .envto update the system environment variable - Edit the file
mailer.exto use your templates
To create your own email template override the send_email function and create your email struct using the options available.
Then run the deliver(email)
To enable SSO for arke look for the SSO section in the config.exs.
You will find the below configuration:
ArkeAuth.SSOGuardianis responsible for the creation of the jwt token used for the signup process.ArkeServer.Plugs.OAuthis where you will define all the provider you want enable.
The configuration is composed as follows:
google: {ArkeServer.OAuth.Provider.Google, []}
<provider name>: { <Strategy Module>, [ <strategy options> ] }
ArkeServer provide differents provider like:
google: ArkeServer.OAuth.Provider.Google
facebook: ArkeServer.OAuth.Provider.Facebook
apple: ArkeServer.OAuth.Provider.Apple
github: ArkeServer.OAuth.Provider.Github
If you want to create our own strategy edit the PhoenixStarter.Provider.MyProvider as you like
and then use it in the configuration.
If you are glad to support us and contribute to the developement of Arke:
- clone the repo you want:
- Add to your
.envfile the path of the cloned package:
export EX_DEP_${REPO_NAME}_PATH="PATH_TO_CLONED_REPO"
example EX_DEP_ARKE_POSTGRES_PATH="/path/to/arke_postgres/folder"- Run the commands in the linked section. If you have previously installed the dependencies use the
cleancommands before install the deps again. (Use thecleanalso if you do not see your changes locally)
By adding the EX_DEP_{REPO_NAME}_PATH variable you are able to use the arke's packages cloned locally.
- Official website: https://www.phoenixframework.org/
- Guides: https://hexdocs.pm/phoenix/overview.html
- Docs: https://hexdocs.pm/phoenix
- Forum: https://elixirforum.com/c/phoenix-forum
- Source: https://github.com/phoenixframework/phoenix