Code Monkey home page Code Monkey logo

cats-test's Introduction

Getting Started

  1. Install dependencies using yarn.
  2. Copy .env.sample to a file named .env and fill in your thecatapi.com API key.
  3. Run the project using yarn start or npm start.
  4. Run tests using yarn test or npm test.

Dev Notes

  • I chose not to use Redux for this. Mainly due to the application's size, but also as Redux comes with a lot of unnecessary boilerplate... plus its main functionality is now built in to React via useReducer and the context API. For a larger, more complicated application I would most likely opt to use Redux, as it has better support for async dispatches and memoised selectors (plus the dev tools are great).
  • The API key is not hard coded into the application, but rather injected as an environment variable (as defined in the 12 Factor App).
  • Generally for a larger-scale application, I would organise the codebase in a modular fashion (organising based on business need rather than file type). As this application is so small (and will never need to scale), it didn't make sense to architect it like that as it would add confusing boilerplate.
  • The main testing strategy here is to focus heavily on integration tests, with unit tests being used for testing complicated logic (which wasn't necessary for this demo). The benefit of focusing on integration tests means your tests are more resilient to refactors as you aren't testing every implementation detail. Generally this means your tests are more efficient so more time can be spent on features.

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.