Skip to content

Built a bunch of RESTful APIs to display countries' information

Notifications You must be signed in to change notification settings

FahimSifnatul/strativ

Repository files navigation

Countries!!!

A simple, elegent and powerful web app to display different country related data. Besides, it includes a bunch of useful REST APIs to retrieve country data. Live Demo

Prerequisites

  • python >= 3.8

Install

To run this web app on local machine, the python packages need to be installed are -

Or packages can be install with single command as below -

pip install Django==3.2.4 djangorestframework requests whitenoise virtualenv

Also needs to install git to setup 'Countries!!!' web app easily. To install git on linux (tested on ubuntu 20.04 LTS), please run this command -

sudo apt-get install -y git

To install on macOS, windows and other distros of linux, please visit the official page.

For step by step setup procedure, please see the User Guide section below.

User Guide

Here is the user guideline to setup 'Countries!!!' web app on local machine (Linux - tested on ubuntu 20.04 LTS).

Setup Virtual Environment (optional)

At first install virtualenv python package via pip -

pip install virtualenv	

Create a virtual environment -

virtualenv vCountries

Here vCountries can be any name. Activate virtual environment -

source vCountries/bin/activate

Setup Countries!!!

At first install git via bash command on terminal -

sudo apt-get install -y git

Create an empty directory. Let's in our case it is django. Change directory to django -

mkdir django
cd django

Now clone this repository via git clone command on terminal -

git clone https://github.com/FahimSifnatul/strativ.git

Run below python commands on terminal to setup NoSQL database SQLite3 -

python manage.py makemigrations
python manage.py migrate

We are just one step away from successful 'Countries!!!' web app setup. Run below python command on terminal to play with the web app -

python manage.py runserver 127.0.0.1:8000

Done. Simple, isn't it? Enjoy rich data about all countries of the world.

RESTful APIs

  1. /collect-api - To collect details data from REST Countries API
  2. /list-countries - Returns details info about all countries in JSON format
  3. /details-country/<country_name> - Return details info about specific country in JSON format
  4. /create-country/ - To create new country data
  5. /update-country/<country_name> - To update existing country data
  6. /delete-country/<country_name> - To delete specific country data
  7. /neighbouring-countries/<country_name> - Returns a list of neighbouring countries of a specific country in JSON format
  8. /same-language-countries/<language> - Returns a list of countries having common language in JSON format
  9. /search-country/<country_name> - Returns a country data if exists

[N.B.: replace <country_name> with a valid country name e.g. Bangladesh and <language> with a valid language e.g. Bengali]

Contributors

It's an open source project. Everybody is welcomed to contribute.

License

Countries!!! web app can be copied, modified, distributed for both personal and commercial purposes under MIT License

About

Built a bunch of RESTful APIs to display countries' information

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published