Skip to content

Muyixone/locale_API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Locale_API

Forks Issues linkedin


Logo

Locale API

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
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. Contact
  7. Acknowledgments

About The Project

Logo


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

(back to top)

Features

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

Technologies Used

The API is built using the following technologies

  • Node
  • Express
  • MongoDb
  • Redis

(back to top)

Getting Started

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.

Prerequisites

You need to have a working understaning of Node.js, and also have Node.js installed in your machine's environment

Installation

To install and run the Locale API locally, once you have installed the softwares above.

  1. Clone the repo
    git clone git@github.com:Muyixone/locale_API.git
  2. Navigate to the project directory
    cd locale_API
  3. Install NPM packages
    npm install
  4. 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;

(back to top)

Usage

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.

  1. Sign up as a developer/user via the below endpoint
  • /api/v1/user/register
  1. An API key will be given to the developer upon successful registration.

Create User!

  1. Include the API key in the headers of your HTTP requests using the following format

    x-api-key Your_API_KEY
  2. Make HTTP requests to the available endpoints to retrieve the desired geographical information.

Get all states!

For more examples, please refer to the Documentation

(back to top)

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

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

(back to top)

Contact

For your questions or inquiries, you can contact me

twitter

Email: muyi.alarezomo@gmail.com

(back to top)

Acknowledgments

The following resources where of immence help

(back to top)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published