Git Product home page Git Product logo

pathfinder's Introduction

Pathfinder

Difficulty: 🟣 Easy

Project URL

πŸš€ You can check the project working in the following link: https://wfercanas.github.io/Pathfinder/

Project Description

This app provides the user the use case of looking for a route between two places defined through a search form. The app uses the Google Maps API to provide an autocomplete functionality when the user is typing for a place, get the geolocation of both places, get the route between those two points, render a Google Maps map and render in it the route found for the places that were submitted. The routes are not confined to a specific region, it works worldwide. A place can be an address or the name of a known location.

Installation

In order to make a local installation, you should execute:

npm install
npm run start

Technologies used

React (Hooks), Styled-Components, Storybook.

Special challenges

  1. Define a context to control the state of the application. The implementation creates two contexts, one for the map and its services (like rendering routes) and another for the controls provided in the UI.
  2. When using the controls provided in the UI, the app state changes in "complex" ways. For such cases was necessary to replace the useState Hook with multiple individual states, to the use of useReducer for controlling one compact state which controls different state changing scenarios.
  3. Separate the logic of the components from its presentational view. You will find Container components with the logic calling its presentation-only component counterpart.
  4. The use of context instead of props requires a special treatment of stories in Storybook.

Key Concepts

  1. ReactDOM.createPortal()
  2. React.createContext()
  3. Hooks: useContext(), useState(), useEffect(), useReducer()
  4. Google Maps API: libraries and its services: autocompleteService, geocoderService, directionsService.

Design

You can get the design of the app --its foundations, wireframes, mockups and components structure-- in this Figma

Acknowledgements

Thanks to Santiago SΓ‘nchez for code reviewing the project!πŸ’š

pathfinder's People

Contributors

wfercanas avatar

Stargazers

Roman avatar

Watchers

 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.