There are two sections to the Final Project
- Jave EE application
- JavaScript application
Java EE application SoftHaven setup
- Download the Glassfish 4.1 installation from https://javaee.github.io/glassfish/download
- Download the MySQL Connector J 8.0.19 from https://dev.mysql.com/downloads/connector/j/
- Place the
mysql-connector-java-8.0.19.jarfile into theglassfish4/glassfish/lib/folder - Start Glassfish with the
glassfish4/bin/asadmin.batuntility using the commandstart-domain(stop-domainto stop the server) - Navigate in your web browser to http://localhost:4848
- Select the option in the navigation bar on the left side under Resources that says JDBC
- Under JDBC Connection Pools, create a new pool
- Enter the information provided below and save


- Under Resources that says JDBC in the navigation bar select JDBC Resources
- Create a new Resources with the information provided below and save

- Clone the repo (The Java side is inside the SoftHaven folder.)
- Create a folder in the
src/main/java/com/sofhaven/calledconfig. - Create a file in that directory call Database.java and paste in the code from the
src/main/resources/com/softhaven/config/Database_PLACEHOLDER.java.txt. - Change the username and password variables to match your own MySQL credentials.
- Login to your MySQL server and import the
softhaven.sqllocated in the repository root directory - Cd into the
Softhavendirectory - Run
mvn package(Make sure you have Maven CLI installed on your machine for this!!!) - A target folder should appear
- Inside that folder there should be a
SoftHaven.warfile - Go back to http://localhost:4848/ and click Home in the top left corner of the screen
- Select Deploy and Aplication
- Drag or select from the file explorer your
SoftHaven.warfile and click OK - Wait a second or two and a list of Deployed Applications should appear with Softhaven present
- Click Launch
- Click the http:// link
- Now you're all done! Enjoy using SoftHaven!
Node and React Traffic Monitor setup
- Download the Node 12.16.2 LTS version from https://nodejs.org/en/download/
- Download Mongo 4.2 by following the official steps from https://docs.mongodb.com/manual/installation/
- Insert Mongo bin folder directory into Path environment variables for command line execution.
These windows are provided in the image below for a Windows installation.

- Open up the terminal and type
mongoto log into the Mongo database server. - While in Mongo, execute
use TrafficManagerto create the database. - Continuing in Mongo, execute
db.createCollection("aisMessage")to create the aisMessage collection. - Execute
use DenmarkTrafficto create the database for theais_transmitter. - Lastly in Mongo, execute
db.createCollection("aisdk_201809")for theais_transmitter. - Clone the repository at https://github.com/nicolasrenet/Knuth.git.
(Both the
TrafficServiceand thetrafficmonitorfolders will be used for this application. - Ensure that
ais_transmitteris installed in the same directory as theKnuthdirectory. - cd into the
ais_transmitterdirectory, runnpm installto download any necessary dependencies. - cd into the
trafficmonitordirectory, runnpm installto download any necessary dependencies. - Lastly, cd in the
TrafficServicedirectory and runnpm installto download any necessary dependencies. - Open up a new terminal and run
mongodto start the MongoDB server. - Return to the the previous terminal, cd to the
TrafficServicedirectory, and runnpm startto start the backend server. - Open a new terminal and cd into the
ais_transmitterdirectory, and runnode index.jsto start the application. - Open a new terminal an cd into the
trafficmonitordirectory, and runnpm startto start the application.
(If prompted about running the application on another port, type in "y"). IMPORTANT: This must be running at the same time asais_transmitteror the vessels won't properly render. - Go to the URL listed by the
trafficmonitorprogram (which should be http://localhost:3001).
The final application should look similar to the image below.
- Now you're all complete! Enjoy using Traffic Monitor!
AIS Transmitter
- Purpose: Program used to simulate the uploading of vessel AIS messages.
- Location: Contained within the
ais_transmitterdirectory. - Application Uses: Information used by the JavaScript application.
Softhaven
- Purpose: Program used by ship masters, ship agents, customs officers to view vessel information and arrival/departure forms.
- Location: Contained within the
Softhavendirectory. - Application Uses: Used within the JavaEE application.
Traffic Monitor
- Purpose: Frontend application to view AIS messages through a map GUI and showcases related statistics.
- Location: Contained within the
trafficmonitordirectory. - Application Uses: Used within the JavaScript application.
TrafficService
- Purpose: Backend REST service used by anyone to interact with any data contained within recent AIS messages.
- Location: Contained within the
TrafficServicedirectory. - Appliction Uses: Used within the JavaScript application.
JavaScript Application Uses:
- AIS Transmitter
- MongoDB Driver (https://www.npmjs.com/package/mongodb)
- Traffic Monitor
- React Library (https://reactjs.org/)
- Moment Library (https://momentjs.com/)
- React Leaflet Library (https://react-leaflet.js.org/en/)
- Leaflet Library (https://leafletjs.com/)
- NPM Package Manager (https://www.npmjs.com/)
- Traffic Service
- Express Framework
- Body-Parser Library (https://www.npmjs.com/package/body-parser)
- Cookie-Parser Library (https://www.npmjs.com/package/cookie-parser)
- Date-FNS Library (https://date-fns.org/)
- Logger Library (https://www.npmjs.com/package/logger)
- MongoDB Driver (https://www.npmjs.com/package/mongodb)
JavaEE Application Uses:
- Softhaven
- Glassfish 4.1 (https://javaee.github.io/glassfish/download)
- MySQL Connector J 8.0.19 (https://dev.mysql.com/downloads/connector/j/)
This project is currently needing implementation to connect these two related programs.
- Softhaven needs the AIS message history from a ship with a request MMSI.
- The request for this history has already been written in the Traffic Service backend!
- Traffic Monitor needs to access the pre-arrival data from Sofhaven. Contribute to this project through making a pull request @ https://github.com/nicolasrenet/Knuth.
Special thanks to Nicolas Renet for professoring this project. May the seas ease our minds.
MIT © Knuth Team