bibekaryal86 / pets-all-in-one

Maven/Gradle Multi Module Single PETS app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pets-all-in-one

Maven / Gradle Multi Module Single PETS app

This is a monolith app (has been replaced with microservices/SPA) uses Spring MVC with JSP, and combines most of the functionalities of the following five apps:

Instead of separate apps for database, business, authenticate, gateway and ui layers, the separate logic are placed in different modules - database, service, ui, and a common module for model/pojos. There is no need for gateway and authenticate layers which are handled within this single app.

The app does not have Spring Boot starter, so the generated war does not have embedded container. Hence the app needs to be loaded to outside container (Tomcat/Jetty) to run.

When running the app, we need to supply the following environment variables to the container:

  • Active Profile:
    • spring.profiles.active (development, gcp, aws)
  • Log Config for logfile location:
    • LOG_CONFIG (development, gcp, aws)
  • MongoDb Database Details:
    • MONGODB_ACC_NAME (account name of database)
    • MONGODB_USR_NAME (database username)
    • MONGODB_USR_PWD (database password)

To run the app, first create WAR file:

  • For WAR file to upload to Google Cloud Project, use mvn clean package
  • For WAR file to upload to AWS Elastic Beanstalk or docker or locally, use mvn clean package -P development. This excludes GCP related dependencies.

After creating the WAR file, the app can be run as:

  • Local: Use container like Tomcat. This can be used as well: https://github.com/bibekaryal86/simple-jetty-container
  • Docker: For local deployment, docker can be used as well, although this repo does not contain Dockerfile
  • AWS: Upload the WAR file to Elastic Beanstalk, set the environment variables, and that should be it. The .ebextensions folder in src/main/webapp contains configurations for viewing logs in the AWS UI.
  • GCP: Use Cloud Tools for Eclipse plugin for Eclipse for easiest way to deploy. It requires appengine-web.xml in the WEB-INF folder besides web.xml where environment variables should be set (DUMMY file with dummy passwords provided)

This app is deployed to:

best to use war file from gradle for local/AWS and keep maven configuration for GCP

About

Maven/Gradle Multi Module Single PETS app


Languages

Language:Java 94.4%Language:JavaScript 3.9%Language:CSS 1.7%