Code Monkey home page Code Monkey logo

gateway's Introduction

Internal API - Gateway

Code style: black

Introduction

The Gateway service is one of ECOM services. Its objective is to process incoming requests by directly executing them or dispatch them to corresponding services. In this guide, we will demonstrate how to install and run this application in our local machine.

Installation

Before we begin we must make sure the following requirements are installed and running.

  • python 3.8+
  • pip 3+
  • docker

Depending on you operating system install/update the above requirements.

With virtualenv installed, we can start forming our application. Let's create and move into a new directory:

$ mkdir gateway
$ cd gateway

Create an empty git repo:

$ git init

Add remote origin:

$ git remote add origin https://github.com/-

Now let's pull:

$ git pull

Switch to 'develop' branch:

$ git checkout develop

Setup the Application

We are going to build the docker compose project:

$ cd deployment
$ docker-compose build

Create and open a .env file:

$ vim .env

Write the following:

api_env=development
secret_key=
pg_db_name=e_gateway
pg_db_user=postgres
pg_db_pass=1234
pg_db_host=localhost
pg_db_port=5432

sentry_dsn=

redis_host=localhost
redis_port=6379

customers_host=http://localhost:8001
customers_key=

catalog_host=http://localhost:8002
catalog_key=

We have successfully finished setting up and configuring our Gateway service.

Running the Application

make sure you're in the deployment directory

docker-compose up

Running Migrations

Open a bash session inside the gateway container

docker-compose exec gateway /bin/bash

$ ./scripts/makemigrations
$ ./scripts/migrate

Running without docker

running without docker-compose is not recommend

run the fastapi application using uvicorn

$ uvicorn main:app --port 8000 --debug

gateway's People

Contributors

mqudah0031 avatar mohammedgqudah avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.