Skip to content

k-komarov/passbase-currency-api

Repository files navigation

Currency conversion API

Currency conversion API is a GraphQL API that provides a small service converting Euro to US Dollar and vice-versa.

Access to convert is protected with Access Key that can be generated by creating a new project:

mutation {
  createProject(project: {name: "Project"}){
    name
    accessKey
  }
}

To access convert query use project's accessKey as an Authorization header:

convert(from: EUR to: USD amount: 10) {
  timestamp
  rate
  result
}

Example

1. Tech stack

  • Golang
  • GraphQL
  • Docker
  • Docker Compose

2. Dependencies

External golang packages

External services


3. Contribution

Use https://github.com/99designs/gqlgen to get basic knowledge

3.1. Development

  1. Do change in .graphqls files
  2. Run generator to generate new or update code according to new schema
$ make regenerate
  1. Implement resolvers according to your needs

3.2. Running locally

Execute command

$ make run

Run the playground in browser: http://localhost:3000

3.3. Running Unit Tests

Execute command

$ make test

4. Containerized environment

To build a container Docker and Docker-Compose has to be installed:

To run an application using docker-compose use next command:

$ docker-compose up

Run the playground in browser: http://localhost:3000

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages