This is a basic CRUD Application for Account Management.
You can access swagger-ui by landing on below web address after server startup.
http://localhost:8080/swagger-ui/index.html
Java (https://www.oracle.com/java/technologies/downloads)
Maven (https://maven.apache.org/download.cgi)
This is a basic CRUD account management service for demo purpose.
Client: N/A
Language: Java
DataBase: H2
Plugins/Frameworks: Spring Boot
H2 DataBase
SpringDoc-OpenAPI-Starter-WebMVC-UI
Spring-Boot-Starter-Web
Spring-Boot-Starter-Data-JPA
Lombok
Spring-Boot-Starter-Validation
Spring-Boot-Starter-Test
To deploy this just put the jar file inside tomcat deployment folder i.e. webapps
To build backend use below command
\account-management-service\target> mvn clean install
Use below command to up service
\account-management-service\target> java -jar apartment-manager-0.0.1-SNAPSHOT.jar
\account-management-service> mvn spring-boot:run
You can refer this web address to explore more about me here.
Sample Request
curl -X 'POST' \
'http://localhost:8080/api/v1/account' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name": "Gaurav Kumar",
"email": "[email protected]",
"country": "US",
"postalCode": "60661",
"age": 22,
"status": "REQUESTED"
}'
Sample Response
{
"accountId": "Bv3bAO",
"status": "REQUESTED",
"securityPIN": "2939"
}
Sample Request
curl -X 'GET' \
'http://localhost:8080/api/v1/account?accountId=Bv3bAO&email=gaurav.mute%40gmail.com' \
-H 'accept: application/json'
Sample Response
{
"accountId": "Bv3bAO",
"name": "Gaurav Kumar",
"email": "[email protected]",
"age": 22,
"status": "REQUESTED",
"securityPIN": "2939",
"addresses": [
{
"id": 1,
"country": "United States",
"countryCode": "US",
"postalCode": "60661",
"state": "Illinois",
"stateCode": "IL",
"city": "Chicago",
"latitude": "41.8814",
"longitude": "-87.643",
"createdAt": "2024-10-31T06:16:42.835+00:00",
"updatedAt": null
}
],
"createdAt": "2024-10-31T06:16:42.835+00:00",
"updatedAt": null
}
Sample Request
curl -X 'GET' \
'http://localhost:8080/api/v1/account/count' \
-H 'accept: application/json'
Sample Response
[
{
"country": "US",
"count": 1,
"states": [
{
"state": "IL",
"count": 1,
"places": [
{
"place": "Chicago",
"count": 1
}
]
}
]
}
]
Sample Request
curl -X 'PUT' \
'http://localhost:8080/api/v1/account/Bv3bAO?name=Gaurav%20Kumar&country=US&postalCode=60661&age=22&status=ACTIVE' \
-H 'accept: application/json'
Sample Response
{
"status": "OK",
"message": "Account updated successfully"
}
Sample Request
curl -X 'DELETE' \
'http://localhost:8080/api/v1/account/delete/Bv3bAO/2939' \
-H 'accept: application/json'
Sample Response
{
"status": "OK",
"message": "Account deleted successfully"
}