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.
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:
- Import the yktsang.com SSL cert to your Java runtime
- Amend the application.properties "yahoo.stock.json" key to point to a trusted website (requires recompilation)
- 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