Coder Social home page Coder Social logo

stocktrader's Introduction

stocktrader

GitHub license GitHub release

The project contains various projects to implement a stock trader. A stock trader should be able to buy and sell shares. Various small projects have been developed for this purpose. General information on the entire project is described on the following page. Further information can be found in the respective sub-project.

Service Architecture

The following graphic roughly describes the architecture of the whole project:

Architecture

The services can be accessed via the following default ports:

  • feedback: port 18080
  • account: port 18081
  • portfolio: port 18082

Prerequisites

The project is created with the build tool Maven, Docker and the Java Version 11.

Getting Started

If you want to run services locally, please follow the instructions in the respective projects. You can set up all other important services with Docker:

docker-compose up -d --build

See deployment for notes on how to deploy the project on a live system.

Running the tests

In order to use a uniform code style and to meet the legal requirement of the licence, two tools spotless and license-maven-plugin were added. The following commands can be used to check whether the current code complies with the requirements:

mvn spotless:check
mvn license:check

If these are unsuccessful, the following commands can be run to reformat the code and add the licence header:

mvn spotless:apply
mvn license:format

How further tests can be carried out is described in the corresponding sub-projects.

Documentation

A small documentation on the tools used can be found in the background folder. This is only a small excerpt. You can get more details about the project with the documented code, the postman collection or the domain_stories.

Deployment

If you want to deploy the complete project, you can use Docker to set up the entire environment. All you need to do is run the following command:

docker-compose -f docker-compose.yml -f docker-compose.stocktrader.yml up -d --build

If you want to develop on Windows you have to care about the EOL conversion:

  • Notepad++: Edit > EOL Conversion > Unix/OSX Format > Unix
  • Sublime Text: View > Line Endings > Unix

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the releases on this repository.

License

This project is licensed under the Mozilla Public License - see the LICENSE.md file for details

stocktrader's People

Contributors

fgr avatar flaxel avatar florian122 avatar kb1prb13 avatar lation avatar simeck26 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

stocktrader's Issues

Setup portfolio poject

Create a project portfolio with the vlingo-zoom-starter and the following configuration. Please adapt the placeholder (<placeholder>).

#Maven artifact version
version=1.0.0
#Maven project group id
group.id=com.whz
#Maven artifact version
artifact.id=<project_name>
#Base package name
package=com.whz.<project_name>
#Absolute path for the project parent folder
target.folder=<folder>
#vlingo xoom version
vlingo.xoom.server.version=1.3.4-SNAPSHOT
#Deployment Type (NONE, DOCKER, KUBERNETES)
deployment=DOCKER
#Docker Image name, required if deployment type is KUBERNETES or DOCKER
docker.image=<project_name>
#Published Docker Image, required if deployment type is KUBERNETES
k8s.image=xoom-application
#Kubernetes POD name, required if deployment type is KUBERNETES
k8s.pod.name=xoom-application
#Aggregate names (separated by semicolon)
aggregates=<aggregate_name>
#Domain Events (each events group should be preceded by Aggregate name and separated by semicolon)
events=<aggregate_name>, <event_name>
#Aggregate Rest Resources
rest.resources=<aggregate_name>
#Storage Type (STATE_STORE or JOURNAL)
storage.type=JOURNAL
#CQRS (true or false)
cqrs=true
#Projections Type (NONE, EVENT_BASED or OPERATION_BASED)
projections=EVENT_BASED
#Domain Model Database, required if CQRS is false (IN_MEMORY, POSTGRES, HSQLDB, MYSQL, YUGA_BYTE)
database=IN_MEMORY
#Command Model Database, required if CQRS is true or Storage Type is Journal (see database types above)
command.model.database=POSTGRES
#Query Model Database, required if CQRS is true or Storage Type is Journal (see database types above)
query.model.database=POSTGRES
#Use Xoom Annotations, when applicable
annotations=false

Create first release version

Is your feature request related to a problem? Please describe.
There is no stable version tagged.

Describe the solution you'd like
Create a release version for the entire project.

Additional context
Using SemVer.

Edit Readme

Is your feature request related to a problem? Please describe.
Currently there is no description how to setup, develop, test, ... the project.

Describe the solution you'd like
Please write an understandable readme file in the root project with possible links to the sub-projects to setup etc. the program. Therefore you can use for example the following template. Sometimes the template is not reachable therefore I uploaded it manually.

Add Dependabot

Is your feature request related to a problem? Please describe.
The dependencies have a fixed version. Security updates and new functions cannot be used.

Describe the solution you'd like
To be able to use security updates and new functions quickly and easily, the automatic update of dependencies using Dependabot would be nice.

Add Data Validation

Is your feature request related to a problem? Please describe.
Currently, it is possible to specify null values and non-matching values for a request.

Describe the solution you'd like
The problem can be solved by adding a validation to the rest resource. A possible library is the Hibernate Validator.

Describe alternatives you've considered
A direct implementation with vlingo would be nicer.

Extra:
Further problems with null values could also be solved by writing the code in Kotlin.

Add license header

Is your feature request related to a problem? Please describe.
We use a license and we must add a file header for the license.

Describe the solution you'd like
Add the license plugin and execute mvn license:format. Add also a new pipeline step.

You can see all steps in this pr.

Extend account calculator

Is your feature request related to a problem? Please describe.
The account calculator uses only the totalInvested to calculate your loyalty.

Describe the solution you'd like
Add more properties for the calculation of the reward like activity.

Configure project

Change the configuration of the main branch:

  • add branch protection
  • add templates (issue, pull request)

Add a kanban project to get an overview about the current issues.

Add Code Documentation

Is your feature request related to a problem? Please describe.
missing code documentation

Describe the solution you'd like
add code documention (javadoc) for all necessary methods + the since tag

Money Conversion to Currency

Is your feature request related to a problem? Please describe.
Not a problem, it's just bad to use double as a representation for money.

Describe the solution you'd like
The money data type should be changed to a decent Currency (e.g. a proper library)

Describe alternatives you've considered
There are no reasonable alternatives. Only temporary solutions.

Add project to vlingo examples

Is your feature request related to a problem? Please describe.
repository only in our scope

Describe the solution you'd like
Link the project in the vlingo examples

Setup pipeline

Create a GitHub Pipeline with different actions:

  • spotless
  • build project
  • test project
  • sonarcloud
  • codeql

Add Authentication and Authorization

Is your feature request related to a problem? Please describe.
Currently, anyone who knows the interfaces can access the services without being authenticated and authorised.

Describe the solution you'd like
The vlingo-auth service could be used to enable authentication and authorisation.

Additional context
๐Ÿšง The vlingo-auth service is currently in preview mode. More documentation to be supplied when the service is fully released.

CommissionCalculator

Is your feature request related to a problem? Please describe.
Not necessarily a problem but right now there's no calculation for a commission. Currently, commission is a constant value but a CommissionCalculator could add more value to the project.

Describe the solution you'd like
The CommissionCalculator should calculate the current commission that will be charged when buying the next stocks.

Describe alternatives you've considered
Right now it's simply a constant value because it's not an essential feature to our project and works just fine. It's not very realistic though.

Create REST interface

Is your feature request related to a problem? Please describe.
The project can just send a simple ready request. But there is no additional functionality.

Describe the solution you'd like
Add some more requests to create and get an object of the context.

Add Community Profile

Is your request related to a problem? Please describe.
The community profile is missing. And it would be nice to add the community standards.

Describe the solution you'd like
Add the following files to follow the recommended community standards:

  • Description
  • Code of Conduct
  • Contributing
  • License

Dockerization

Is your feature request related to a problem? Please describe.
The projects are available in a first executable version, but we can only start each project step by step.

Describe the solution you'd like
Create a docker compose file with all parts of the complete project to start the whole environment.

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.