Skip to content

TechyStarr/Locale-API

Repository files navigation

Locale-API

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

Locale was built using Python

Table of Contents

Live ( deployed version )

Visit Website

Implementations

  1. Search functions
  2. Data Filtering

Technologies Used

  • Python
  • Flask
  • PostgreSQL

back to top

Libraries Used

back to top

Usage (deployed version)

  1. Visit website on your web browser

  2. Create an account as an admin

    • Click "Auth" to reveal the authentication endpoints
    • Register with your preferred details
  3. Sign in to your account

    • Input the details you registered with to generate a JWT token
    • Copy this access token without the quotation marks
  4. Click on the "Authorize" button at the top right. Enter the JWT token prefixed with "Bearer" in the given format

    Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6ZmFsc2UsImlIj
    
  5. Click "Authorize", then close the pop-up

  6. Now authorized, you can use the endpoints by creating, viewing, updating and deleting both students and courses.

  7. Click the 'Authorize' button, then logout to logout

Testing Locally

Clone the repository

git clone https://github.com/TechyStarr/Student-Management-API.git

Navigate into the project folder

cd student-mgt

Create a virtual environment

py -3 -m venv env

Activate the virtual environment

Windows: console env/scripts/activate Linux or Mac: source env/bin/activate

Install the necessary dependencies to run the project

pip install -r requirements.txt

Create a FLASK_APP environment variable

export FLASK_APP=runserver.py

Run application

flask run

or

py runserver.py

back to top

Available Endpoints

Authorization Endpoints

ROUTE METHOD DESCRIPTION AUTHORIZATION USER TYPE PLACEHOLDER
/auth/signup POST It allows an admin to create an account Any Any ----
/auth/login POST Generates an access and refresh token for user authentication Any Any ----
/auth/logout POST It is used to logout user and blacklist token Authenticated Any ----
/auth/refresh POST It is used to refresh expired tokens Authenticated Any ----
/auth/validate_token GET It is used to validate JWT tokens Authenticated Any ----
/auth/generate-api-key POST It is used to generate API Key Authenticated Any ----
/auth/apikeys GET It is used to retrieve all API keys for a user Authenticated Any ----

View Endpoints

ROUTE METHOD DESCRIPTION AUTHORIZATION USER TYPE PLACEHOLDER
/view/regions GET Retrieve all regions Authenticated Any ----
/view/states GET Retrieve all states Authenticated Any ----
/view/lgas GET Retrieve all lgas Authenticated Any ----
/view/regions/<region_id/states> GET Retrieve all states under a region by ID Authenticated Any region ID
/view/state/<state_id> GET Retrieve all states by ID Authenticated Any state ID
/view/lga/<lga_id> GET Retrieve all lgas by ID Authenticated Any lga ID
/view/places GET Retrieve all places of interest Authenticated Any ----
/view/place/state/<state_id> GET Retrieve all places of interest in a state Authenticated Any ----
/view/load-dataset POSTT Manually load dataset Authenticated Any ----
/view/regions GET Read dataset Authenticated Any ----

Search Endpoints

ROUTE METHOD DESCRIPTION AUTHORIZATION USER TYPE PLACEHOLDER
/query GET Search for states, regions and local government areas Authenticated Any
/filter GET Filter by either region, states or lga Authenticated Any state ID
/query/place/state/<state_id> GET Retrieve all places of interest in a state Authenticated Any ----

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published