- Version
- Description
- Technology stack
- Architecture
- Sequence diagram
- Project structure
- Tutorial
- Environment properties
- Run application
- Tools
- Author
Date | Version | Author | Changelog |
---|---|---|---|
2022-01-31 | 1.0.0 | Murti Daryandono | Initial release |
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
- Blade : Java web framework (here are blade link & baeldung link)
- Gson : JSON manipulation tools from Google (Gson link)
- Jetbrick : Java page templating (Jetbrick link)
- SL4J : Java logging framework
- Project Lombok : Java getter & setter auto generation (Project Lombok link)
- JUnit : Java unit test framework
- Hibiki : HTML framework without JS (Hibiki link)
- Clay : CSS framework implementing Lexicon design (Clay link)
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];
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
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]
- 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
- Java 8 as main language
- Maven as dependency manager
- IntelliJ as Java IDE (Integrated Development Environemnt)
- Mermaid as markdown plugin for diagram
name : Murti Daryandono
email : murti.daryandono@gmail.com
twitter : murti_d
blog : https://daryandono.id