Git Product home page Git Product logo

jhonatanaraujo1 / java-springboot-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 101 KB

Java Springboot Boilerplate

Dockerfile 0.14% Java 96.43% HTML 3.43%
java-17 maven spring-boot boilerplate boilerplate-application boilerplate-back-end boilerplate-template crud-application hibernate java maven-pom postgres rest-api spring spring-security spring-security-jwt springboot-template

java-springboot-boilerplate's Introduction

Boilerplate JAVA 17 SpringBoot

Boilerplate JAVA 17 SpringBoot - A boilerplate for Spring Boot with JWT authentication, email functionalities, and much more. ๐Ÿš€โญโšก

Overview

Boilerplate JAVA 17 SpringBoot is a Spring Boot boilerplate that provides a solid foundation for building web applications with JWT authentication, CORS filters, email functionalities, and more. It comes with a set of features and configurations more fast as possible your development. I will commit some improvements over time here and I will also create a boilerplate in Kotlin as the next objective, if possible send improvements to this project, I will insert crud abstraction here too and in Kotlin crud it will also be something very similar to this โšก๐Ÿš€โญ


Features

  • JWT authentication
  • CORS filter configuration
  • Token provider and JWT authentication filter
  • User roles with permissions
  • Email functionalities (account creation, email verification, login, password reset, password forget)
  • Example controller, service, repository, entity, and domain
  • Exception handling
  • Seeder for initial user creation with example permissions
  • Lombok for simplified mapping and reduced boilerplate code
  • Dockerfile for containerization
  • Docker Compose for easy database setup
  • Supports Java 17 and Spring Boot 2.5

Getting Started

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Java 17
  • Docker (for database containerization)
  • SMTP server credentials for email setup (optional)

Setup

  1. Clone the repository:

    git clone https://github.com/jhonatanaraujo1/java-springboot-boilerplate.git
    
  2. Navigate to the project directory:

    cd exemple.backend
    
  3. Build the project:

    mvn clean install
    
  4. Execute Docker-compose:

    docker-compose up
    
  5. Just Run :

    mvn spring-boot:run
    

Configuration

The configuration for the project can be found in the application.properties file. Update the necessary properties, such as database connection details and SMTP server credentials, as per your requirements.


Usage

API Endpoints

The application provides several API endpoints for authentication, user management, and example functionalities.


Example Controller

The project includes an example controller (ExampleController.java) that demonstrates the usage of JWT authentication and basic CRUD operations.


Seeder

The seeder (SeedEventListner.java) is responsible for creating initial users with example permissions. Modify it to suit your needs.


Exception Handling

The project includes a robust exception handling mechanism. Custom exceptions are thrown and handled appropriately to provide meaningful responses.


Libraries

The project uses various libraries to enhance functionality and simplify development. Key libraries include:

  • Spring Boot
  • Lombok
  • Mapstruct
  • Spring Security
  • JWT
  • Hibernate
  • Thymeleaf
  • and more...

Mapper

The project includes an example mapper (ExampleMapper.java) that uses Mapstruct and Lombok for simplified mapping between entities and DTOs.


Docker

The Dockerfile (Dockerfile) is included for containerization. Build and run the Docker image to deploy the application in a containerized environment.


Email Setup

To enable email functionalities, provide the necessary SMTP server credentials in the application.properties file. Two example server configurations are provided, choose one based on your requirements.


Unit Testing

Unfortunately, the test for this section did not pass โŒ, but it is crucial for all projects. I'll do it later.


Monitoring

๐Ÿšจ Monitoring is Essential!

While the monitoring setup is currently not in place (โŒ), I recognize its importance in ensuring the health and performance of the application. Rest assured, I'll be working on implementing a robust monitoring solution to keep track of key metrics, identify issues promptly, and ensure a smooth user experience.


CI/CD

๐Ÿ”„ Continuous Integration/Continuous Deployment (CI/CD) Coming Soon ๐Ÿšจ

I acknowledge the absence of CI/CD setup (โŒ) at the moment, but I want you to know that it's high on my priority list. Implementing CI/CD pipelines is crucial for automating the testing and deployment processes, ensuring code quality, and delivering updates seamlessly. Stay tuned for upcoming improvements in this area!


Contributing

If you find this project helpful or valuable, consider giving it a star! โญ Also, follow me on LinkedIn for updates and more.


๐Ÿšจ๐Ÿšจ IMPORTANT ๐Ÿšจ๐Ÿšจ

If you encounter any bugs, please feel free to reach out by sending a message or creating a pull request.โšก๐Ÿš€

java-springboot-boilerplate's People

Contributors

jhonatanaraujo1 avatar

Stargazers

Ricardo da Silva Girardi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.