In this project, a restaurant food expiration date supervisioning API was created with Elixir + Phoenix. This project was presented on the Next Level Week #5 from RocketSeat, as was improoved for study purpose.
Among the improovements, you will find:
- Implementing more tests to reach 100% test coverage with
Excoveralls
- Implementing a Factory to improove test readability (Using the lib
ExMachina
) - Implementing a data randomization lib to improove tests (Using the lib
Faker
) - Improoving the error handler
-
Install dependencies with:
$ mix deps.get
-
Create a PostgreSQL database on the default port
5432
(You can change the port on theconfig/config.exs
file if needed)- You can use
Docker
(which i recommend) to create the database. Just run the following command:$ docker run --name exmeal -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres
- You can use
-
Setup and migrate your database with:
mix ecto.setup
-
Start Phoenix endpoint with:
$ mix phx.server #or inside IEx with $ iex -S mix phx.server
Now you can visit
localhost:4000
from your browser.
- 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