โ Jersey Demo API with Spring Boot
โ ๐ Project Overview
This is a comprehensive RESTful API built with Spring Boot and Jersey that demonstrates modern Java web development practices. The application provides a complete user management system with full CRUD (Create, Read, Update, Delete) operations, following RESTful principles and best practices.
โ ๐ Key Features
User Management : Full lifecycle management of user resources
RESTful Design : Clean, intuitive API endpoints following REST conventions
In-Memory Storage : Lightweight storage solution for development and testing
Input Validation : Robust validation of request payloads
Error Handling : Comprehensive error responses with appropriate HTTP status codes
Docker Support : Containerized deployment with multi-stage builds
โ ๐ ๏ธ Technology Stack
โ Core Technologies
Java 17 : Latest LTS version for modern Java development
Spring Boot 3.2.0 : Rapid application development framework
Jersey (JAX-RS) : JAX-RS reference implementation for building RESTful web services
Maven : Dependency management and build automation
โ Development Tools
Docker : Containerization for consistent environments
Git : Version control
Spring Boot DevTools : Developer productivity tools
Lombok : Reduced boilerplate code
โ Testing
JUnit 5 : Next-generation testing framework
MockMVC : Spring's testing framework for web applications
REST Assured : For testing RESTful services
โ ๐ Learning Outcomes
By exploring this project, you'll gain hands-on experience with:
โ Backend Development
Building production-grade REST APIs with Spring Boot and Jersey
Implementing proper error handling and validation
Working with in-memory data structures for rapid development
Understanding HTTP methods and status codes
API documentation best practices
โ Modern Java Development
Java 17 features and best practices
Dependency injection with Spring
Building modular, maintainable applications
Working with Maven for dependency management
โ DevOps & Deployment
Containerizing applications with Docker
Multi-stage Docker builds for optimized images
Continuous Integration/Deployment concepts
Environment configuration management
โ API Design
RESTful architecture principles
Resource naming conventions
Request/response patterns
Versioning strategies
Error handling patterns
โ Testing
Unit testing REST controllers
Integration testing with TestRestTemplate
Testing RESTful endpoints
Mocking dependencies
โ ๐ Features
Create, Read, Update, and Delete users
In-memory data storage
JSON request/response
Docker support
Spring Boot 3.2.0 with Java 17
Jersey JAX-RS implementation
Maven build system
โ ๐ Prerequisites
Java 17 or higher
Maven 3.8+
Docker (optional, for containerization)
cURL, Postman, or similar API testing tool
โ ๐ ๏ธ Installation
โ Local Development
Clone the repository
git clone https://github.com/yourusername/jersey-demo.git
cd jersey-demo
Copy
Build the application
./mvnw clean install
Copy
Run the application
./mvnw spring-boot:run
Copy
The application will be available at http://localhost:8080
โ ๐ณ Docker Support
โ Build the Docker Image
docker build -t jersey-demo .
Copy
โ Run the Docker Container
docker run -p 8080:8080 jersey-demo
Copy
โ Push to Docker Hub
Login to Docker Hub
Tag the image
docker tag jersey-demo yourusername/jersey-demo:1.0.0
Copy
Push the image
docker push yourusername/jersey-demo:1.0.0
Copy
โ ๐ API Documentation
โ Base URL
http://localhost:8080
Copy
โ Endpoints
โ Get All Users
Example Response:
{
"users": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"firstName": "John",
"lastName": "Doe",
"uri": "/users/550e8400-e29b-41d4-a716-446655440000"
}
]
}
Copy
โ Create a New User
Request Body:
{
"firstName": "John",
"lastName": "Doe"
}
Copy
Example Response (201 Created):
Status: 201 Created
Location: /users/550e8400-e29b-41d4-a716-446655440000
Copy
โ Get User by ID
Example Response:
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"firstName": "John",
"lastName": "Doe",
"uri": "/users/550e8400-e29b-41d4-a716-446655440000"
}
Copy
โ Update User
Request Body:
{
"firstName": "John",
"lastName": "Smith"
}
Copy
โ Delete User
โ ๐งช Testing
Run the test suite with:
โ ๐ค Contributing
Fork the repository
Create your feature branch (git checkout -b feature/AmazingFeature)
Commit your changes (git commit -m 'Add some AmazingFeature')
Push to the branch (git push origin feature/AmazingFeature)
Open a Pull Request
โ ๐ License
This project is licensed under the MIT License - see the LICENSEโ file for details
โ โ๏ธ Contact
โ ๐ License
This project is licensed under the MIT License - see the LICENSEโ file for details
Made with โค๏ธ by Philip Paz |
โ
โ
โ ๐ Additional Resources
โ ๐ Project Status
โ
Active: This project is currently being maintained and improved.
โ ๐ค How to Contribute
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated .
Fork the Project
Create your Feature Branch (git checkout -b feature/AmazingFeature)
Commit your Changes (git commit -m 'Add some AmazingFeature')
Push to the Branch (git push origin feature/AmazingFeature)
Open a Pull Request