Skip to content

This repository hosts a beginner's project in Java development. It's a simple RESTful API for managing products, built using Java 17 and Spring 3. The project adheres to RESTful principles and implements HATEOAS for a self-descriptive API.

Notifications You must be signed in to change notification settings

Giovani-f/simple-product-api-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Product API - Java 17 with Spring 3

Welcome to my first Java project! This is a simple RESTful API for managing products, implemented in Java 17 with Spring 3. This project follows RESTful principles and implements HATEOAS (Hypermedia as the Engine of Application State) to provide a self-descriptive API.

Table of Contents

Overview

This project serves as a foundation for building a simple Product Management System. It provides basic CRUD (Create, Read, Update, Delete) operations for products. By implementing RESTful principles, it ensures a clean and predictable API structure.

Prerequisites

Before you start, make sure you have the following installed:

Getting Started

  1. Clone this repository to your local machine:
git clone https://github.com/giovani-f/simple-product-api-java.git
  1. Navigate to the project directory:
cd simple-product-api-java
  1. Build and run the project using Maven:
mvn clean install
mvn spring-boot:run

Your API should now be up and running at http://localhost:8080.

API Endpoints

The following API endpoints are available:

  • GET /products: Get a list of all products.
  • GET /products/{id}: Get a product by ID.
  • POST /products: Create a new product.
  • PUT /products/{id}: Update a product by ID.

For detailed usage examples, you can refer to the API documentation or use tools like Postman or cURL.

HATEOAS Implementation

This project incorporates HATEOAS to provide links that navigate through the API. When you access a resource, it includes links to related resources, making the API self-descriptive and easy to navigate.

Project Structure

The project structure is organized as follows:

simple-product-api-java/
├── src/
│   ├── main/
│   │   ├── java/
│   │   │   └── com/
│   │   │       └── example/
│   │   │           └── product/
│   │   │               ├── controller/
│   │   │               ├── dtos/
│   │   │               ├── model/
│   │   │               └── repository/
│   │   └── resources/
│   └── test/
├── README.md
├── pom.xml
└── ...
  • controller: Contains the API endpoints and request mapping.
  • dtos: Defines the Data Transfer Objects (DTOs) for the API.
  • model: Defines the Product model.
  • repository: Manages data access and storage.

About

This repository hosts a beginner's project in Java development. It's a simple RESTful API for managing products, built using Java 17 and Spring 3. The project adheres to RESTful principles and implements HATEOAS for a self-descriptive API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages