Coder Social home page Coder Social logo

birafinder's Introduction

๐Ÿบ Birafinder

This project is based on BEES front-end code challenge. The goal is to create a list of breweries from Openm Brewery DB, based on the specified Figma layout. You can see it live here!

Running the project

You can either use the live URL or run locally. If you prefer the second option, just clone the repo and start the application, no need for anything fancy.

gh repo clone rafasilveira/birafinder
cd birafinder
yarn install
yarn test
yarn start

Concerning my solution

TL;DR: TypeScript, React, CRA, Styled-Components, default test suite, SWR, context API

Given that this is a simple project, but it's also a code challenge in which I'll be evaluated, I've chosen to go with a balance between simplicity and robustness. To avoid unneeded configurations, I've started my project with Create-React-App and the Typescript template, since it provides out-of-the-box basic linting, test suite, dev server, and so on. I'm also using Styled-Components for convenience and dynamic styles, as well as to simplify some component declarations. SWR allows better request handling (cache and error/loading state management). Context API handles my data layer. Since this is a weekend project and it won't receive contributions by other developers, I didn't bother setting up pre-commit hooks to guarantee style consistency. I trust myself, lol.

Folder structure

My application follows a simple folder structure, mostly based on Angular styleguide and React common practices, where files are grouped by the purpose they serve and named according to what they are. There's also some barrels on key folders to simplify importing. The following table presents my svg folder structure, alphabetically.

folder description
assets All SVG files used in the project. They're written as React components to simplify importing and to preserve svg html tag.
components All stateless components. The building blocks used on the project.
context Handles the application data
hocs High-order components
modules Contains the functional parts of my application, divided by app (the application itself), signup (first screen) and breweries(second screen)
request All requests and remote data models.
routes Application routing

Extra features

Unfortunately I haven't had time to do the UI tests. After all, it's easter ๐Ÿฐ

Apart from that, everything else is here ;)

Here are some thoughts on the bonus features:

  • My whole project is TS-based. There's also some neat usages, such conditional interfaces on my withLoading HOC
  • All my stateless components are tested, using Jest and Testing Library (yarn test).
  • I've followed the principle "stateless whenever possible, reactive where it makes sense". This has made my app easier to test.
  • My add more feature is kind of a state machine. Note: added text kept on-screen only and it isn't persisted once user leaves the page.
  • I've added lazy loading (using React.Suspense, check app module and routes
  • Loading/error/empty can be seen at the breweries page. You may trigger an empty state by deleting everything, and a loading state by moving forward on the pages.
  • There's pagination.
  • I'm quite proud of my git history.
  • My project is live on Vercel

birafinder's People

Contributors

rafasilveira avatar

Stargazers

 avatar

Watchers

 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.