Sample Laravel app that calculates distances between a list of zip codes (IEL-SE-2)
Explore the docs »
Report Bug
·
Request Feature
Table of Contents
This project is mostly just a refresher for my knowledge of Laravel. It is an assessment assigned by a potential employer with a specific set of instructions. Ultimately, it takes a list of ZIP codes entered by the user and displays the total distance between each those ZIP codes in kilometers.
To get a local copy up and running follow these simple steps.
Before installing, make sure you have a full development environment installed. For Windows, I tend to prefer Laragon. It will make sure you have Apache, Nginx, MySQL, and PHP installed. Follow the instructions on their site to install it.
You will also need Node.js with npm installed as well as Composer. For Node.js, my favorite installer for Windows and WSL is nvs. Follow the instructions there to get it installed on your machine. For Composer, follow their official instructions as well.
If you already have Node.js installed, please make sure that your copy of npm is up-to-date.
- npm
npm install npm@latest -g
- Clone the repo
git clone https://github.com/SturmB/zipcodes-distance.git
- Install NPM packages
npm install
- Make a working copy of
.env
cp .env.example .env
- Modify the
DB_*
entries in.env
to reflect your MySQL installation - Run a migration
php artisan migrate
- Visit the local web page based on your dev environment. If you're using Laragon, it is likely http://zipcodes-distance.local/, but it may also be http://localhost/ or some variation. Check the documentation.
This app is simple enough to be fairly self-explanatory. You enter ZIP codes using the input on the left (or on the top, for smaller screens) and they will appear on the list to the right (or bottom, for smaller screens). Once two or more ZIP codes have been entered, their total distances appear above the list of ZIP codes. You can keep adding more ZIP codes for as long as you like.
To start with a fresh list of ZIP codes, press the "Start Over" button below the input area. Otherwise, the ZIP code list and distance will persist until you close that browser tab/window.
- Test for more possible errors
- Add screenshots to documentation
- See if ZIP code list expands as expected
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the ISC License. See LICENSE.txt
for more information.
Your Name - @SturmB - [email protected]
Project Link: https://github.com/SturmB/zipcodes-distance
- Othneil Drew for the excellent README template
- Licenses for the excellent LICENSE template
- This SO Answer for an excellent implementation of the Haversine formula in PHP