API for discovering mobile food facilities written in Elixir using Phoenix Framework and Ecto.
- Required Erlang and Elixir versions can be found in
.tool-versions
- Install dependencies with
mix deps.get
- View dependency tree with
mix deps.tree
- View outdated dependencies with
mix hex.outdated
Create and migrate your database withN/A since Ecto is not being used with a database.mix ecto.setup
- Start Phoenix endpoint with
mix phx.server
or inside IEx withiex -S mix phx.server
Run mix phx.routes
to view all routes available.
Now you can visit localhost:4000/api/v1/facilities/
from your browser to access the API.
View the Phoenix Live Dashboard from your browser.
Ready to run in production? Please check our deployment guides.
This example is used to illustrate an application written in Elixir using Phoenix and Ecto (with a databases-less schema).
Ecto is used to demonstrate schema and changeset usage and validation while not requiring a database. The Repo
in this case is actually an external Mobile Food Facility Permit API, but a database could easily be integrated.
- http://localhost:4000/api/v1/facilities
- http://localhost:4000/api/v1/facilities/735318
- http://localhost:4000/api/v1/facilities/types
- http://localhost:4000/api/v1/facilities/search?latitude=37.76785244271805&longitude=-122.41610489253189&radius=1000 (radius in meters)
- http://localhost:4000/api/v1/facilities/search?q=hamburgers&latitude=37.76785244271805&longitude=-122.41610489253189 (no radius will default to 1000 meters defined in compile time
config.exs
)
- 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
- Cleanup auto-generated views, tests, fixtures, ecto, etc.
- Add health check
- Add distance to location-baseed search results
- Add tests
- Use a database and/or cache (Redis, :ets)
- Filter on
status: "APPROVED"
only? - Add
Dockerfile
andentrypoint.sh
- Make
MobileFoodService.MobileFoodFacilities.FacilityType
more generic for other name/value pairs of data and resources like names, food items, cities, etc.