Giter Site home page Giter Site logo

adekemi02 / locale_api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 485 KB

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.

License: MIT License

Python 42.49% HTML 2.47% CSS 8.95% JavaScript 46.09%

locale_api's Introduction

Locale API


Logo


Table of Contents
  1. About Locale API
  2. Lessons Learned
  3. Installation
  4. Usage
  5. Sample
  6. License
  7. Contact
  8. Acknowledgements

back to top


About Locale API

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

This project was built with Python's Flask-RESTX by Barakat Adisa as part of Backend Engineering final Semester Exam and Capstone Project at AltSchool Africa


Built with

Flask Python MongoDB


Lessons Learned

By creating this API, I was able to learn and understand the following concepts:

  • Caching
  • App Deployment with Render
  • MongoDB
  • Documentation
  • Debugging
  • Routing
  • Database Management
  • Rate Limiting
  • File Handling
  • Redis
  • User Authentication
  • User Authorization

Installation

  1. Clone the repo

    git clone https://github.com/Adekemi02/locale_api
  2. Navigate to the project directory

    cd locale_api
  3. Create a virtual environment

    python -m venv venv
  4. Install the required packages

    pip install -r requirements.txt
  5. Run the app

    flask run
  6. Open the app in your preferred browser by visiting: http://localhost:5000.


Usage

To make use of this API, simply follow the following steps:

  1. Open the app in your preferred browser by visiting: https://locale-2o8b.onrender.com.

  2. Create a user account to unlock the full potential of the API.

  3. Register as a user by clicking on 'auth' to reveal the dropdown menu for authentication and authorization. You can easily register via the 'api/v1/auth/register' route.

  4. Once registered, sign in using the 'api/v1/auth/login' route to generate a JWT token. This token will grant you access to the API. Copy the jwt_token without quotation marks.

  5. Scroll up and click on "Authorize" located at the top right corner. Enter your JWT token in the following format:

    Bearer thejwt_token
    
  6. Click 'Authorize' and then 'Close' to securely authenticate yourself.

  7. Now that you are authorized, a world of possibilities awaits! The API provides the following endpoints to cater to your needs:

    • GET /api/v1/states: Retrieve a comprehensive list of all states within Nigeria.
    • GET /api/v1/regions: Discover all geopolitical zones within Nigeria.
    • GET /api/v1/lgas: Access information on all Local Government Areas (LGAs) within each state.
    • GET /api/v1/lgas/{state_id}: Retrieve all local government areas within a specific state.
    • GET /api/v1/regions/{region_id}: Gather in-depth details about an individual region, including its associated states.
    • GET /api/v1/states/{state_id}: Obtain specific information about a single state, along with its metadata.
    • GET /api/v1/search/{query}: Effortlessly search for a region or state by name or ID.
  8. When you have completed your API interactions, simply click 'Authorize' once again at the top right corner and proceed to click 'Logout' for a secure and seamless logout experience.


Sample

Logo


Logo


License

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


Contact

Barakat Adisa - @adisa_adekhemie - [email protected]

Project Link: LOCALE API


Acknowledgements

This project was made possible by:

locale_api's People

Contributors

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