The only thing better than a Maven archetype is a repo you can fork with everything already setup. Skip the documentation and just fork-and-code.
Delete the sample code, replace with your own and you’re good to go.
- Maven - Dependency Management
- Flyway - Version control for database
- JDK - Java™ Platform, Standard Edition Development Kit
- Spring Boot - Framework to ease the bootstrapping and development of new Spring Applications
- MySQL - Open-Source Relational Database Management System
- git - Free and Open-Source distributed version control system
- Thymeleaf - Modern server-side Java template engine for both web and standalone environments.
- Prometheus - Monitoring system and time series database
- Lombok - Never write another getter or equals method again, with one annotation your class has a fully featured builder, Automate your logging variables, and much more.
- Swagger - Open-Source software framework backed by a large ecosystem of tools that helps developers design, build, document, and consume RESTful Web services.
- Postman - API Development Environment (Testing Docmentation)
- Logger (Console, File, Mail)
- RESTful Web Service (CRUD)
- Bootstrap - CSS
- Web - HTML, JavaScript (jQuery)
- Content Negotiation
- Material Design for Bootstrap
- Docker
- HATEOS
- Spring Boot Admin
- NoSQL (MongoDB)
- Micrometer
- Grafna
- Security
There are several ways to run a Spring Boot application on your local machine. One way is to execute the main
method in the com.arc.sbtest.SBtemplateApplication
class from your IDE.
- Download the zip or clone the Git repository.
- Unzip the zip file (if you downloaded one)
- Open Command Prompt and Change directory (cd) to folder containing pom.xml
- Open Eclipse
- File -> Import -> Existing Maven Project -> Navigate to the folder where you unzipped the zip
- Select the project
- Choose the Spring Boot Application file (search for @SpringBootApplication)
- Right Click on the file and Run as Java Application
Alternatively you can use the Spring Boot Maven plugin like so:
mvn spring-boot:run
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
Spring Boot Starter Security default username is user
and a generated security password is printed in the console like Using generated security password: 0423bec1-6759-4ed2-8e3e-e8196effadf9
Automated dependency updates done via Dependabot
To monitor and manage your application
URL | Method |
---|---|
http://localhost:8080 |
GET |
http://localhost:8080/actuator/actuator |
GET |
http://localhost:8080/actuator/health |
GET |
http://localhost:8080/actuator/info |
GET |
http://localhost:8080/actuator/prometheus |
GET |
http://localhost:8080/actuator/httptrace |
GET |
URL | Method | Remarks |
---|---|---|
http://localhost:8080/bw/tech-stack |
GET | Custom Response Headers |
http://localhost:8080/api/generic-hello |
GET | |
http://localhost:8080/api/personalized-hello/ |
GET | |
http://localhost:8080/api/personalized-hello?name=spring-boot |
GET | |
http://localhost:8080/api/loggers |
GET |
- Postman Collection - online, with code auto-generated snippets in cURL, jQuery, Ruby,Python Requests, Node, PHP and Go programming languages
- Postman Collection - offline
- Swagger - Documentation & Testing
The project (a.k.a. project directory) has a particular directory structure. A representative project is shown below:
.
├── Spring Elements
├── src
│ └── main
│ └── java
│ ├── com.arc.application
│ ├── com.arc.application.config
│ ├── com.arc.application.controller
│ ├── com.arc.application.exception
│ ├── com.arc.application.model
│ ├── com.arc.application.util
│ ├── com.arc.application.repository
│ └── com.arc.application.service
├── src
│ └── main
│ └── resources
│ └── static
│ │ ├── css
│ │ │ └── bootstrap.css
│ │ ├── images
│ │ ├── js
│ │ ├── favicon.ico
│ │ └── index.html
│ ├── templates
│ │ └── view.html
│ ├── application.properties
│ ├── banner.txt
│ └── log4j2.xml
├── src
│ └── test
│ └── java
├── JRE System Library
├── Maven Dependencies
├── bin
├── logs
│ └── application.log
├── src
├── target
│ └──application-0.0.1-SNAPSHOT
├── mvnw
├── mvnw.cmd
├── pom.xml
└── README.md
-
models
— to hold our entities; -
repositories
— to communicate with the database; -
services
— to hold our business logic; -
controllers
— to listen to the client; -
resources/
- Contains all the static resources, templates and property files. -
resources/static
- contains static resources such as css, js and images. -
resources/templates
- contains server-side templates which are rendered by Spring. -
resources/application.properties
- It contains application-wide properties. Spring reads the properties defined in this file to configure your application. You can define server’s default port, server’s context path, database URLs etc, in this file. -
test/
- contains unit and integration tests -
pom.xml
- contains all the project dependencies
This Project uses GitHub's integrated issue tracking system to record bugs and feature requests. If you want to raise an issue, please follow the recommendations below:
- Before you log a bug, please https://github.com/AnanthaRajuC/Spring-Boot-Application-Template/search?type=Issues[search the issue tracker] to see if someone has already reported the problem.
- If the issue doesn't already exist, https://github.com/AnanthaRajuC/Spring-Boot-Application-Template/issues/new[create a new issue].
- Please provide as much information as possible with the issue report.
- If you need to paste code, or include a stack trace use Markdown +++```+++ escapes before and after your text.