Skip to content

Delivery job generator: geocode pick up and drop off addresses on Google Maps to create a delivery job πŸš€

License

Notifications You must be signed in to change notification settings

lauraferrandof/delivery-job-generator

Repository files navigation

Delivery job generator πŸš€

Table of Contents
  1. About the project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgements

About the project

The Delivery Job Generator allows the user to create a delivery job by choosing pick up and drop off addresses. It leverages the Google Maps JavaScript API to load Google Maps positioned at Paris, France.

First load of the project screenshot

Addresses introduced by the user are geocoded by sending a request to a private API. If they are valid, a request to the Google Maps JavaScript API adds map markers to the chosen addresses.

Valid addresses screenshot

When the user clicks on "Create a job", another request to the private API is sent to create the delivery job. If the request is successful, the form is reset, the map markers removed, and a toaster is displayed to notify the user.

Job created screenshot

Built with

Other technologies used

Getting Started

Prerequisites

  • Install Node.js
  • Install Git
  • Create a project in the Google Cloud Console, enable the Maps JavaScript API and get an API key. This tutorial from the Google Maps Platform documentation will set you up and running!

Installation

  1. Clone the repo

    git clone https://github.com/lauraferrandof/delivery-job-generator.git
  2. Install dependencies

    npm run deps:install

    Or

    yarn deps:install
  3. Create a .env file by duplicating the .env_sample file and add your API key and URL:

    API_KEY = YOUR_API_KEY
    API_URL = YOUR_API_URL

Warning

The current project relies on a private GraphQL API. I'm planning on implementing my own API to make this project really usable by other people. In the meantime, you're free to implement your own :)

Usage

To start the webpack dev server, run:

npm run start

Or

yarn start

The current private API only accepts two valid addresses (case insensitive):

  • Pick up address ➑ 29 Rue du 4 Septembre
  • Drop off address ➑ 15 Rue de Bourgogne

Available scripts

  • build: executes webpack. WARNING: the current webpack config is not optimized for production.

  • deps:install: installs dependencies with Yarn.

  • eslint: executes ESLint.

  • start: launches the webpack dev server, configured with Hot Module Replacement.

  • stylelint: executes Stylelint.

Technical decisions

  • React architecture (loosely) based on file type.
  • Sass architecture based on the 7-1 pattern.
  • ESLint configuration based on the Airbnb JavaScript Style Guide.
  • Due to the private nature of the API used to geocode and post the delivery job, the project is not ready to be deployed to production, therefore only development webpack config was created.
  • The project was bootstraped with a personal template I created. The template is a work in progress, so I had to make some modifications as I worked through the project.

Roadmap

  • Geocode the addresses once the user stops typing
  • Make the toaster disappear automatically after a few seconds
  • Implement a state reducer for state management (either with React Hooks or with Redux)
  • Add tests with Jest and Testing Library
  • Improve loading experience
  • Add error screen
  • Performance and accessibility checks
  • Create a pipeline with GitHub Actions
  • Add CSS transitions and animations
  • Refactor to TypeScript
  • Implement a custom GraphQL API

Contributing

Any contributions you make are greatly appreciated!

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'add an amazing feature')
  4. Push to the branch (git push -u origin feature/amazing-feature)
  5. Open a pull request against the parent project

Or open an issue if you spot a bug :)

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Laura Ferrando Ferrero - LinkedIn - lauraferrandof@gmail.com

Acknowledgements

About

Delivery job generator: geocode pick up and drop off addresses on Google Maps to create a delivery job πŸš€

Topics

Resources

License

Stars

Watchers

Forks