Giter Site home page Giter Site logo

workwell's Introduction

NeverEatAlone Challenge

NeverEatAlone App

Install

cd client
npm install
npm start

How to test

cd client
npm run test

(There is an issue with yarn and some dependencies packages, tests can't be run with yarn unfortunatly, the issue should resolved with React 16)


Solution

  • NeverEatAlone app use create-react-app as base as it is being updated by the community and helping to have the project up to date. It also simplify the management of webpack and help to focus only on our present task.

  • The application also make use of GraphQL to query data. The client used along with GrapqQL is Apollo, it is a client closer from Redux and simpler to manage. The other alternative to consider is Relay.

  • To manage the routing, react-router v4 would be the solution to go as the community around it makes it move in the right direction and is really present.

  • For the tests we use Jest/enzyme to test our components

  • For the interface material-ui v1 is the chosen solution as it works well with react and offers a good range of components based on material design. Also the v1 now support the accessibility which makes it a good plus over other libraries, as accessitilty become more and more present on the web. w3c google facebook ...

  • The map itself is done using leaflet.js along d3.js for the layer displaying our custom markers.

  • A good alternative might be mapbox-gl-js, we can find a small comparison between the 2 here.

  • Also leaflet and mapbox seem to have already layers integrated that might be a good idea using it depending on the project need.


Architecture

Client

  • We have the main application with the providers, client at the top level of src/ The main App is inside the App folder with the principals components needed to run the app. The others components are inside the components folders and can be resused. Components are for the most part independant and can be loaded separatly.

  • Shapes defining the proptypes are in a separate folder.

  • All Queries for GraphQL are inside the GraphQL folder splitted between mutations and queries.

Server

  • The main purpose of the server is to allow us to serve our assets and reload any pages.

API

  • As for the API we are using a backend as a service(MBaaS) graph.cool to serve our data. The goal was to gain speed and avoid to develop a backend and still have data served as a graph.

Difficulties

  • As part of the difficulties we could say that learning leaflet.js and d3.js were not a small task, mastering it may require some time, but the solutions are solid enough to go deeper with it and try to do more complicated stuff.

  • Also the small thing to be noted on that is the react-leaflet and react-d3 are no longer supported and the projects are a bit left out. So there might be something good in creating new react components for leaflet v1.1.0 plugged with leaflet API. This is the reason I chose to use the libraries itself directly and not react-leaflet.

  • Also testing graphql queries/components are soemthing fairly new for me and there might be better solution to investigate and improve the tests.

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.