Code Monkey home page Code Monkey logo

json-reader's Introduction

Fly365

Requirement

Class diagram

Class Diagram

Efficiency of parsing streams/files

Following table demonstrates a concept of the difference:

# String items in memory at a time Decoded PHP items in memory at a time Total
json_decode 10000 10000 20000
JsonMachine::fromStream 1 1 2

This means, that Streaming is constantly efficient for any size of processed JSON. 100 GB no problem.

End point

  • A REST API application to get transactions from multiple provider with criteria

  • GET [base-url]/api/payment/transaction

  • Response

{
    "transactions": [
        {
            "id": "flypay-a-0001",
            "amount": 99,
            "currency": "aud",
            "statusCode": 1,
            "orderReference": "2e58bd43-0001",
            "provider": "flypayA"
        }, {
            "id": "flypay-a-0007",
            "amount": 4,
            "currency": "aud",
            "statusCode": 1,
            "orderReference": "2e58bd43-0007",
            "provider": "flypayA"
        }
    ]
}
Criteria Examples:
  • link http://127.0.0.1:8001/api/payment/transaction?statusCode=authorised&amountMax=1000&amountMin=500&provider=flypayA

  • amountMin /api/payment/transaction?amountMin=300 requirements="\d+"

  • amountMax /api/payment/transaction?amountMax=900 requirements="\d+"

  • currency /api/payment/transaction?currency=usd requirements="[a-z]+"

  • statusCode /api/payment/transaction?statusCode=authorised requirements="[a-z]+"

  • provider /api/payment/transaction?provider=flypayA requirements="[a-z]+"

Installing

  • Create .env file from .env.dist
  • Run docker-compose build
  • Run docker-compose up -d
  • Run docker-compose run php composer install to install the dependencies.
  • Run docker-compose up

Running the tests

  • Run docker-compose run php /www/vendor/bin/phpunit

Built With

Please read the following docs:

json-reader's People

Contributors

mohamedhafezqo avatar

Stargazers

 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.