mztariq / TrueLayer.Pokedex.Service

True Layer Rest Api Test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TrueLayer.Pokedex.Service

some_text

To run the application you can use few different tools.

Dockerised app

To run the app as dockerised image go to the root directory of where you have cloned the repo from command line/powershell/vscode terminal, etc.

  • Run below command to build an image docker run --rm -it -p 5000:80/tcp truelayer-pokedex-service:latest Screenshot 2021-10-26 at 01 08 06

  • Run below command to run app docker run --rm -it -p 5000:80/tcp truelayer-pokedex-service:latest Screenshot 2021-10-26 at 01 10 08

  • Access the browser on this address http://localhost:5000/swagger/ to view swagger or you can simply use the HttPie to test the API. (below we have section to show to to test using HttPie as well)

Visual Studio 2021

In visual studio you can open the .sln (solution file) file and set the Api project as startup as below steps:

1- Api project

Screenshot 2021-10-26 at 01 13 03

2- Set as startup

Screenshot 2021-10-26 at 01 13 19

3- Run the application either using IS express or Kestrel as below option (which should launch the api's swagger docs

Screenshot 2021-10-26 at 01 13 37

4- Swagger docs

Screenshot 2021-10-26 at 01 17 15

You can also use swagger to to the testing of the Api of can use Httpie for command line testing.

HttPie testing results as below:

TrueLayer Pokedex

VS Code

You can also use vs code to run the application. Easiest way is to install docker extension and build docker image from there.

Future Improvements

There are few improvements which I can think are important to go live with this service.

  • BDD Test (specflow, cucumber, etc.)
  • Add more loggin
  • Add resilience (polly to check api down and circut breaker)
  • Add Caching (redis cache or local storage cache)
  • Authentication/Authorization (depends how sensitive data it is, P1, P2, etc.)
  • CI/CD deployment using Github actions
  • Rate limiter (how many http call per sec or minutes can go, etc.)

About

True Layer Rest Api Test


Languages

Language:C# 99.0%Language:Dockerfile 1.0%