Sign inSign up

gearforthought/springio-demo

By gearforthought

โ€ขUpdated about 1 year ago

Springboot Jersey

Image
Integration & delivery
0

187

gearforthought/springio-demo repository overview

โ 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
  1. Clone the repository

    git clone https://github.com/yourusername/jersey-demo.git
    cd jersey-demo
    
  2. Build the application

    ./mvnw clean install
    
  3. Run the application

    ./mvnw spring-boot:run
    

The application will be available at http://localhost:8080

โ ๐Ÿณ Docker Support

โ Build the Docker Image
docker build -t jersey-demo .
โ Run the Docker Container
docker run -p 8080:8080 jersey-demo
โ Push to Docker Hub
  1. Login to Docker Hub

    docker login
    
  2. Tag the image

    docker tag jersey-demo yourusername/jersey-demo:1.0.0
    
  3. Push the image

    docker push yourusername/jersey-demo:1.0.0
    

โ ๐Ÿ“š API Documentation

โ Base URL
http://localhost:8080
โ Endpoints
โ Get All Users
GET /users

Example Response:

{
  "users": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "firstName": "John",
      "lastName": "Doe",
      "uri": "/users/550e8400-e29b-41d4-a716-446655440000"
    }
  ]
}
โ Create a New User
POST /users

Request Body:

{
  "firstName": "John",
  "lastName": "Doe"
}

Example Response (201 Created):

Status: 201 Created
Location: /users/550e8400-e29b-41d4-a716-446655440000
โ Get User by ID
GET /users/{id}

Example Response:

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "firstName": "John",
  "lastName": "Doe",
  "uri": "/users/550e8400-e29b-41d4-a716-446655440000"
}
โ Update User
PUT /users/{id}

Request Body:

{
  "firstName": "John",
  "lastName": "Smith"
}
โ Delete User
DELETE /users/{id}

โ ๐Ÿงช Testing

Run the test suite with:

./mvnw test

โ ๐Ÿค Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. 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 | LinkedIn โ  GitHub โ 

โ ๐Ÿ” 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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Tag summary

Content type

Image

Digest

sha256:fefcdca57โ€ฆ

Size

88.3 MB

Last updated

about 1 year ago

docker pull gearforthought/springio-demo:1.0.2