GithubHelp home page GithubHelp logo

addchew / customer-data-service-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 102 KB

GraphQL and REST API for customers, accounts and transactions data

Python 99.06% Dockerfile 0.52% Shell 0.42%
docker fastapi graphql mongodb motor postgresql python rayserve rest-api strawberry-graphql

customer-data-service-api's Introduction

Unit Tests

Customer Data Service API

GraphQL API for customers, accounts and transactions data.

Built with:

  • MongoDB
  • Motor
  • FastAPI
  • Ray Serve
  • Strawberry

Project Setup

  1. Navigate into the deploy folder from the project root folder (i.e. customer-data-service-api/deploy)
cd deploy
  1. Create a .env file with the following terminal command
touch .env
  1. Generate an access key with the following terminal command
openssl rand -hex 16
  1. Add the following key-value pairs into the .env file
NUM_REPLICAS=2

APP_PORT=8000
RAY_DASHBOARD_PORT=8265

FIXTURES_SEED=0
NUM_CUSTOMERS=100
NUM_ACCOUNTS=300
NUM_TRANSACTIONS=5000

MONGO_HOST=mongo
MONGO_INITDB_ROOT_USERNAME=<your mongodb username>
MONGO_INITDB_ROOT_PASSWORD=<your mongodb password>

CUSTOMERS_DATABASE=customers_data

CUSTOMERS_COLLECTION=customers
ACCOUNTS_COLLECTION=accounts
TRANSACTIONS_COLLECTION=transactions

ACCESS_KEY=<your generated access key>
  1. Build docker image and start containers
docker compose up -d --build
  1. Navigate to the following urls to access the respective services
URL Service
http://localhost:8000/graphql GraphiQL
http://localhost:8000/docs SwaggerUI
http://localhost:8000/redoc Redoc
http://localhost:8265/#/overview Ray dashboard

How To Run Unittests

  1. Navigate to project root folder (i.e. customer-data-service-api)

  2. Install the necessary dependencies

pip install -r requirements-dev.txt
  1. Execute unittests
coverage run -m pytest -v
  1. Check test coverage
coverage report -m --fail-under=95

customer-data-service-api's People

Contributors

addchew avatar

Watchers

 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.