README.md

November 8, 2021 · View on GitHub

Modular Java, Embedded Tomcat, Fat Jar, Vue JS

Application to demonstrate various parts of a service oriented RESTfull application.

Demo (Heroku Hosted)

Allow about 2-3 mins for the instance to start

Technology Stack

ComponentTechnology
Backend LangJava 11 (with modules)
Restfull FrameworkJersey
ContainerTomcat 9 (Embeded Mode)
Server Build Toolsmaven 3.5.4 (Creates a Executable Jar with embeded tomcat)
SecurityToken Based (JWT )
REST SpecOpen API Standard
In Memory DBH2
PersistenceJPA (Using Hibernate)
FrontendVue JS
Client Build Toolsvue-cli, Webpack, yarn

Prerequisites

Ensure you have this installed before proceeding further

  • Java 11+
  • Maven 3.5.4+
  • yarn 1.10.1
  • node 10.12.0
  • vue-cli 3.0.5

Folder Structure

PROJECT_FOLDER
  README.md
  pom.xml       # Parent maven project (contains other sub projects)

└──[database]    # Java-Project/Java-Module (contains H2 database related services )  
  pom.xml       
  └──[src]      
     └──[main]      
        └──[java]         # java source files   
        └──[resources]
              schema.sql  # Contains sql script to generate database tables and views in H2
              data.sql    # Contains sql script to fill the tables with sample data

└──[web-api]     # Java-Project/Java-Module ( The Main WebApp contating RESTfull APIs )  
  pom.xml      
  └──[src]      
     └──[main]      
        └──[java]        # java source files   
        └──[resources]
        └──[webapp]      # files/folders under webapp is accessible from web-browser
           └──[ui]       # maven build script would copy web-ui/dist into this folder, to make UI available from the browser
           └──[api-docs] # contains swagger-ui source for API documentation and try-out

└──[web-ui]     # A regular folder that contains VueJS based UI source code 
  package.json  
  vue.config.js  
  package.json   
  └──[node_modules] # files under this is downloaded by 'yarn install' command       
  └──[dist]         # VueJs source is compiled, bundled and minified into this folder 
  └──[src]          # contains ui source code

Build Process

  • 1st Build Frontend (optional, required only if you make changes to frontend code )
  • Then Build Backend (backend build script will copy UI code build above into itself)

To build frontend (optional step)

# run these commands from web-ui folder

yarn install
yarn build

To build backend

# run these commands from root folder where top-level pom.xml is present

# build the web app
mvn clean install

# Run The App 
java -jar ./web-api/target/modules/web-api-1.0.0.jar
Once the App is running
App ComponentURLs
URL for the web apphttp://localhost:8080 or http://localhost:8080/ui/index.html
URL for API Docshttp://localhost:8080/api-docs/index.html
BaseURL for REST APIshttp://localhost:8080/api

Screenshots

Login

Dashboard

API Reference

Backers

Help me to host this app on AWS or Google-Cloud, for everyone to checkout the app. [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]