Giter Club home page Giter Club logo

springtrader-cf's Introduction

SpringTrader on Cloud Foundry

This repository holds the SpringTrader application, slightly modified from the original, so that the application component war files are deployed to Cloud Foundry with bindings to database and AMQP services. The links below point to the original Application Overview, which, at a high level, continues to apply to this new version, the original Getting Started Guide and a new Getting Started Guide. Comparing the old and new versions of this document is telling - the former requires the installation of numerous components including an application server, database, AMQP messaging server and more. For deployment to Cloud Foundry, the PaaS provides all of these things and the deployment involves creation of database and AMQP instances (no SW installation required) and deployment of the war files (again, no SW installation); all of this is accomplished with only a few commands.

Known Limitations

The following current limitations will be eliminated shortly (pull requests welcome!!):

  • The web tier and services tier have been combined to avoid cross-site scripting issues. With the old deployment the war files for the UI and services tier were both deployed to the same domain (i.e. localhost:8080) with only the path being different, http://localhost:8080/spring-nanotrader-web and http://localhost:8080/spring-nanotrader-services, respectively. Two war files deployed to Cloud Foundry may share the same host, (i.e. cfapps.io) but will necessarily have two different subdomains (i.e. traderweb.cfapps.io and traderservices.cfapps.io), thus introducing cross-site scripting issues. There are various options for handling this, our initial one is to simply pull those two tiers together, and hence the Getting Started Guide only describes the deployment of two war files rather than three. Other alternatives are being investigated and will update this project.
  • No session state caching. The original project leveraged Gemfire to do session state caching, and did so with a peer to peer Gemfire configuration. Because different instances of the web tier run in independent and isolated containers in Cloud Foundry, the peer to peer protocol cannot be used. We are planning on updating the use of Gemfire for session state caching to use a server (hence services) based configuration.
  • Sample data is not yet being loaded. The current configuration DOES load reference data (prices for different stock tickers), but does not yet load additional sample data.

SpringTrader Overview

The SpringTrader is a web application that allows users to establish an account and then manage a portfolio of stocks, buying and selling. The architecture is fairly simple with a front end that includes the web tier talking to a set of HTTP/JSON-based services where stock quotes and portfolios can be viewed, and stock trade orders may be submitted, and a back end that fulfills orders. The communication between the front and back ends is asynchronous with the front end delivering orders to a message queue and the back end consuming from that queue. Both the front end services and the back end also access a shared relational database. See the Application Overview for the high-level architectue.

The following diagram depicts the SpringTrader application UI.

Spring Trader Screenshot

SpringTrader uses Gradle to Build

Either re-clone, or shut down STS after deleting projects and remove all Eclipse metadata files (.project, .classpath, .settings) - or see cleanEclipse below - but it's important to do it the first time.

Commands:

  • ./gradlew build release
  • ./gradlew cleanEclipse (deletes eclipse metadata files)
  • ./gradlew eclipse (created metadata files)
  • ./gradlew install - installs jars/poms in local maven repo

Import springtrader in Springsource Tool Suite (STS):

  • Right click in Project Explorer and select Import -> Import...

  • Choose Existing Project into Workspace

  • Set root directory to full path of springtrader

  • Select all Projects and click Finish

  • You should see following projects in STS

    spring-nanotrader-asynch-services spring-nanotrader-data spring-nanotrader-services spring-nanotrader-service-support spring-nanotrader-web spring-nanotrader-chaos

  • From STS main menu click Projects -> Build Automatically

Deploy springtrader to tc Server in STS:

  • Right click spring-nanotrader-services and select Run As -> Run On Server

  • Choose tc Server Developer Edition for server and click Next

  • Drag following projects from Available to Configured column

    spring-nanotrader-asynch-services spring-nanotrader-services spring-nanotrader-web

  • Click Finish

  • Wait for server to start and then browse to http://localhost:8080/spring-nanotrader-web


By downloading, installing, or using the Spring Trader software, you (the individual or legal entity) agree to be bound by the terms of the following license agreement: License Agreement

springtrader-cf's People

Contributors

asargent avatar bjnelson62 avatar carllopez avatar cdavisafc avatar garyrussell avatar ilayaperumalg avatar jinal avatar kashyap-parikh avatar logn-lopez avatar mbhave avatar parikhkc avatar samhardy avatar tsugliani 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.