This project contain a Rest server which hosts json data taken from an RMI service that interacts with an SQL database. TThe project also contains a web client which retrieves its data from the rest API and displays that to the user.
The rest server is responsible for allowing the web client access to the database. It does this by using the RMI server to call function to interact with the database. It gets this data as an object. The object is no use to display on the website, which is why I used GSON. GSON allowed me to 'unpack' the object easily into JSON data to be displayed to the browser.
The rest server is responsible for database related querying. If a user wishes to edit, delete, add or view and material in the database they must go through the rest api.
The RMI server is a database service which allows the Rest-Server to use its functions by adding them to the RMI registry. The RMI server just sits and waits until the rest server calls one of it's method where it runs the operation before waiting again for the next operation.
The web client is repsonible for all user interaction and displaying the UI of the project. The web client makes GET, POST, PU and DELETE requests to the Rest-Server which handles those queries and either sends back the relevant information or executes a given instruction with the data given to it.
First thing to do is clone the project. To do that create a folder to contain the project and enter this command:
> git clone https://github.com/cian2009/DSProject
Running this project is a bit different to other as it is three seperate eclipse project which all interact with one another in some way.
To run simply:
- Run the 'RMI-Server' by right clicking 'RMISetup.java' in the 'ie.gmit.sw' package and running it as a 'Java Application'
- Run the 'Rest-Server' by right clicking the project and running it as a Tomcat 8.5 server which is also included in this project
- Run the 'Web-Client' by right clicking the project and running it as a Tomcat 8.5 server. (Same step as the Rest-Server)
-
GSON I used GSON: to serialize and deserialize Java objects to JSON. This allowed the RMI to send an object which can then be 'unpacked' into JSOn data to be displayed on the rest server api.
-
CSS Styling I created a custom css file with custom styling for the project to give user input a bit of flavor.
-
Smart querying: Removing customer will also remove their bookings. Removing a car will also remove a booking as the car will no longer be available.
- Eclipse - IDE used scripts
- Java 8 - Programming laguage used
- Tomcat 8.5 - Tomcat was used to host the Rest-Server and Web-Client projects
- GSON - GSON was used to serialize and deserialize Java objects to JSON.
This project is licensed under the MIT License - see the LICENSE.md file for details