Skip to content

Latest commit

 

History

History
150 lines (87 loc) · 3.6 KB

README.md

File metadata and controls

150 lines (87 loc) · 3.6 KB

Logo


locale_api

Locale is developer tool for anyone who needs to know Nigeria geopraphically. Locale's API shows you all Nigeria's regions, states, and local governement areas (LGAs). Locale is looking to be a very useful tool for the thousands of businesses building for Nigeria's 200M+ population size.

Built With:

Python Flask MongoDB

Lessons Learned

Working this Project helped me understand these concepts:

  • Rate Limiting
  • Caching
  • Debugging
  • Routing
  • Database Management
  • API Security
  • User authentication & authorization
  • Documentation

Installation

  1. Clone the repository to your local machine git clone https://github.com/AlxeverCodeX/Locale-API.git

  2. Install the required packages using pip. pip install -r requirements.txt

  3. Activate Virtual Environment. source lo/Scripts/activate

  4. Start the Flask application. flask run

The application will be available at http://localhost:5000.

Usage

To use this API, follow these steps:

  1. Project URL: https://locale-42dr.onrender.com/

  2. Create a User account

  3. To register as a User, click on 'auth' to reveal the dropdown menu for the authentication and authorization route. You can register as a User via the '/api/v1/register' route

  4. Sign in via the '/api/v1/login' route to generate a JWT token. Copy this access token without the quotation marks

  5. Scroll up to click "Authorize" at top right corner. Enter the JWT token in this given format:

    Bearer thejwtaccesstoken
    
  6. Click 'Authorize' and then 'Close'

  7. Now authorized, you can have access to the enpoints. The API supports the following endpoints:

    GET /api/v1/lgas: Retrieves all Local Government Areas in the database.

    GET /api/v1/lgas/{state_id}: Retrieves all local government in a state by a specific id.

    GET /api/v1/regions: Retrives all regions with its metadata.

    GET /api/v1/regions/{region_id}: Retrieves a single region with its metadata.

    GET /api/v1/search/{query} : Search for a Local Government Area or State with the id.

    GET /api/v1/states : Retrieves all states and its metadata.

    GET /api/v1/states/{state_id}: Retrieves a single state with its metadata.

  8. When you're done, click 'Authorize' at top right again to then 'Logout'


Sample

Logo


Logo


Future Feature

To add a frontend that can be used to consume this API

Contact

Emmanuel Albert - @alnuelCode_X - salberthp89@gmail.com

Project Link

License

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