Code Monkey home page Code Monkey logo

replica's Introduction

Task - Replicate Bower.io | Frontend-Exercise

Coding challenge

Please write a responsive website, which mimics the behaviour of https://bower.io/search/. The application should be programmed using TypeScript and React.

Layout

The site should have a header section, a left sidebar, a footer and a content area. The content area should show a list of modules with their name, owner & stars. You can implement your own design or copy the style from the original Bower page. You can also use the UI library of your choice or implement your own React components. As you prefer. Placeholders can be used for the content.

Pagination & Sorting

The list of modules should be sortable by stars. It is important that the list is paged, which means that only 5 items per page will be shown. It should also be possible to search for a specific module.

API

You can use the Libraries.io API to query for modules (Example: https://libraries.io/api/bower-search?q=jquery). It will return you all the data which you need to display.

Assessment

When writing your code, please make sure that your project is structured and can be executed with yarn install & yarn start. When running yarn start, a browser should show up and display your developed site. If we run yarn test, we want to see unit tests running for the business logic of your code. Your project must be cross-platform compatible (running on Linux, Windows & macOS).

Alvaro Hernandez

Proposed Solution

  • Setup client with create-react-app
  • Create basic component structure and design state workflow
  • Setup Jest and add tests
  • Implement state system with props
  • Implement styes with styled-components
  • Refine logic and fix bugs

Screenshots

Main Mobile

Assumptions

  • Since I could not find a way to retrieve all possible results from the api (Bower.io returns 30 per search), I used the query parameter &per_page=100 to if possible fetch 100 items per search.

Libraries / Tools Used

  • React.js
  • Create React App for project setup
  • Typescript
  • Styled Components
  • React Icons
  • Jest

Frontend Setup

To install the dependencies run in the folder:

npm install or yarn install

Get a api key from libraries.io in https://libraries.io/

Place the API key in a .env file as REACT_APP_LIBRARIES_KEY, see .env.example for reference.

And to run the app:

npm start or yarn start

Running the tests

You can run the unit tests using:

npm test or yarn test

Future Work

  1. Complete unit testing with Jest and react-testing-library until coverage of at least 90%.
  2. Replace react-icons with plain SVGs for better performance.
  3. Replace styled-components with plain CSS for better caching.
  4. Implement Lazy Loading.

replica's People

Contributors

alvaroha1 avatar

Watchers

James Cloos avatar  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.