FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

PouyaPouryaie/basicFeaturesForSpringProject at 1.1.0 · GitHub

Latest commit

 

History

35 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BasicFeaturesForSpringProject

this project, implement instance of basic feature,
you maybe want use for App base on Spring-boot

basicFeature

  • spring-web
  • spring-jpa
    • with custom configuration for PersistenceContext
  • Ehcache
    • customize cache config and implement log for cache
  • Log4j2
    • logging and config log-message
  • Exception management
  • MapStruct
    • mapper tools for map view to entity and vice-versa
  • Validation handler
    • use annotation for validation
    • use log for validation error
    • define your validation and use for model
  • TestUtils
    • generator data with javaFaker
    • unit and integration test with Spock Framework
    • SwaggerAPI for show detail of Rest endpoint
    • TestContainer use for run db as dockerImage for test, and after that image is stop
  • decoupling layer
    • controller, service and repository layer for easy extend
  • flexible search
    • use CriteriaQuery and CriteriaBuilder for search base on Entity

Run guide

Run for develop and debug:

1 - check active profile on dev
2 - run postgre sql on 5432 and create database myapp
3 - run app
4 - app.generator.enabled properties set to true, when you want to generate fake data

Run as docker image:

1 - check active profile on docker and package project
2 - run docker build command for create app image : docker build -t springapp:latest .
3 - run docker compose run command for running app

Features

exception feature

1 - use AppException for define your own error Exception
2 - user HttpExceptionModel for define your own error message and show to client
3 - use HttpErrorCode for unifying error code in project

validation feature

1 - create your own validation type
2 - define your own validation process for entity
3 - use "@validator" annotation on field of entity for validate
4 - log for validation and save error-message in log file

search feature

1 - create your own search model
2 - use pagination for search
3 - create query dynamic base on search request
4 - use order and direction for sort data

test feature

1 - generate sample data baseOn model with javaFaker
2 - Spock framework use for test
3 - sample test define in test directory with groovy language
4 - Swagger Api for show details of endpoints
5 - In order to change swagger url, you must be change springdoc.swagger-ui.path property in application-dev.properties
6 - TestContainer for run db as dockerImage, properties config exist in application-test.properties

About

This Repo contain basic features for develop application base on spring boot. some of this features is RestApi, cache, hibernate, mapper, test, docker and .....

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages


Back | FazBrowse Home | New Git URL