Skip to content

customer api using spring boot framework with a jpa thymeleaf hibernate mysql with this all features created rest api.

Notifications You must be signed in to change notification settings

yashtank86/customer-api-springboot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Customer API Documentation

customer api - spring boot application. This api is built with Spring Boot, utilizing MySQL for data storage. It exposes endpoints to manage customer information, including id, first_name, last_name, email, and phone_number. The API is designed to be powerful, scalable, and easy to integrate into your applications.

Note

    It's My First Springboot Back-end Project In which I have Implemented Rest API
    and also uses postman to test api:)

    🌟 Thank you, me, for making it happen! Let's keep coding and building awesome things! 🚀

    🚀 Key Achievements:

    Developed a RESTful API that showcases my proficiency in Java and Spring Boot.
    Successfully handled the integration of MySQL, ensuring data persistence and reliability.
    Demonstrated a commitment to best practices, documentation, and a user-friendly API design.

Prerequisites

    Maven 3+.
    MySQL Workbench 8+.
    Postman v9+.

Generate the Project

    Go to the website Spring Initializr to initialize the Spring Boot project. Add the following dependencies:
    Spring Boot DevTools: for the development tools.
    Lombok: to reduce boilerplate code (for example, getters and setters).
    Spring Web: to embed Apache Tomcat and include Spring MVC.
    Spring Data JPA: to facilitate the database layer.
    MySQL Driver: to enable communication between the Spring Boot application and the database.

Navigate to the project directory:

Directory Structure
image

Configure the MySQL database connection in application.properties.

spring.datasource.url = jdbc:mysql://localhost:9090/customer-management-system
spring.datasource.username = root
spring.datasource.password = root
spring.jpa.hibernate.ddl-auto = update
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLDialect

server.error.include-stacktrace = never

server.port = 8090

mvn spring-boot:run

The API will be accessible at http://localhost:8090/customer/save for POST method.
http://localhost:8090/customer/retrieve/[email protected] 
:= for GET method. Its uses emailId for retrieve the information from database

Testing with Postman

    Test the application using Postman.
    Add a couple of customers.
    
    Enter the body of the request:
    
    {
        "first_name": "rahul",
        "last_name": "sharma",
        "email": "[email protected]",
        "phoneNumber": "9515517878"
    }

Select SEND, and rahul sharma will be saved into the database

MySql
image

The project utilizes the following Tech:

🌐 Tech Stack:
🖥️ Java | Spring Boot | Hibernate
🛢️ MySQL
🚀 RESTful APIs
🔧 Git | Maven

All dependencies are managed using Maven.

Screenshorts

GET {retrieve an customer from database using emailID}
img1
Screen2
img2
mysql workbanch
img3
POST {Create an customer}
img4

Usage

Make requests to the specified endpoints using your preferred API client.
Ensure proper authorization and authentication mechanisms are in place.
Integrate the API into your applications to manage customer data efficiently.

Contribution

Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License.

About

customer api using spring boot framework with a jpa thymeleaf hibernate mysql with this all features created rest api.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages