Skip to content

This project is an out-of-the-box, providing common tools and template classes for java web application development, its usage is very similar to spring-boot-starter-web.

License

Notifications You must be signed in to change notification settings

soupedog/hygge-project

Repository files navigation

Born To Simplify Java Web Application Development

maven code style

Links

Introduction

  • Do you struggle with the design of a unified exception system with high scalability?
  • Do you struggle with the lack of Rest API request/response logs?
  • Do you struggle with the lack of a powerful Http request tool?
  • Do you struggle with the configuration of a trivial and cumbersome logging system?
  • Do you struggle with the interconversion between basic data types and the assignment of default values to parameters?

If you answered yes, then I would strongly recommend you to use the hygge-project.

Building Block Description
hygge-commons hygge core entity(includes Exception、POJO)
hygge-commons-spring-boot For initializing HyggeSpringContext to provide support to other modules
hygge-logging Simplify the logging framework configuration and make the logs have good support for exporting json format records
hygge-util Tools for data transformation, validation, iteration, etc.
hygge-web-toolkit Provide web application development template tools and network request tools

JDK Requirement

Java SDK v1.8 or higher

Warning: this project relies on spring-boot, and if spring-boot drops support for lower versions of java in the future, this project will also drop support for lower versions of java.

Features

hygge-web-toolkit is designed as a starter for spring-boot. It also depends on other libraries, and the following dependencies, which you no longer need to add manually, will be added to the project automatically:

  • Hygge-Project
    • hygge-commons
    • hygge-commons-spring-boot
    • hygge-logging
    • hygge-util
  • Third Party Dependencies
    • spring-boot-starter-web
    • spring-boot-starter-aop
    • httpclient

After you import the hygge-web-toolkit into your project, you will obtain the following features of hygge-project:

  • Global unified semantic exceptions.
  • Automatically configure the logging framework so that the application has good support for outputting json format logs. The following logging frameworks are supported:
    • logback
    • log4j
  • Network request tool based on RestTemplate , each API call can be individually configured with parameters such as timeout time, automatic request logging, providing convenient and practical syntax sugar.
  • Some data validation, fetching, iterating and other tools that are often needed in your development.
  • Standardized exposed endpoint template tool.
  • Automatic logging the request and response for exposed endpoints.

Quick Start

  • Make sure you provide the name for the application.
    • For example: You have to add spring.application.name to your application.properties
    spring.application.name=xxx
  • Make sure you provide the "-parameters" compiler flag.(If you are using a version of hygge-project greater than or equal to 0.15 )
    • For example: You can configure your org.apache.maven.plugins in pom.xml as follows
      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.10.1</version>
          <configuration>
              <compilerArgument>-parameters</compilerArgument>
              <!-- depending on your project -->
              <source>8</source>
              <!-- depending on your project -->
              <target>8</target>
          </configuration>
      </plugin>

Maven Dependencies

maven

If you are using Maven just add the following dependency to your pom.xml:

<dependency>
    <groupId>io.github.soupedog</groupId>
    <artifactId>hygge-web-toolkit</artifactId>
    <version>${latest.version}</version>
</dependency>

hygge-web-toolkit relies on spring-boot related components, but no forced dependency about the spring-boot version, you can specify special versions in any of the following ways

  • <parent/>

    <parent>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-parent</artifactId>
      <version>${Your specific spring-boot version}</version>
      <relativePath/> <!-- lookup parent from repository -->
    </parent>
  • <dependencyManagement/>

    <dependencyManagement>
      <dependencies>
        <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-web</artifactId>
          <version>${Your specific spring-boot version}</version>
        </dependency>
        <!-- Omit the other spring-boot components you need-->
        <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-test</artifactId>
          <version>${Your specific spring-boot version}</version>
        </dependency>
      </dependencies>
    </dependencyManagement>

Samples

The basic runnable sample project: web-application-example

About

This project is an out-of-the-box, providing common tools and template classes for java web application development, its usage is very similar to spring-boot-starter-web.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages