https://github.com/dropdevrahul/exchange-rates-go
Wrapper for https://exchangeratesapi.io/
https://github.com/dropdevrahul/exchange-rates-go
Last synced: 3 months ago
JSON representation
Wrapper for https://exchangeratesapi.io/
- Host: GitHub
- URL: https://github.com/dropdevrahul/exchange-rates-go
- Owner: dropdevrahul
- Created: 2023-07-22T07:25:38.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-22T13:33:19.000Z (over 2 years ago)
- Last Synced: 2023-09-05T03:18:55.750Z (over 2 years ago)
- Language: Go
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Exchange Currencies Rate
A go utility/library to fetch currencies using [exchangeratesapi.io](https://exchangeratesapi.io/)
Please register on this site to get an API Key
## Dependencies
- Database
- [sqlx](https://github.com/jmoiron/sqlx) to connect to db
- [goose](https://github.com/pressly/goose) for migration
- [lib-pq](https://github.com/lib/pq) as database driver
- Please install goose globally to run migrations using
```
go install github.com/pressly/goose/v3/cmd/goose@latest
```
## Run
- copy .env.example file to .env and replace API_KEY with your own which can be obtained by the linked website above
- Start the db using docker, please make sure docker is allowed to create /var/db/data directory, create the directory /var/db/data using sudo
```
sudo mkdir -p /var/db/data
sudo chown -R $USER:$USER /var/db/data
docker compose up -d
```
- Migrate the Database
```
make migrate-db
```
- Run the command
```
make run
```
This should fetch the details from the API and save them to DB and display the results from DB