API responsible for making foreign currency quotes for BRL (Brazilian Real).
Run project via Docker, via Visual Studio (F5 or CTRL + F5), Visual Studio Code (tasks project) or CLI.
docker-compose up -d
- Run project
src/Exchange.Rate.API
dotnet watch run
- Run tests
dotnet test -t
GET /quote
curl -X GET "http://localhost:5000/api/v1/exchange-rates/quote?amount=10¤cy=USD" -H "accept: application/json"
GET /conversion
curl -X GET "http://localhost:5000/api/v1/exchange-rates/conversion?amount=10¤cy=USD&customerSegment=PRIVATE" -H "accept: application/json"
For more information visit swagger: http://localhost:5000/swagger/index.html
Step by step to manual deploy using AWS CloudFormation:
- Create Docker image repository
This project uses the AWS ECR (Docker Container Registry) as a Docker image repository. Other repositories can be used, such as the Docker Hub.
- Execute docker-compose file:
docker-compose up -d
Enter the folder scripts/aws/ecr and run the scripts:
- Run script to create AWS ECR:
sh ecr-deploy.sh
- Run script to deploy the AWS ECR image. Necessary to include AWS AccountId as a parameter:
sh image-deploy.sh 999999999999
- Create networks
Enter the folder scripts/aws/networks and run the scripts:
- Run script to create and deploy networks
sh network-deploy.sh
- Create services
Check the status of network creation on AWS CloudFormation. Run this step only when the status is completed: CREATE_COMPLETE.
Enter the folder scripts/aws/services and run the scripts:
- Run script to create and deploy services. Necessary to include AWS AccountId as a parameter:
sh service-deploy.sh 999999999999
The deployment of this project via AWS CloudFormation was based on the following references:
- https://reflectoring.io/aws-cloudformation-deploy-docker-image/
- https://github.com/thombergs/code-examples/tree/master/aws/cloudformation/ecs-in-two-public-subnets
aws cloudformation delete-stack \
--stack-name exchange-rate-api-service
Run delete stack service step only when the status is completed: CREATE_COMPLETE.
aws cloudformation delete-stack \
--stack-name exchange-rate-api-network