Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/denis256/currency-conversion
https://github.com/denis256/currency-conversion
Last synced: 27 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/denis256/currency-conversion
- Owner: denis256
- Created: 2021-09-04T17:45:29.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-04T20:09:39.000Z (over 3 years ago)
- Last Synced: 2024-10-28T05:17:23.121Z (2 months ago)
- Language: Go
- Size: 34.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Currency conversion API
Small application to convert currencies based on `fixer.io` data.
Tech stack:
* go 1.16
* gorilla mux
* docker
* docker-compose
* make## Project structure
* `api/fixer` - code to query Fixer API
* `convert` - currency conversion code
* `env` - code to work with environment variables
* `http` - HTTP API
* `project` - logical structure for storing projects
* `sync` - logic to query Fixer API and process results
* `docs` - example API calls and example response## Development steps
* `make` - build and run test for application
* `make clean` - clean working directory
* `make test` - run tests and generate coverage results
* `make container` - build docker container with applicationExample API calls can be found in `docs` directory, basic flow:
* Create project and obtain API key
* Query service with API key and exchange payload## Important environment variables
* `FIXER_API_KEY` - API key to access Fixer data, app will fail if missing
* `SYNC_INTERVAL_MIN` - background sync interval of currencies, default 60 min
* `TRACE` - if defined additional logs will be printed in output
* `HTTP_PORT` - listen HTTP portStarting through docker-compose application:
```
FIXER_API_KEY= docker-compose up -d
```## Future work
* CI/CD integration
* Integration tests
* Persistence for projects
* Admin API endpoints
* Example client to API# License
Only for reference