/SpringBootTemplate

It is a draft structure prepared for Spring Boot projects with JWT and others. Check the Readme for details.

Primary LanguageJava

Spring Boot Project Template

Build Status

WARNING! GitHub Actions will fail for this draft repo. Because the project could not be deployed. The reason is that there is no valid DB connection in the application.yml.

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

CodeQL

Java CI with Maven

Motivation

It is a draft structure prepared for Spring Boot projects. Check the readme for details.

Solution


Tech / Framework used

The application runs on Java 17. Dockerfile and GitHub Actions configurations are also set this way.

It uses 3.0 which is one of the current Spring Boot versions. The User and Role model classes and the Repo - Service - Controller layers based on them are readily available.

In the project where the JWT infrastructure is ready, "api/v1/auth/**" paths are determined as permitAll(). Bearer token must be entered for other controller requests.

The application.yml file of the project has been made ready for MySQL connection.

If the project is pushed to any GitHub repository, GitHub Actions workflows are automatically deployed.

If the project is desired to be converted into an Docker image, the Dockerfile is also available for this.

Other Utilities

You can diversify the exception handlers that are already placed in the User and Role CRUDs according to your needs.

Email validator is available for User registrations.

User passwords are hashed before being saved to the database.

application.yml is organized to facilitate DB connections. With the help of the website in banner.txt under the /src/main/resources/ folder, you can change the banner that will appear when Spring Boot is run.

From the Maven plugins, you can run Code Formatter & Import Sorter plugins.


Installation

How to use it?

GitHub

Steps

  1. Clone the repo https://github.com/ugurcanerdogan/SpringBootTemplate
  2. Change project name and all the import statements
  3. Add your own project needs (models, controllers, business logics etc.)
  4. Run it and voilĂ  app up and running !

References


License