userapp is a Spring Boot application designed for user management. It provides RESTful APIs for creating user, and quering user information.
- Java 8+
- Spring Boot 3.2.0
- Spring Web
- Spring WebFlux
- Spring Data JPA
- MySQL Connector
- Lombok
- Jackson Databind
- Mockito
- JSON Path
- Hamcrest
To run the application your system must have the following:
- Java 17
- MySQL Database
- Clone/copy the project
- Navigate to the project directory
- Build project using Maven
- Configure the project in the application.yml file
server:
port: 8080
spring:
datasource:
url: jdbc:mysql://localhost:3306/userdb
username: your_db_username
password: your_db_password
driver-class-name: com.mysql.cj.jdbc.Driver
jpa:
hibernate:
ddl-auto: update
show-sql: false
- Run the application:
mvn spring-boot:run
Available REST API endpoints:
-
POST /api/users : Create N new user.
Request payload
{ "size" : 5 }here "size" value is in the range of 1 to 5
Response payload contains a list of new users created
-
GET /api/users : Get a list of users based on the query parameters
Should support 4 query params:
?sortType=<Name/Age>?sortOrder=<EVEN/ODD>?limit=5limit value can be 1 - 5?offset=0offset value can be 0 - 5
Response payload contains a list of users and page information