Skip to content

RobinKumar5986/SpringBoot-Starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Starter

Java Spring Boot

Overview

Spring Starter is a Spring Boot project that provides a basic structure with the MVC architecture, ideal for quickly starting new Spring Boot applications. This starter project includes the foundational components such as JPA annotations, database connection configurations, and API documentation using Swagger. It serves as a starting point for building scalable and maintainable applications with Spring Boot, including RESTful APIs and database interactions.

Database Connection Configuration

spring.datasource.url=jdbc:mysql://localhost:3306/curd_test?useSSL=false&allowPublicKeyRetrieval=true&zeroDateTimeBehavior=CONVERT_TO_NULL
spring.datasource.username=<USER_NAME>  # Example: root
spring.datasource.password=<YOUR_DB_PASSWORD>  # Example: your_password_here

JPA Configuration

spring.jpa.hibernate.ddl-auto=update
spring.jpa.database-platform=org.hibernate.dialect.MySQL8Dialect

Configure the above in the applications.properties file

image.png

API Documentation

Once the project is running, you can easily access the API documentation via Swagger UI.

Simply open your browser and navigate to the following URL:

http://localhost:9090/swagger-ui/index.html

This will provide an interactive interface where you can view and test all the available API endpoints for your application.

image.png

Example API Request and Response

You can test the API using curl by sending a POST request to create a new employee. Here's an example:

Request

curl --location 'localhost:9090/api/v1/employee' \
--header 'Content-Type: application/json' \
--data-raw '{
    "firstName": "Raju",
    "lastName" : "Singh",
    "eMail" : "[email protected]"
}'

Response

{
    "id": 1,
    "firstName": "Raju",
    "lastName": "Singh",
    "eMail": "[email protected]"
}

This example demonstrates how to create a new employee through the API and the structure of the response you will receive.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages