What You’ll Build
You’ll create a complete restaurant order that includes:- Drinks that go to the BAR station
- Hot dishes that go to the HOT_KITCHEN station
- Cold dishes that go to the COLD_KITCHEN station
Prerequisites
Before you begin, make sure you have:Service Running
FoodTech Kitchen Service running on
http://localhost:8080HTTP Client
curl, Postman, or any HTTP client installed
If you haven’t installed the service yet, check out the Installation Guide first.
Create Your First Order
Prepare the order request
The order consists of a table number and a list of products. Each product has a
name and a type.Available product types:DRINK- Beverages (routed to BAR)HOT_DISH- Hot meals (routed to HOT_KITCHEN)COLD_DISH- Salads and cold items (routed to COLD_KITCHEN)
Verify the response
You should receive a
201 Created response with the following structure:The order was decomposed into 3 tasks - one for each kitchen station:
- BAR: 2 drinks (Coca Cola, Sprite) - 6 seconds total
- HOT_KITCHEN: 2 hot dishes (Pizza, Salmon) - 14 seconds total
- COLD_KITCHEN: 1 cold dish (Caesar Salad) - 5 seconds total
Understanding the Flow
Here’s what happens when you create an order:Key Architecture Patterns
Hexagonal Architecture
Clean separation between domain, application, and infrastructure layers defined in
ProcessOrderUseCase.java:14Command Pattern
Each station has a dedicated command class (
PrepareDrinkCommand.java:8, PrepareHotDishCommand.java, PrepareColdDishCommand.java)Repository Pattern
Abstracted persistence through port interfaces in the application layer
Factory Pattern
TaskFactory and CommandFactory create appropriate objects based on station typeTesting Different Scenarios
Try these variations to see how the system handles different order types:Error Handling
The API provides clear error messages for invalid requests:Next Steps
API Reference
Explore all available endpoints and their parameters
Architecture Guide
Deep dive into the hexagonal architecture and design patterns
Task Management
Learn how to query and manage kitchen tasks
Domain Model
Understand the core domain entities and business logic
Troubleshooting
Connection refused error
Connection refused error
Make sure the service is running on port 8080:
Invalid JSON format
Invalid JSON format
Ensure your JSON is properly formatted:
- Use double quotes for strings
- Include Content-Type header
- Validate JSON syntax with a linter
CORS errors in browser
CORS errors in browser
The service has CORS enabled by default for development. If you encounter issues, check the
CorsConfig.java configuration.