Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wfercanas/pathfinder
[π£ Easy]: Easygoing app for travelling supported by all the guiadance that Google Maps provide.
https://github.com/wfercanas/pathfinder
front-end google-maps-api react storybook
Last synced: 2 days ago
JSON representation
[π£ Easy]: Easygoing app for travelling supported by all the guiadance that Google Maps provide.
- Host: GitHub
- URL: https://github.com/wfercanas/pathfinder
- Owner: wfercanas
- Created: 2021-07-31T00:37:58.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-12T16:13:31.000Z (over 2 years ago)
- Last Synced: 2023-03-05T12:05:55.110Z (over 1 year ago)
- Topics: front-end, google-maps-api, react, storybook
- Language: JavaScript
- Homepage:
- Size: 2.1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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:
```bash
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](https://www.figma.com/file/QWFIYyJkU9lL541QRWZ7VY/Pathfinder?node-id=0%3A1)
## Acknowledgements
Thanks to [Santiago SΓ‘nchez](https://twitter.com/gh0stl1m) for code reviewing the project!π