Currency quote service with async API for fetching exchange rates.
- Go 1.25+
- Docker & Docker Compose
- Make
# 1. Copy environment file
cp .env.example .env
# 2. Edit .env and set your API key from https://exchangeratesapi.io
# 3. Start services
docker compose up -d
# 4. Run locally (alternative - requires local postgres)
make runAPI Endpoints:
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/quotes | Request a quote update |
| GET | /api/v1/quotes/requests/{id} | Get quote by request ID |
| GET | /api/v1/quotes/latest?base=EUR"e=USD | Get latest quote for pair |
# Basic request
curl -X POST http://localhost:8080/api/v1/quotes \
-H "Content-Type: application/json" \
-d '{"base_currency": "EUR", "quote_currency": "USD"}'
# With idempotency key
curl -X POST http://localhost:8080/api/v1/quotes \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
-d '{"base_currency": "EUR", "quote_currency": "USD"}'curl http://localhost:8080/api/v1/quotes/requests/<request-id>curl "http://localhost:8080/api/v1/quotes/latest?base=EUR"e=USD"make test
make generate