Skip to content

resv/MINDTIPPER

Repository files navigation

Case Study - "Mind Tipper"


Table of Contents

Repository Notes

Remade a Case Study repository in attempt to keep this project seperate from Java Training (exercises).


Preview




Summary

An dynamic web application to help decision making that doesn't rely on a random generator. A decision title is split into two columns called choices, each choice has a supporting detail set that weigh against the opposing choice's detail set.





You can make a selection of which detail wins over the other. Once all selections are complete, the number of selections made for each choice are tallied up and calculated as the winning decision.



Users can share their decisions with others, retake or edit existing completed decisions as a starting template to start a new decision of their own. Expected user demographics are not limited to consumers but extends to businesses connecting with their customers e.g "What do you like most about our product X watch vs our competitor's Y watch?".



As more unedited completed decisions are retaken by other users, more data is gathered on the value of a detail chosen by many. With this data we can analyze which details hold more value over others.









Planning

The case study started with Planning, many revisions were made and I am currently on revision #5.

Summary Req Analysis User Case WireFrame Entity Relation Diagram Mock Database View




I started testing the database by entering mock data using Mockaroo.

Not all data may make complete sense but it was vital to have, mock data allowed to develop and test queries.






With constant modifications and testing being done for my database, it was crucial to drop and recreate my data tables quickly, so I created a a "One-Shot" DDL insert file. This handled the creation of my tables, inserts for mock data, and generated all my private and foreign keys. There are also individual files for each table and keys, you can insert them in numerical order in the event of issues.





It was unnecessary to use JIRA for a one person project, so I instead used Trello which help keep track of my progress during development.









Installation

Although a domain name has been secured (MindTipper.com), the application is not ready for official launch. Step by Step instructions has been provided to run this application locally on your machine for further development or testing purposes.

Prerequisites

  1. Open up SQL Developer, preparing to create tables and insert mock data.

  2. Create a new connection, and remember your connection properties as you will insert this data into the project later.

  3. Open up the work sheet for the database and insert the SQL DDL, I have provided a "One Shot" DDL file for you to run. This will create all tables and records, set primary and foreign keys. I’ve also provided individual SQL DDL files that you may insert one at a time in numerical order in the event of issues.

  4. Clone this repository, once download is complete, you may open up this project in your Eclipse IDE.

  5. You need to modify the "spring-mvc-crud-demo-servlet.xml" file, replace "User", "Pass", "jdbcURL", driver to match your connection in your DBMS. (currently assigned to my AWS database)

  1. Right click the "MT" project in your project explorer -> run as ->run on server, Set Tomcat to version 9 and hit finish.

  2. The web application should take a few seconds to load and run. I highly advise that you copy and paste the url "http://localhost:8080/MT/" from your eclipse web explorer and open it on your local browser for the full front end user experience.


MODEL VIEW CONTROLLER

PAST ATTEMPTS

There were three different attempts starting this project.

  1. Initially I attempted to create this project as Maven converted project using JDBC but faced numerous environment issues that could not be resolved.
    • A standard JDBC pattern of Models, DAOs, DAOIs were created.
    • Each DAO was manually tested in a "MainTestRunner".
    • You can view the entire project attempt here.
(OLD) UserInfo Model (OLD) UserInfoDAO (OLD) UserInfoDAOI (OLD) Test Runner

  1. The second attempt we came across the same issues using JDBC template method, you can view the entire project attempt here.

  2. The third and current attempt is using Hibernate which we were able to finally read and write data from the database to the JSP.






MVC - MODEL

In our MT.entity package, four entities/models exist, these directly correlate to my AWS Oracle database tables.

  1. A standard pattern of mapping primary keys, columns, toString(), getters & setters.
Entity Package UserInfo Entity DecisionInfo Entity Title Entity Choice Entity

  1. Specifically, the DAOImpl will initialize the SessionFactory which will automatically open and close our connections, query the database, then save the result into an List array. Image shown below:

  1. Our DAOs and DAOImpls contains the necessary methods for its purpose. I also have a service package, a layer for future expansion and flexibility. The service layer would allow us to add additional business logic later. Another use for the service layer would be to separate the DAO and DAOImpl from the user for an additional layer of protection against any attacks.
Controller UserInfo Entity UserInfoDAO UserInfoDAOImpl UserInfoService UserInfoServiceImpl





MVC - VIEW

  1. Some API sources used were for learning purposes only, any API libraries that were used are located in the resources folder, labeled respectively.

  2. We have removed boilerplate code by creating a static JSP folder to hold header, footer, and navbar JSP files that each view utilizes.

  1. The CSS & JS folder contains the personal external styling done for the JSP pages but all other external CSS sources have been credited to the respective authors/companies on each of their files.

  2. All views implements bootstrap for styling and is responsive for mobile or smaller resolutions.

    • Nav bar and footer were custom made and responsive.
    • Home page was inspired by Startbootstrap but highly modified.
    • Internal and external CSS was used as the requirement for this case study.
    • JSTL tag library was used to reference external links.
  3. "Terms of use" & "Privacy Policy" has factual information regarding this project at its current state and for future features not yet implemented. You can generate specified documentation at Termly. I could not afford the membership so I had to manual create my own HTML and CSS for this page as embedding was the only way to use these terms for non paid members and that was not an option. Credit was given to the company in the JSP page.


Animation

I implemented a very powerful tool called WOW.JS for simple animations. Customized timers can be found in animate.css.






MVC - CONTROLLER


  1. The controller layer handles mapping to the corresponding JSP views and for navigational usability, I have created simple view controllers.

  1. At the moment I only have two controllers that have any real functionality which is registering the user (creates a new user in the database). The other is search decisions controller to display results for other decisions in the database. This search controller requires a joined entity to complete the desired functionality which I could not resolve in time.

*Image shown below represents data queried from "DecisionInfo". Text wrapped in parenthesis are data place holders that would populate correctly if the "Title" entity was joined with "DecisionInfo".






UNFINISHED / PROBLEMS

Environment Problems:

  • I've restarted my project a few times. Because I made my views early in the project not a lot of time was wasted for each new project attempt as the views were easily transferable.
    • My first attempt was using POJO JDBC, we ran into issues for setup as I could not find any solid path to setup the environment.
    • The same issue occurred using JDBC template.
    • My latest attempt was using Hibernate which I was finally able to receive data from my database to my JSP.

Unfinished: joined Entity Problems

  • I could not properly join entities together in hibernate. e.g. OneToMany and ManyToOne.
  • Create Logging in function and should return user to their personal account page with their data.
  • Search results should populate complete data from all tables not just one.
  • Create Template decisions function and it should populate complete data from all tables not just one.
  • Create Submitting a new decision function should write data to all tables in the DB.
  • Junit Testing NOT DONE.

Bugs

  • New decisions form has input text bugs
  • Contact form for support has validation but does not send emails.





Summation

The current progress made of this project was all done in a 10 day time span, I will continue to study and build this application further for an official release.

I'd like to thank Platform PerScholas for the opportunity to learn Java Development.

Interested in changing careers or expanding your industry knowledge? Platform PerScholas offers free training, contact me and ask about my 12 week experience at Platform PerScholas.











About

Full Stack Dynamic Web Application - Java, JDBC, JSP, Servlets, Maven, Spring MVC, Hibernate, HTML, CSS, JS, JQ.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published