Giter Club home page Giter Club logo

checkout-system's Introduction

Checkout System

The idea here is to provide a complete backend for a checkout system. The products-api is just a mock.

Checkout API's diagram. If your file reader can't render the image, it's located at docs/assets.

The steps could read as:

  1. The frontend calls products-api, and renders the content to the user;
  2. After choosing the products, user procceeds on checking out, and the frontend sends the products list to checkout-api;
  3. checkout-api requests products data to products-api;
  4. checkout-api requests promotions data to promotions-api, then calculates the basket's total value and finaly answers it to the frontend;

Breaking up the directories

The project is organized in directories that isolate the three applications, and a few other goodies at the root. Let's have a look:

  • checkout-api: Project for the app that will actually do the maths and processing;
  • promotions-api: Project for the app that manages promotions;
  • products-api: Inside of this directory there is just the mocked API, plus one script used to start the WireMock Server inside a container;
  • docs: This directory concentrates both the docs, the answers to the Follow-Up Questions and a collection of requests, that can be imported to Postman in order to consume the apps;

Running the app

What do I need to install?

Basically just docker and docker-compose, in order run everything at once.

How do I run it?

First, you'll have to build the apps:

$ cd promotions-api && ./gradlew clean build
$ cd checkout-api && ./gradlew clean build

Now we're ready to go:

$ docker-compose up

Now, to run each app individually, check out the README file for each of them.

How do I use it?

There's a Postman collection under docs/requests directory. There's no promotions created by default, so you probably want to start by creating some of them, before proceeding to test the checkout.

Running the tests

It's the default for gradlew with spring applications, go to the desired app's root directory and run ./gradlew test, or run them with the IDE of your choice.

checkout-system's People

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.