Skip to content

zurez/shakespoc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shakespoc

Pokemon described by Shakespeare

Prerequisite

The following softwares are needed to run the project

Tech Stack

Client: Node,React, MaterialUI, Axios

Server: Node, NestJs, Typescript, Axios

Integration Test: Cypress, Mocha, Typescript

API Reference

Get pokemon by name

  GET /pokemon/{pokemonName}
Parameter Type Description
pokemonName string Required. The pokemon name

Run Client locally for development

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

Client would be available at http://localhost:3000

Run Server locally for development

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

Server would be available at http://localhost:3001

Run project via docker on production

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

Project can be accessed via browser on http://localhost:3000

Running Tests

Running unit tests on client

To run tests, run the following commands

cd into the client directory

cd client

run tests

npm run test

Running integration tests on project

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

Environment Variables

To run this project, no Environment variable is needed.

Optimizations

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

ToDo

  • 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published