Giter VIP home page Giter VIP logo

shakespoc's Introduction

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

shakespoc's People

Contributors

zurez avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.