https://github.com/freinet12/geo-validator
Geo Validator Tool
https://github.com/freinet12/geo-validator
Last synced: about 2 months ago
JSON representation
Geo Validator Tool
- Host: GitHub
- URL: https://github.com/freinet12/geo-validator
- Owner: freinet12
- Created: 2020-05-28T13:40:49.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-02T12:18:22.000Z (over 2 years ago)
- Last Synced: 2025-02-14T01:45:46.049Z (3 months ago)
- Language: PHP
- Size: 156 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
GEO VALIDATOR
## SETUP
- Install PHP version 7.2+
- Install MYSQL (mysql Ver 15.1 Distrib 10.4.11-MariaDB)
- Create Database:
CREATE DATABASE IF NOT EXISTS geo
CHARACTER SET = 'utf8mb4'
COLLATE = 'utf8mb4_unicode_ci';
- Copy the contents of .env.example into a new file in the root app dir called .env
- Open up the .env file and update the following:
DB_HOST=your_mysql_host_ip
DB_PORT=3306 or whatever port mysql is running on
DB_USERNAME=your_mysql_username
DB_PASSWORD=your_mysql_password## Migrations
- Run the following command:
php artisan migrate
## Endpoints
1) Create All 50 State Records
{APP_URL}/api/states/createAll
required fields: none
- returns:
-All sates created successfully!
2) Create City & Zip Records by Uploading a geo file
{APP_URL}/api/createGeoRecords
required fields:
- file (the geo file which has zip, city, state)
returns:
-Done.
3) Validate Provided Geo
{APP_URL}/api/validateGeo
- required params:
-city
(city name)
-state
(2 letter state code)
-zip
(5 digit zip-code)
example:
{APP_URL}/api/validateGeo?city=stebbins&state=ak&zip=99671
- returns:
-valid geo
(if the provided geo is valid)
-invalid geo
(if the provided geo is invalid)
-unable to validate geo
(if an error occured when trying to validate the provided geo)