App built using Phoenix and Elixir.
To start Maria's App server 1:
s nix-shell
- Run
mix setup
to install and setup dependencies - Start Phoenix endpoint with
mix phx.server
or inside IEx withiex -S mix phx.server
Now you can visit maria's page at localhost:4000
.
We are using amazon S3 to store images. If you want recipe creation/update to work locally you need to configure a .env file with the AWS credentials see. Basic configuration should look like:
export AWS_ACCESS_KEY_ID="<replace_key_id"
export AWS_SECRET_ACCESS_KEY="<replace_secret_access_key>"
export AWS_REGION="<replace_aws_region>"
1 If you are running the app for the first time you will need to configure the DB and Nix:
- Install nix. If using Arch Linux:
yay -S nix
- Get into your nix environment
nix-shell
, where the correct versions of the packages to run this project are. - Install postgresql and start the service.
- Configure the DB:
mix ecto.create
. nix-shell
β©
We are hosting the app at Gigalixir- a PaaS built for Elixir. We use here the free tier that provides instance with 0.2GB of memory and 1 postgresql database limited to 10,000 rows. See console here.
Steps to deploy (followed this steps earlier):
git push gigalixir
If there are changes in the DB run:
gigalixir run mix ecto.migrate
To see production logs π¬ run gigalixir logs
To connect to prod DB run gigalixir pg:psql
Also π phoenix deployment guides.
Run tests in the project with:
MIX_ENV=test mix test
To only run specific tests add this tag @tag runnable: true
before each test and run:
mix test --only runnable:true
To get into a console with test environment:
MIX_ENV=test iex -S mix
Note: If you wanna use the Logger while executing test, you should use warn level or above (Logger.warn, Logger.error). See test config here
We are using Swoosh [not yet configured live]
To see mailbox in dev go to: http://localhost:4000/dev/mailbox/
or curl: curl http://localhost:4000/dev/mailbox/json
In maria/config/dev.exs
set debug_errors: false
if you want to be able to debug error pages.