Giter Site home page Giter Site logo

moneytransfer's Introduction

MoneyApp

This is a solution to coding task, not a real app.

Build Status

Description

Implementation of RESTful API for money transfers between accounts.

  • Simplicity and optimization for speed of development were at the highest priority here.
  • No authentication mechanism provided. Assuming it's an internal API.

Technical info

  • The project is written in Dropwizard framework, which uses embedded Jetty server, Jersey HTTP client, Jackson for serialization.
  • No ORM framework was used. Data access implemented via JDBI / SQL Object interface.
  • No DI framework.
  • No Swagger doc, though it'd be nice.
  • DBMS: in-memory H2 DB.
  • Testing: TestNG + Mockito.

Short API description

Supported methods:

GET     /accounts           - get account info by id
POST    /accounts/open      - open a new account in specified currency
POST    /accounts/close     - close account by id
GET     /currencies/list    - get list of supported currencies (numeric and ISO codes)
GET     /money/balance      - get account balance
POST    /money/deposit      - deposit funds into account
POST    /money/transfer     - transfer money to another account
POST    /money/withdraw     - withdraw funds from account

For money representation in the API 'micro-money' is used, e.g. 1.50 USD is represented by number 1_500_000 for USD account.

Project structure

  • api – API objects (JSON models), such as requests, responses and domain model objects; and error codes as well.
  • core – money model and core transactional operations.
  • db – data access layer.
  • health – smoke startup health check.
  • resources – REST endpoints.

Run it!

  1. Run mvn clean install to build the application
  2. Start application with java -jar target/money-transfer-1.0-SNAPSHOT.jar server config.yml
  3. Run demo:
    • To see API workflow demo run python3 src/demo/api_workflow_demo.py, or see script source and its output example. It also illustrates request/response structures.
    • To see some possible error responses demo run python3 src/demo/api_errors_demo.py, or see source and its output example.

moneytransfer's People

Contributors

iav0207 avatar

Watchers

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