Skip to content

yktsang01/VirtualTrading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Virtual Trading

Java web application simulating online stock trading.
First developed in Y2008, revamped in Y2024.
Compatible with Java 17.

The available features can be found here.

The application follows a 3-tiered architecture:
MySQL database for the data layer. Database scripts can be found in db folder.
REST APIs for the service (business logic) layer. The available endpoints can be found here.
Freemarker for the user interface (UI) layer.

Spring Boot v3 as base with embedded Tomcat server.
A "modified" Yahoo Finance API library for fetching stock prices. (Changes here.)
OpenAPI v3 for Swagger.
JSON web token (JWT) for API authentication & authorization.

Domain model:

Non-Java 8 Runtime

If you do NOT have Java 8 runtime on your machine, you may encounter the below error in the logs when running the project:
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

The reason why this happens because the data is fetched from the stocks.json file on the yktsang.com website specified under the key "yahoo.stock.json" in the application.properties file.

There are several approaches to rectify this:

  1. Import the yktsang.com SSL cert to your Java runtime
  2. Amend the application.properties "yahoo.stock.json" key to point to a trusted website (requires recompilation)
  3. Refactor the application to fetch the data locally or within the application (under classpath inside the JAR/WAR)

Ensure you have admin rights before importing or deleting the SSL cert. These commands will prompt you to enter the keystore password accordingly.

To import the SSL cert to your Java runtime
keytool -importcert -alias yktsang.com -keystore /path/to/cacerts -file /path/to/sslcert

To view the imported entry
keytool -list -v -keystore /path/to/cacerts | grep yktsang.com

To delete the imported entry
keytool -delete -alias yktsang.com -keystore /path/to/cacerts

About

No description, website, or topics provided.

Resources

License

BSD-3-Clause, MIT licenses found

Licenses found

BSD-3-Clause
license.txt
MIT
YahooFinanceAPI-LICENSE.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages