Skip to content

Lightweight REST API for inventory tracking built with Spring Boot 3.2. Features clean layered architecture (Controller-Repository-Entity), H2 in-memory persistence, and full CRUD capabilities.

Notifications You must be signed in to change notification settings

Sasaank79/Java-Inventory-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Inventory System 📦

A Spring Boot REST API for managing inventory items, built with JPA and H2 Database.

🚀 Features

  • RESTful API with full CRUD operations
  • H2 in-memory database (auto-creates tables)
  • Spring Data JPA for database access
  • Clean layered architecture (Controller → Repository → Entity)

🛠️ Tech Stack

  • Java 17+
  • Spring Boot 3.2
  • Spring Data JPA
  • H2 Database
  • Maven

🏃‍♂️ How to Run

# Clone the repo
git clone https://github.com/Sasaank79/Java-Inventory-System.git
cd Java-Inventory-System

# Run the application
mvn spring-boot:run

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

📡 API Endpoints

Method Endpoint Description
GET /api/items List all items
GET /api/items/{id} Get item by ID
POST /api/items Create new item
PUT /api/items/{id} Update item
DELETE /api/items/{id} Delete item
GET /api/items/search?name=keyword Search by name

📝 Example Usage

Add an item:

curl -X POST http://localhost:8080/api/items \
  -H "Content-Type: application/json" \
  -d '{"name": "Laptop", "quantity": 10, "price": 999.99}'

List all items:

curl http://localhost:8080/api/items

📂 Project Structure

src/main/java/com/inventory/
├── InventoryApplication.java   # Entry point
├── controller/
│   └── ItemController.java     # REST endpoints
├── model/
│   └── Item.java               # JPA Entity
└── repository/
    └── ItemRepository.java     # Data access layer

🗄️ H2 Console

Access the database console at: http://localhost:8080/h2-console

  • JDBC URL: jdbc:h2:mem:inventory
  • Username: sa
  • Password: (leave blank)

Built by Surya Sasaank Y.

About

Lightweight REST API for inventory tracking built with Spring Boot 3.2. Features clean layered architecture (Controller-Repository-Entity), H2 in-memory persistence, and full CRUD capabilities.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages