Ideas, Explanations for Information Keeping Web Application using Spring Boot, Data JPA, Thymeleaf, Spring Security.
- Uses MVC pattern as an architectural design pattern.
-> Model [M] -> User and Contact [ One User have many contacts]
-> View [V] -> View pages [.html] files in our cases
-> Controller [C] -> Holds all the required business logic (service logic will be handled by services but will be used in controller)
-> java -> All the source codes -> static -> All CSS, JS & Images and all static files if any -> templates -> All HTML files [thymeleaf] -> application.properties -> all application properties (contains environment wise properties like for local and production with profiling activation) -> pom.xml file -> Includes all the dependencies required
Spring Web, Hibernate, Data JPA, Thymeleaf, Security, PostgresSQL, Apache POI, OpenCSV
- User can register and use the application. By default they will be registered as normal user without admin previleges.
- Admin user will have additional reserved endpoints where they can perform certain action when they login.
- User can add information, for example: add notes/contact information with few text fields and an image field.
- User will have navigation options when there are large number of entries.
- User can reset/update passwords
- User can import contacts from CSV file and application will store it into the database.
- Additionally, user can also export the contact list in the csv/excel file.
- When code gets pushed to github, github action will trigger that will actually run unit tests using maven, build it, create the docker image and push it to the dockerhub.
- To access actuator endpoint, hit /actuator and you'll see all the available endpoints. By default, only /actuator/health is enabled.
- To get all other endpoints, include "management.endpoints.web.exposure.include=*" in application.properties file.
- For example, now you can access: /actuator/metrics, it will give all the metrics information which you can use to see additional information. Like copy name displayed in /metrics and append that as : metrics/hikaricp.connections
- This will give hikari connection pool info like total no of connections. And other ppts will give other important information.
-
'Uses Docker Image available at docker hub link below and postgres official docker image to run the application with docker-compose'
-
To test use command
docker pull badripaudel77/info-keeper-spring-boot-docker:my-info-app
-
And to run, type the command
docker run -p 8080:8080 badripaudel77/info-keeper-spring-boot-docker:my-info-app
and hitlocalhost:8080
in browser and you should good to see the result. -
NOTE: Sometimes, to build image (caching effect will not show the recent changes sometimes)
docker-compose up --build
docker-compose up
Note : For detail explanation of how to dockerize simple spring boot Java application you can visit my website at guides to code
-
This branch will use docker compose to create image, run as application wants to run with database docker image.
-
For reference : Docker compose at Baeldung