Skip to content
forked from jaman1000/Knuth

'Donald Knuth' Team Repository

Notifications You must be signed in to change notification settings

mercerccw/Knuth

 
 

Repository files navigation

Knuth

'Donald Knuth' Team Repository

There are two sections to the Final Project

  1. Jave EE application
  2. JavaScript application

Setup Instructions

Java EE application SoftHaven setup

  1. Download the Glassfish 4.1 installation from https://javaee.github.io/glassfish/download
  2. Download the MySQL Connector J 8.0.19 from https://dev.mysql.com/downloads/connector/j/
  3. Place the mysql-connector-java-8.0.19.jar file into the glassfish4/glassfish/lib/ folder
  4. Start Glassfish with the glassfish4/bin/asadmin.bat untility using the command start-domain (stop-domain to stop the server)
  5. Navigate in your web browser to http://localhost:4848
  6. Select the option in the navigation bar on the left side under Resources that says JDBC
  7. Under JDBC Connection Pools, create a new pool
  8. Enter the information provided below and save
    JDBC Pool Page
    JDBC Pool Settings
  9. Under Resources that says JDBC in the navigation bar select JDBC Resources
  10. Create a new Resources with the information provided below and save
    JDBC Resources Page
  11. Clone the repo (The Java side is inside the SoftHaven folder.)
  12. Create a folder in the src/main/java/com/sofhaven/ called config.
  13. 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.
  14. Change the username and password variables to match your own MySQL credentials.
  15. Login to your MySQL server and import the softhaven.sql located in the repository root directory
  16. Cd into the Softhaven directory
  17. Run mvn package (Make sure you have Maven CLI installed on your machine for this!!!)
  18. A target folder should appear
  19. Inside that folder there should be a SoftHaven.war file
  20. Go back to http://localhost:4848/ and click Home in the top left corner of the screen
  21. Select Deploy and Aplication
  22. Drag or select from the file explorer your SoftHaven.war file and click OK
  23. Wait a second or two and a list of Deployed Applications should appear with Softhaven present
  24. Click Launch
  25. Click the http:// link
  26. Now you're all done! Enjoy using SoftHaven!

Node and React Traffic Monitor setup

  1. Download the Node 12.16.2 LTS version from https://nodejs.org/en/download/
  2. Download Mongo 4.2 by following the official steps from https://docs.mongodb.com/manual/installation/
  3. 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.
    image
  4. Open up the terminal and type mongo to log into the Mongo database server.
  5. While in Mongo, execute use TrafficManager to create the database.
  6. Continuing in Mongo, execute db.createCollection("aisMessage") to create the aisMessage collection.
  7. Execute use DenmarkTraffic to create the database for the ais_transmitter.
  8. Lastly in Mongo, execute db.createCollection("aisdk_201809") for the ais_transmitter.
  9. Clone the repository at https://github.com/nicolasrenet/Knuth.git. (Both the TrafficService and the trafficmonitor folders will be used for this application.
  10. Ensure that ais_transmitter is installed in the same directory as the Knuth directory.
  11. cd into the ais_transmitter directory, run npm install to download any necessary dependencies.
  12. cd into the trafficmonitor directory, run npm install to download any necessary dependencies.
  13. Lastly, cd in the TrafficService directory and run npm install to download any necessary dependencies.
  14. Open up a new terminal and run mongod to start the MongoDB server.
  15. Return to the the previous terminal, cd to the TrafficService directory, and run npm start to start the backend server.
  16. Open a new terminal and cd into the ais_transmitter directory, and run node index.js to start the application.
  17. Open a new terminal an cd into the trafficmonitor directory, and run npm start to start the application.
    (If prompted about running the application on another port, type in "y"). IMPORTANT: This must be running at the same time as ais_transmitter or the vessels won't properly render.
  18. Go to the URL listed by the trafficmonitor program (which should be http://localhost:3001).
    The final application should look similar to the image below. Traffic Monitor
  19. Now you're all complete! Enjoy using Traffic Monitor!

Project Structure

AIS Transmitter

  • Purpose: Program used to simulate the uploading of vessel AIS messages.
  • Location: Contained within the ais_transmitter directory.
  • 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 Softhaven directory.
  • 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 trafficmonitor directory.
  • 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 TrafficService directory.
  • Appliction Uses: Used within the JavaScript application.

Tech/Framework/Libraries Used

JavaScript Application Uses:

JavaEE Application Uses:

Contribute

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.

Credits

Special thanks to Nicolas Renet for professoring this project. May the seas ease our minds.


License

MIT © Knuth Team

About

'Donald Knuth' Team Repository

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 82.1%
  • JavaScript 13.7%
  • HTML 2.1%
  • CSS 2.1%