Giter VIP home page Giter VIP logo

graviti-frontend-assignment's Introduction

Route Planner

Route Planner is a web application that allows users to calculate the distance and ETA (Estimated Time of Arrival) from a starting point to a destination with optional stops (waypoints) using Google Maps. The app also provides a shareable link for the calculated route.

Features

  • Calculate distance and ETA using Google Maps API.
  • Add multiple waypoints (stops) to your route.
  • Select travel mode: Driving, Bicycling, Transit, Walking.
  • Generate a shareable URL for your route.

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v14.0.0 or later)
  • npm (v6.0.0 or later)

Installation

  1. Clone the repository:

    git clone https://github.com/Ravish108Coder/graviti-frontend-assignment
    cd route-planner
  2. Install the dependencies:

    npm install
  3. Set up environment variables:

    Create a .env file in the root directory of your project and add your Google Maps API key:

    NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your-google-maps-api-key
  4. Run the development server:

    npm run dev

    Open http://localhost:3000 with your browser to see the result.

Project Files

  • components: Contains the main React components used in the application.
  • public: Contains static assets such as images and icons.
  • styles: Contains the CSS files for styling the application.
  • .env: Environment variables for the project.
  • next.config.js: Configuration file for Next.js.
  • package.json: Lists the project dependencies and scripts.

Usage

  1. Enter your starting point:

    Use the autocomplete input to enter your starting point.

  2. Enter your destination:

    Use the autocomplete input to enter your destination.

  3. Add waypoints (optional):

    Click the "Add Stop" button to add waypoints (stops) to your route.

  4. Select travel mode:

    Choose from Driving, Bicycling, Transit, or Walking.

  5. Calculate distance and ETA:

    After entering all the details, the distance and ETA will be calculated and displayed.

  6. Generate shareable URL:

    Click the "Copy Link" button to copy the shareable URL to your clipboard. You can share this link with others to show them the calculated route.

Live Demo

Check out the live deployed version of the Route Planner here.

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add some feature').
  5. Push to the branch (git push origin feature-branch).
  6. Open a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

Contact

If you have any questions, feel free to contact:


Thank you for using Route Planner!

graviti-frontend-assignment's People

Contributors

ravish108coder 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.