Pokemon described by Shakespeare
The following softwares are needed to run the project
- >= Nodev16 [Required]
- Docker [To run project through docker]
- Latest Chrome Browser
Client: Node,React, MaterialUI, Axios
Server: Node, NestJs, Typescript, Axios
Integration Test: Cypress, Mocha, Typescript
GET /pokemon/{pokemonName}
Parameter | Type | Description |
---|---|---|
pokemonName |
string |
Required. The pokemon name |
Clone the project
git clone https://github.com/zurez/shakespoc
Go to the project client directory
cd shakespoc/client
Install dependencies
npm install
Start the server
npm run start
Clone the project
git clone https://github.com/zurez/shakespoc
Go to the project server directory
cd shakespoc/server
Install dependencies
npm install
Start the server
npm run start:dev
Clone the project
git clone https://github.com/zurez/shakespoc
Go to the project directory
cd shakespoc
Build image and run via docker
docker-compose up --build
To build and run only client
docker-compose up --build client
To build and run only server
docker-compose up --build server
To run tests, run the following commands
cd into the client directory
cd client
run tests
npm run test
Docker must be running for the tests to run. Please restart docker to disable any cache if it was already running. Instruction on running project via docker is mentioned above
cd integration_tests
npm install
run tests headless
npm run cypress-run
run tests in browser (Chrome)
npm run cypress
To run this project, no Environment variable is needed.
As we are talking with external api services, therefore it becomes essential
that we keep the api requests to a minimum, and therefore, in this project api caching has been implemented
both on the client and server through axios-cache-interceptor
TTL for cache expiry is 1 hour
- Write unit tests for server
- Add more coverage to unit tests for client
- Improve caching logic
- Better api response on 429 and 404 error from 3rd party apis
- Better documentation
- Reduce docker build time
- Remove boilerplate code
- For integration tests the cache should be reset