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
Visit Website
- Search functions
- Data Filtering
- Python
- Flask
- PostgreSQL
- Flask restx - a framework for creating REST API
- Flask migrate - a framework for tracking database modifications
- Flask SQLAlchemy - object-relational mapper
- Flask JWT extended - authentication and authorization
- Flask Mail - sending emails
- Flask Caching - Database Cache layering
- Flask Limiter - Rate limiting
- Flask CORS - Handle Cross-Origin Resource Sharing
-
Visit website on your web browser
-
Create an account as an admin
- Click "Auth" to reveal the authentication endpoints
- Register with your preferred details
-
Sign in to your account
- Input the details you registered with to generate a JWT token
- Copy this access token without the quotation marks
-
Click on the "Authorize" button at the top right. Enter the JWT token prefixed with "Bearer" in the given format
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6ZmFsc2UsImlIj
-
Click "Authorize", then close the pop-up
-
Now authorized, you can use the endpoints by creating, viewing, updating and deleting both students and courses.
-
Click the 'Authorize' button, then logout to logout
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
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 | ---- |
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 | ---- |
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 | ---- |