This project is a complete RESTful API built with the latest versions of Spring Boot 3, Spring Framework 6, and Java 17. It adheres to the Richardson Maturity Model, ensuring a high level of RESTful maturity.
- Introduction
- Project Structure
- Richardson Maturity Model
- Technologies Used
- Getting Started
- API Endpoints
- License
This API is designed to provide a robust, scalable, and high-performance RESTful web service. It leverages the latest features and enhancements from Spring Boot 3, Spring Framework 6, and Java 17 to deliver a modern API that adheres to best practices in software development.
src/
└── main/
├── java/
│ └── com/
│ └── example/
│ └── restapi/
│ ├── controller/
│ ├── model/
│ ├── repository/
│ ├── service/
│ └── RestApiApplication.java
└── resources/
├── application.properties
└── data.sql
The Richardson Maturity Model (RMM) is a way to evaluate the maturity of a RESTful web service. It consists of four levels:
- Level 0 - The Swamp of POX: Single URI endpoint, typically using HTTP POST for all actions.
- Level 1 - Resources: Multiple URI endpoints, each representing a resource.
- Level 2 - HTTP Verbs: Using standard HTTP methods (GET, POST, PUT, DELETE) for interactions.
- Level 3 - Hypermedia Controls: Utilizing Hypermedia As The Engine Of Application State (HATEOAS) to provide navigable links within responses.
This project aims to reach Level 3 by implementing HATEOAS to guide clients through the API, making it more self-explanatory and easier to use.
- Spring Boot 3: Simplifies the creation of stand-alone, production-grade Spring-based applications.
- Spring Framework 6: Provides comprehensive infrastructure support for developing Java applications.
- Java 17: The latest long-term support (LTS) release of the Java programming language, bringing new features and performance improvements.
- HATEOAS: Hypermedia as the Engine of Application State, a constraint of RESTful systems.
- JDK 17 or later
- Maven 3.6.3 or later
-
Clone the repository:
git clone https://github.com/your-username/complete-restful-api.git cd complete-restful-api
-
Build the project:
mvn clean install
-
Run the application:
mvn spring-boot:run
The application should now be running on http://localhost:8080
.
Here are some example endpoints provided by this API:
- GET /users: Retrieve a list of all users.
- GET /users/{id}: Retrieve a specific user by ID.
- POST /users: Create a new user.
- PUT /users/{id}: Update a user by ID.
- DELETE /users/{id}: Delete a user by ID.
- GET /orders: Retrieve a list of all orders.
- GET /orders/{id}: Retrieve a specific order by ID.
- POST /orders: Create a new order.
- PUT /orders/{id}: Update an order by ID.
- DELETE /orders/{id}: Delete an order by ID.
Each response includes hypermedia links to guide clients through available actions, adhering to HATEOAS principles.
This project is licensed under the MIT License. See the LICENSE file for details.