Code Monkey home page Code Monkey logo

cs4125-route-planning's Introduction

Route-Planning-System

Route Planning system for CS4125 module project.

Requirements

  • Maven 3.6.3 installed
  • Java 11 minimum

AWS Deployment

There is an existing AWS (Amazon Web Services) deployment of the application that is deployed on every push to the main branch that can be found here: http://www.cs4125routeplanning.ie

It has its own database hosted on AWS also, so it does not need database setup

To deploy the app on your own machine, follow the next few sections

Database Setup

To setup the database for this project, ensure MySQL is installed and running on localhost:3306 and run the following commands:

sudo mysql
mysql> CREATE DATABASE <database-name>;
mysql> CREATE USER <username>@'localhost' IDENTIFIED BY '<password>';
mysql> GRANT ALL PRIVILEGES ON <database-name>.* TO <username>@'localhost';
mysql> FLUSH PRIVILEGES;

Change <database-name>, <username> and <password> to values you wish

In src/main/resources/application.properties, uncomment the following lines (by removing the # symbols):

#spring.datasource.url=jdbc:mysql://localhost:3306/<database-name>
#spring.datasource.username=<username>
#spring.datasource.password=<password>
#spring.jpa.properties.hibernate.dialect=or

, then comment out this line (by placing a # in front of it):

spring.jpa.hibernate.ddl-auto=create-drop

, then change the database name, username and password in the uncommented lines

Again, change the values in triangle brackets to the values you used setting up the database.

Quick Run

This section shows how you can quickly build and run the app without installing/deploying it. It is easiest to install it as it will be deployed as a service and restart automatically, however follow these steps to quickly run it. To read about local deployment, read the next section.

Run the following command:

mvn clean package spring-boot:repackage

When the build completes, run the command:

java --version # validate that you have at least Java 11
java -jar target/route-planning-1.0-SNAPSHOT.jar

Wait for the application to start, and then you should be able to access the service on http://localhost:8080

Local Deployment

The deployment directory deploy is configured for use with AWS. However, if you want to create a local deployment of the service on your own machine, you can perform the following:

  1. Create the application root directory, for example, here, it is /home/user/route-planning: mkdir /home/user/route-planning
  2. Copy the application.properties file from the setup above to a file called spring.properties in the application root directory: cp src/main/resources/application.properties /home/user/route-planning/spring.properties
  3. Copy the github repo to a directory called source (first cd ..): `cp -r /home/user/route-planning/source
  4. Change to the source directorygedit
  5. In deploy/scripts/route_planning_env.sh, change ROUTE_PLANNING_ROOT to the root directory: export ROUTE_PLANNING_ROOT="/home/user/route-planning"
  6. Copy deploy/scripts/route_planning_env.sh and deploy/scripts/route_planning_service.sh to /bin, or you can create a symlink:
sudo ln -s "$PWD/deploy/scripts/route_planning_env.sh" /bin
sudo ln -s "$PWD/deploy/scripts/route_planning_service.sh" /bin

Now, the setup is complete and environment variables are configured. You can now build the code and start the service. Follow these steps:

  1. Using sudo, run the following code: sudo deploy/scripts/build.sh
  2. When the build completes, you can then start the service by running sudo deploy/scripts/start.sh

cs4125-route-planning's People

Contributors

edwardul99 avatar timjaysenul avatar

Watchers

James Cloos avatar  avatar

cs4125-route-planning's Issues

Document expired issue when you view a route

When you generate routes and then click 'View Route' on one of them and then press the back button, Firefox presents you with a Document expired error because for some reason the page is not being cached.

When you press try again to re-submit the request, spring throws an error saying the following:
org.hibernate.PersistentObjectException: detached entity passed to persist: ie.ul.routeplanning.routes.Waypoint

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.