mztariq / PokeFun

Pokedex REST API built using ASP .NET

Home Page:https://kaioq8froi.execute-api.eu-west-2.amazonaws.com/Prod

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

image

Simple Pokedex REST API, built using ASP .NET Core and AWS Lambda!

Description

The PokeFun API contains two endpoints:

  • pokemon/{name} : The endpoint will send a GET request to the PokeApi, which will respond with standard information regarding the pokemon {name}. Since we are not interested in most of the resources it returns, we expose a simple Model that contains only four fields: The Name of the Pokemon, the Habitat where it lives, a Description of the Pokemon, and finally if Is_Legendary or not.

  • pokemon/translated/{name}: This endpoints returns the same fields as the previous endpoint, but with the description "translated" - If it's a legendary pokemon, or its habitat is "cave", then it performs a Yoda translation. Otherwise, it will perform a Shakespeare translation. This is done using the yoda translator and the shakespeare translator.

⚠️ WARNING: To maintain the service level, the funtranslation API ratelimits the number of API calls to only 60 API calls a day with distribution of 5 calls an hour. Therefore, if you exceeded the number of API calls, you don't get a translation at all - it simply returns the standard description.

How to use

Easier than ever - simply use the following URL and add the API endpoints defined above!:

https://kaioq8froi.execute-api.eu-west-2.amazonaws.com/Prod

(I know - the URL is a bit ugly, maybe we could pay for a domain in Route53, but that means ... 💸💸💸).

Example Endpoint I:

Request:

https://kaioq8froi.execute-api.eu-west-2.amazonaws.com/Prod/pokemon/mewtwo

Response body:

{ 
  "habitat": "rare", 
  "is_legendary": true, 
  "name": "mewtwo", 
  "description": "It was created by a scientist after years of horrific gene splicing and DNA engineering experiments." 
}

Example Endpoint II: Yoda Translation:

Request:

https://kaioq8froi.execute-api.eu-west-2.amazonaws.com/Prod/pokemon/translated/mewtwo

Response body:

{
  "habitat": "rare",
  "is_legendary": true,
  "name": "mewtwo",
  "description": "Created by a scientist after years of horrific gene splicing and dna engineering experiments,  it was."
}

Example Endpoint II: Shakespeare Translation:

Request:

https://kaioq8froi.execute-api.eu-west-2.amazonaws.com/Prod/pokemon/translated/geodude

Response body:

{
  "habitat": "mountain",
  "is_legendary": false,
  "name": "geodude",
  "description": "Did find in fields and mountains. Mistaking those folk for boulders, people oft grise or trippeth on those folk."
}

Future Improvements

Obviously, the project can be improved quite a lot in different areas. And that's cool, because it means room for improvement!

I wrote main ideas inside the Project window in Github, but I'll list them here too:

  • API performance improvement, via caching or
  • Authentication & Authorization via token, to avoid exhausting 3rd party APIs or malicious activity using the AWS Lambda.
  • Unit test and TDD
  • CI/CD deployment using Github actions

About

Pokedex REST API built using ASP .NET

https://kaioq8froi.execute-api.eu-west-2.amazonaws.com/Prod


Languages

Language:C# 97.2%Language:Dockerfile 2.8%