The Inventory REST API is a robust and scalable backend service designed for managing inventory systems. This project is implemented in Java and leverages modern frameworks and libraries to ensure high performance and reliability. It also includes functionality for interacting with inventory items, products, and batch types.
- Inventory Management: Create, update, and fetch inventory details.
- Product Management: Manage products and their associated data.
- Batch Type Operations: Handle batch types for inventory items.
- CSV Import/Export: Supports CSV data import/export for seamless data operations.
- Database Integration: Features MongoDB repositories for efficient data storage and retrieval.
- Error Handling: Implements custom error mapping and response generation for enhanced user experience.
src/main/java/com/github/psinalberth/
├── api
│ ├── providers
│ │ ├── reactor
│ │ ├── opencsv
│ │ ├── config
│ │ └── springdoc
├── domain
│ ├── inventory
│ │ ├── core
│ │ ├── application
│ │ └── infrastructure
│ └── product
│ ├── core
│ ├── application
│ └── infrastructure
└── shared
├── exception
└── port
-
API Providers:
- Provides various configurations (
CorsConfig
,OpenApiConfig
) and utility classes for handling server responses and CSV operations.
- Provides various configurations (
-
Domain Layer:
- Core logic for inventory and product management.
- Models and ports for domain-driven design.
-
Infrastructure:
- Database repositories for MongoDB integrations.
- Includes mappers and data access objects.
-
Shared Utilities:
- Common utilities like error handling (
ResourceNotFoundException
) and data import/export interfaces.
- Common utilities like error handling (
- Java 17 or higher.
- Maven for dependency management.
- A running instance of MongoDB.
-
Clone the repository:
git clone https://github.com/psinalberth/inventory-rest-api.git cd inventory-rest-api
-
Build the project using Maven:
mvn clean install
-
Run the application:
java -jar target/inventory-rest-api.jar
Run the unit tests using Maven:
mvn test
-
Inventory:
POST /inventories
: Create a new inventory.GET /inventories/{id}
: Retrieve inventory by ID.PUT /inventories/{id}
: Update an existing inventory.
-
Products:
POST /products
: Add new products.GET /products/{id}
: Fetch product details.
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.