Base URL
3000. You can override it with the COFFEE_HTTP_PORT environment variable before starting the server.
Request format
All requests that include a body must set theContent-Type header to application/json.
OpenAPI spec
A machine-readable OpenAPI specification is served at runtime:Authentication
No authentication is required. This is a local demo application intended for development and learning purposes.Error response format
All errors use Effect’s tagged error schema. Every error response is a JSON object with a_tag discriminant field that identifies the error type, along with additional fields that are specific to that error.
_tag | HTTP status | When it occurs |
|---|---|---|
DrinkNotFoundError | 404 | The requested drinkId does not exist in the menu |
OrderNotFoundError | 404 | No order with the given orderId exists |
InvalidOrderInputError | 400 | The request body or query parameters failed validation |
InvalidOrderStatusTransitionError | 409 | The requested status transition is not allowed for the order’s current status |
InternalAppError | 500 | An unexpected error occurred inside the server |
Hello world: health check
The fastest way to verify the server is running is to call the health endpoint:Endpoint groups
The API is organized into three groups.Health
A single liveness check endpoint that confirms the server is reachable.
Menu
Read the full list of available drinks, their customization options, and base prices.
Orders
Place orders, list and retrieve orders by ID, and advance an order through its lifecycle.
All endpoints at a glance
| Method | Path | Description |
|---|---|---|
GET | /health | Server liveness check |
GET | /menu | List all menu items |
POST | /orders | Place a new order |
GET | /orders | List orders, optionally filtered by status |
GET | /orders/:orderId | Get a single order by ID |
POST | /orders/:orderId/start-brewing | Transition order to brewing |
POST | /orders/:orderId/mark-ready | Transition order to ready |
POST | /orders/:orderId/pick-up | Transition order to picked-up |
POST | /orders/:orderId/cancel | Transition order to cancelled |