Skip to content

A complete Java EE Application w/ Servlets, JPA on MySQL with significant functionality

License

Notifications You must be signed in to change notification settings

faizan-ali/full-javaee-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

full-javaee-app

A complete Java EE Application w/ Servlets, JPA with significant functionality
An earlier version of the WorkAmerica platform

Visit us at www.workamerica.co

This codebase is amongst our earlier approaches to developing a full-fledged application (an MVP of sorts). Realizing that it's sitting around gathering dust, we decided to publish the code hoping that it may be of use to somebody out there.

Some of the technologies employed are rather archaic (at least in their implementation), while some can be found in modern applications today. The application is built in Java EE 7, serving content on Java Server Pages (JSPs). It employs EclipseLink 2.0 as the ORM communicating with a MySQL database. The frontend is built on Bootstrap 3 with sprinklings of pure (and sometimes lousy) JavaScript and jQuery here and there.

The application is essentially a database of candidates in the skilled trades (with profiles and logins) that can be searched for by specific criteria such as their credentials, trade, or location. It allows candidates to login and fill out their profiles, and allows employers to login, search for, and filter out candidates to hire. It has all the functionality to do all the above plus much more.

Over the next few months I'll compile examples here of what I think may be useful code across this codebase. This can include API calls on popular services such as Twilio or SendGrid, or more complex scenarios such as implementing a radius-based search of people using the Haversine formula. Since the product's core is data exchange and functionality via pure Servlets, an almost legacy technology (IMO), most of the useful tidbits will be found in helper classes I wrote.

This is a "dead" codebase so existing bugs/unclear or outdated code will not be fixed. But questions can be posted with the help-wanted label. It was uploaded here almost "as is", stripped of proprietary functionality and keys/secrets.

Feel free to dig through and use what you may find, or contact me to clarify things in the codebase.

Cheers

Useful Examples:
External APIs:
  1. Add a new member to a list using the MailChimp API v3.0
  2. Register a user using Facebook authentication
  3. Send an e-mail via SendGrid
  4. Add a new SendGrid contact
  5. Set up a Webhook for SendGrid delivery events via POST
  6. Use Google's Geocode API
  7. Send a text message using the official Twilio Helper Library v3.4.5
  8. Purchase a Twilio number using the official Twilio Helper Library v3.4.5
  9. Set up a Webhook for Twilio delivery events via POST
  10. Set up a Webhook to receive Twilio text messages via POST
  11. Upload a file to an AWS S3 Bucket using the AWS SDK v1.9.6
JPA Related:
  1. Obtain a JPA EntityManagerFactory with configurations obtained from Environment variables
  2. Retrieve a file from MySQL via a JPA entity and use Apache Tika to determine the file type
  3. Upload a file via POST in a Servlet and persist it to MySQL in a JPA entity
  4. Various JPA functionality
Java EE Related:
  1. Upload a file via POST in a Servlet
  2. Implement a 'Login' via Servlet
  3. Implement a 'Logout' via Servlet if using sessions
  4. Various Java EE functionality
  5. Examples of JSP files
  6. Importing a file using JSTL (look for c:import)
  7. Using a JSTL for loop (look for c:forEach)
  8. Using a JSTL if/else|switch statement (look for c:choose)
  9. Using a JSTL if statement (look for c:if)
  10. Using Expression Language (EL) in a JSP (look for ${} tags)
Utilities/Misc/External Libraries.
  1. Calculate the distance between a pair of Latitude/Longitude Co-ordinates (Using the Haversine formula)
  2. Use Apache Tika to determine the file type of a Blob from a MySql database
  3. Convert a Unix timestamp (in ms) to a Date object
  4. Generate a random String of length n
  5. Capitalize the first letter of a String
  6. Get the response of a GET request as a String
  7. Get the client IP from a Servlet request
  8. Read through an .XLSX file using Apache POI
  9. Consume a POST or GET request using Jersey