ese-erigha / countries-api

A dockerized Flask, ELK, MongoDB GraphQL API that provides data on countries of the world.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Countries API

A dockerized Flask GraphQL API that provides information about countries of the world. A modified version (in a private repo) that powers Countries Browser has been deployed to AWS (ECS, ECR, EC2) via github actions.

Application provides the following features:

  • Filter countries based on regions - Africa, Europe, America e.t.c
  • Search for country
  • View country details

Development:

Getting Started

Prerequisites

Installing

Clone the repository

git clone https://github.com/eseerigha/countries-api.git

Configure environment variables

Create a env.dev file in the application root

Add configs specified in the environment variables of docker-compose services to the env.dev file such as the example below

MONGO_HOST=<insert value>

Running application

Development Environment:

Setup Authentication keys to enable secure connection between ElasticSearch and Kibana,Logstash

docker-compose --f docker-compose.setup.yml --env-file env.dev run --rm keystore
docker-compose --f docker-compose.setup.yml --env-file env.dev run --rm certs

Run services

docker-compose --f docker-compose.yml --env-file env.dev up  --build

Load data via POST REQUEST

HEADERS = {Authorization: <auth token from dev.env config>}
http://localhost:500/country/data/load

View API Schema

http://localhost:500/graphql

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

A dockerized Flask, ELK, MongoDB GraphQL API that provides data on countries of the world.

License:MIT License


Languages

Language:Python 84.5%Language:Shell 10.2%Language:Dockerfile 5.3%