Created by Fábio Leite [email protected] linkedin.com/fabioleitedev
- Docker (https://www.docker.com/)
- Docker Compose (https://docs.docker.com/compose/install/)
- NodeJS >= v14 https://nodejs.org/en/
- 📂 Go to the source folder
/src
- ⚙️ Create the
.env
file following the.env.sample
file. - 📂 Go to the root folder.
- 🏃🏻 Run
./start.sh
- 🚀 Start using the API
- 📂 Go to the source folder
/src
- ⚙️ Create the
.env
file following the.env.sample
file. - 📂 Go to the root folder.
- 🏃🏻 Run
./start-local.sh
- 📂 Go to the source folder
/src
- 🏃🏻 To run tests, type
npm run test
oryarn test
- 🚀 Start using the API
I left a deployment.yaml
as an example to deploy it in K8S.
- Returns characters by name with other characters residing in the same location.
- Send a
GET
request tolocalhost:5000/v1/characters/locations?name=Alan Rails
- Returns characters by name with the first episode that they appeared and other characters that appeard in the same episode
- Send a
GET
request tolocalhost:5000/v1/characters/episodes?name=Rick
- I decided to use
Redis
to cache results in memory, because it's a kind of data that don't change very often. In a microservices approach, would became a cache microservice. - I decided to remove the character search from the list of other characters, avoind data replicated.
- I created a ParseService to handle the transformation of the data comming from the external API to the internal model of the app. In a more complex architecture, we could use some ETL technology or a microservice with this reponsability.