GithubHelp home page GithubHelp logo

asquared-react-tech-test's Introduction

react-tech-test

Hey, ASquared! ๐Ÿ‘‹ Thanks for the opportunity

I've written up some quick notes here on what I managed to get through in the suggested time limit.

Instead of dreaming up new features to add, I've mostly worked as though this codebase was about to undergo more development by a larger team. I've tried to set up good practices for automated testing, type checking, linting, formatting, data fetching, accessibility, responsive design etc, and provide strong examples for how further screens/features could be added.

I think if I had more time, I'd have adopted some kind of UI library to handle design tokens and give us components to customise. Currently, I'm using CSS for the basics + media queries, and JSS for per-component style.

What I've Worked On

  • Client-side Routing via react-router
    • Obviously overkill for a 2-page app...
    • but lets us do things like bookmark a detail screen for a beer without crashing the app
  • Fuzzy searching
    • we use Fuse.js to support fuzzy searching over beer names & descriptions...
    • but very easy to extend this so we can fuzzy search over e.g food pairings
  • Solid data management via react-query (caching, automatic retries)
  • Visualising Loading states with a basic animation
  • Error messages for API errors, with error user-friendly messages and a reload button
  • Typescript for compile-time type error checking
    • I worked out a basic type for Beer based on the json responses
  • Jest testing for Components, with code coverage
    • Add the "Coverage Gutters" VSCode extension, run npm run test --coverage
  • A basic design
    • light/dark mode based on the user's OS preference
    • responsive layout (supports mobile devices down to viewport width of about 375)

Code Quality

I've tried to follow good coding practice throughout:

  • I'm checking for type errors at compile-time via typescript
  • Everything is linted and formatted consistently. Works out of the box for VSCode developers.
  • Variable names are descriptive, typically avoiding a bunch of magic numbers (except in JSS)
  • We extract components wherever we're reusing UI across screens (e.g Loading Indicators, Error Messages)
  • Complex functionality is commented in detail (e.g TruncatedLine's css rules)
  • There is support for automated testing and a basic example
  • Errors are handled and explained (failed API requests, empty search results)
  • Project dependencies were checked for vulnerabilities (via npm audit)

Screenshots!

Error Messages

image

Responsive Design

Desktop Mobile
localhost_5173_(7 xl (MacBook Air 13_)) localhost_5173_(2 xs-2 (iPhone 14 Pro))

Dark Mode

Light Mode Dark Mode
localhost_5173_(2 xs-2 (iPhone 14 Pro)) localhost_5173_(2 xs-2 (iPhone 14 Pro)) (1)

Comprehensive Details Screen

Details
localhost_5173_(7 xl (MacBook Air 13_)) (2)

Type Checking

image

Linting rules for Accessibility

image

Code Coverage Reporting

image

asquared-react-tech-test's People

Contributors

chriswait avatar kenjam97 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.