Skip to content

web-example-basic is a sample project that intended to help Java developers create basic web application using Java based technologies based on MVC (Model View Controller) concept

Notifications You must be signed in to change notification settings

murtidaryandono/web-example-basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

web-example-basic

Table of contents

  1. Version
  2. Description
  3. Technology stack
  4. Architecture
  5. Sequence diagram
  6. Project structure
  7. Tutorial
  8. Environment properties
  9. Run application
  10. Tools
  11. Author

1. Version

Date Version Author Changelog
2022-01-31 1.0.0 Murti Daryandono Initial release

2. Description

web-example-basic is a sample project that intended to help Java developers create basic web application using Java based technologies based on MVC (Model View Controller) concept. In this sample project, some feature will be provided, such as :

  • Page templating
  • Read environment properties
  • Connection to back end REST services
  • Service class based on business logic
  • Controller class to handle request and response that comply with REST format (GET, DELETE, POST, PUT, PATCH)
  • Test REST service

3. Technology stack


4. Architecture

graph TD;
A[Web browser] --> B[Blade - Web framework];
B --> A;
B --> C[Netty - HTTP server];
C --> B;
B --> D[Jetbrick - Page template];
D --> B;
D --> E[Hibiki - HTML & Clay - CSS];
E --> D;
C --> F[Java];
F --> C;
B --> G[SL4J - Logging];

5. Sequence diagram


6. Project structure

project : web-example-basic
+-- pom.xml
+-- README.md
+-- README.img
|   +-- setup_maven_1.png
|   +-- setup_maven_2.png
+-- src
|   +-- main
|       +-- java
|           +-- id
|               +-- daryandono
|                   +-- web
|                       +-- Application.java
|                       +-- core
|                           +-- Bootstrap.java
|                       +-- module
|                           +-- example
|                               +-- IndexController.java
|                               +-- IndexService.java
|       +-- resources
|           +-- application.properties
|           +-- application-stg.properties
|           +-- application-prd.properties
|           +-- static
|               +-- css
|                   +-- atlass.css
|               +-- img
|                   +-- icons.svg 
|               +-- js
|                   +-- hibiki-prod.min.js               
|   +-- test
|       +-- java
|           +-- id
|               +-- daryandono
|                   +-- web
|                       +-- test

7. Tutorial


8. Environment properties

Environment File properties
Development application.properties
Staging application-stg.properties
Production application-prd.properties

Contents of environment properties are :

# server configuration
server.port=[port value where your application will run]

# application configuration
mvc.statics=[path to static directory]
mvc.statics.show-list=[true if you want to be show via url]

9. Run application

  • Run in development environment
java -jar target/web-example-basic.jar
  • Run in staging environment
java -jar target/web-example-basic.jar --app.env=stg
  • Run in production environment
java -jar target/web-example-basic.jar --app.env=prd

10. Tools

  • Java 8 as main language
  • Maven as dependency manager
  • IntelliJ as Java IDE (Integrated Development Environemnt)
  • Mermaid as markdown plugin for diagram

11. Author

name : Murti Daryandono
email : murti.daryandono@gmail.com
twitter : murti_d
blog : https://daryandono.id

About

web-example-basic is a sample project that intended to help Java developers create basic web application using Java based technologies based on MVC (Model View Controller) concept

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published