A developer's API that provides geographical information about Nigeria. This API shows you all of Nigeria's regions, states and local government areas. You can also get information about a specific region or state.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
Nigeria as a country has a population of over Two hundred million people (200,000,000) acording 2022 data report from the world bank, with an anual percentage population growth of 2.4%.
Nigeria is made up of 6 geographical regions, 36 states and over 700 local government areas.
This project is based on providing more information about the country in terms of
- List of all the regions
- Longitude and latitude of each region, as well as population size of each region
- Names of all the states
- Each state can be searched based on the region they belong to
- Each state can be seached based on thier population size
- Local government areas can be searched based on states
In the future, this project has the potential to scale to provdide more information about Nigeria
- Access information about Nigeria's regions, states, and local government areas.
- Retrieve detailed information about a specific region or state.
- User registration and API key authentication for accessing public routes.
The API is built using the following technologies
To run this project locally, you need to have a running instance of redis. If you don't have it installed locally, you can visit Redis installation page. You can also install Redis insight which is a GUI for redis.
You need to have a working understaning of Node.js, and also have Node.js installed in your machine's environment
To install and run the Locale API locally, once you have installed the softwares above.
- Clone the repo
git clone [email protected]:Muyixone/locale_API.git
- Navigate to the project directory
cd locale_API
- Install NPM packages
npm install
- Set up the required enviroment variables
.env
- Add the following environment variables
MONGODB_URI = your_mongodb_uri;
REDIS_USERNAME = your_redis_username;
REDIS_HOST = your_redis_host;
REDIS_PORT = your_redis_port;
REDIS_PASSWORD = your_redis_password;
To access the endpoints provided by the Locale API, developers need to register and obtain an API key. The API key is required to access all public routes. Follow the steps below to use the API.
- Sign up as a developer/user via the below endpoint
/api/v1/user/register
- An API key will be given to the developer upon successful registration.
-
Include the API key in the headers of your HTTP requests using the following format
x-api-key Your_API_KEY
-
Make HTTP requests to the available endpoints to retrieve the desired geographical information.
For more examples, please refer to the Documentation
Contributions to the Locale API are welcome! If you find any issues or want to add new features, please submit a pull request. Make sure to follow the existing code style and include relevant tests. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
For your questions or inquiries, you can contact me
Email: [email protected]
The following resources where of immence help