To start your Phoenix server:
- If using Docker Compose, run commands inside the
webcontainer (e.g.,docker compose exec web mix setup). - Run
mix setupto install and setup dependencies. - Start Phoenix endpoint with
mix phx.serveror inside IEx withiex -S mix phx.server.
Now you can visit localhost:4000 from your browser.
To test it with curl
curl -X POST "http://localhost:4000/api/v1/metric" -H "Content-Type: application/json" -d '{
"short_name": "example_metric",
"graph_value": 43,
"reporter": "dummy_reporter"
}'
mix format
mix credo
mix dialyzer
mix sobelow --skip
MIX_ENV=test mix test
- Description: A web interface for displaying stored metric graphs. It provides a visual representation of the collected data, including the status of each graph (e.g., whether the latest metric value is within the defined min/max range). This is a Phoenix LiveView page.
This project exposes the following API endpoints:
- Description: This endpoint is used for receiving and storing metric measurements.
- Method:
POST - Content-Type:
application/json - Request Body Example:
{ "short_name": "example_metric", "value": 43 }
To "deploy" see https://dev.to/hlappa/development-environment-for-elixir-phoenix-with-docker-and-docker-compose-2g17