GithubHelp home page GithubHelp logo

cobiro-product's Introduction

Interview app

Downloading

Download app: git clone https://github.com/rlalak/cobiro-product.git

Run

Run app: docker-compose up --build.

App will be available on http://127.0.0.1:8081/

Important

All scripts you have to run inside application container to make sure environment where you run this script meet all requirements. To call command inside container you have to run application and then use command like this docker exec -it cobiro-product_app_1 bin/phpunit.

Configure database

Run migrations to prepare database: bin/console doctrine:migration:migrate.

Configure read model

All queries use different model than command. Read model is updating partially after run command.
To make full synchronize run command: bin/console product:synchronize

Tests

To run unit tests use command bin/phpunit.

To run integration tests use command bin/phpunit -c phpunit.integration.xml

Example request

# create new product
curl -X POST -d '{"name":"Super produkt","priceAmount":"10023", "priceCurrency": "USD"}' http://127.0.0.1:8081/products/

# update existing product
curl -X PUT -d '{"name":"Super produkt","priceAmount":"10023", "priceCurrency": "USD"}' http://127.0.0.1:8081/products/340fd687-5528-4701-b6eb-a5f254de0783

# get product details
curl -X GET -d '{"name":"Super produkt","priceAmount":"10023", "priceCurrency": "USD"}' http://127.0.0.1:8081/products/340fd687-5528-4701-b6eb-a5f254de0783

# get all products
curl -X GET -d '{"name":"Super produkt","priceAmount":"10023", "priceCurrency": "USD"}' http://127.0.0.1:8081/products/

# remove product
curl -X DELETE -d '{"name":"Super produkt","priceAmount":"10023", "priceCurrency": "USD"}' http://127.0.0.1:8081/products/340fd687-5528-4701-b6eb-a5f254de0783

Development

For dev purposes uncomment mounting code into container in docker-compose.yml (uncomment section volumes) and run command bin/bootstrap to prepare application.

cobiro-product's People

Contributors

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