/Springboot-API-Starter

Start your SpringBoot 3 application development with a comprehensive starter template. It includes user authentication with JWT, PostgreSQL integration with docker-compose, Swagger documentation, Lombok for code generation, Spring validation, exception handling, API versioning, custom error responses, CORS support, unit testing, and logging.

Primary LanguageJava

SpringBoot API Starter


Setup Database

Start The docker-compose File

RUN: docker-compose up -d

Exec The Postgre Container

RUN: docker exec -it springboot-api-postgres-c psql -U admin

List All Databases RUN: \list

CREATE starter DATABASE RUN: CREATE DATABASE starter;

List All Databases RUN: \list

THIS SHOULD NOW INCLUDE A NEW DATABASE starter


NOW RUN THE PROJECT - MAIN.java

In IntelliJ IDEA - navigate to MAIN.java File Under - src > main > java > com.skdev

In The Top Bar Select main and then click on Play Icon To Start The Project.


SWAGGER DOCS

In Your Browser Open: http://localhost:8080/swagger-ui/index.html

Most of the APIs are protected so user needs to be authenticated to use those. Create a new user /api/v1/auth/register, copy the token from response, click on authorize button in top-right corner and paste the token in value field, and click on authorize.

Now protected routes can be used.