Code Monkey home page Code Monkey logo

sandbox-app's Introduction

Sandbox APP

Usage:

docker-compose -f docker-compose.yml build

docker-compose -f docker-compose.yml up

Introduction:

This is the introduction section for the Balance challenge, there is required to develop a App to expose data stored into PostgresSQL, to execute the queries will be used GraphQL methodologies.

Developer Notes:

The application uses Flask as a main Framework, the app is organized into multiples modules, there are:

  • routes: Contains the endpoints according to the path separated by Blueprint to organize endpoints that be imported to the main module.

  • business: Core of the business, includes methods called by endpoints, validators.

  • Models: SQLAlchemy modules, with the models, that define the table schema, columns fields and types. Database schemas are defined by the classes into the models module, there are defined with SQLAlchemy. Then are created two schemas: accounts and transactions.

Architecture:

The main application contains a Dockerfile and a docker-compose manifest, this is a containerized app, launch a PostgresSQL Database into the port 5432, the database exsits, but is empty, then to create the table schemas is required the entrypoint.sh file, that executes the bash commands: python manage.py, that run the cli command to create the database and seed the DB with Account and Transaction data.

About the data:

The merge.dev library does not work to get the Transaction entries via HTTP request, only works with the Account data (by merge.dev), Transaction data was created using Faker library, this is useful to get the data and simulate the final usage. All the scripts required to get the data from merge.dev (MergeAccountingClient) is contained into main/business.

Endpoints:

To invoke the GraphQL API, please visit the following routes:

Disclaimer (There are not defined the three required endpoints, but these two represents a base case that could be extended)

a) http://localhost:23006/getIncomeExpenseForDate

InputData: query { transactionsBetweenDates(accountId: "1", initialDate: "1980-01-01", endDate: "2015-12-31") { id transactionType totalAmount } }

b) http://localhost:23006/getAccountBalanceBreakdown

InputData: query { totalBalance(companyId: "1") }

sandbox-app's People

Contributors

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