How techops-recsys-lateral-hiring/developer-joi-delivery-java works
Project type & purpose (what you’re diagramming)
This repo is a single-service Spring Boot (Gradle) Java backend for a delivery domain (“JOI Delivery”). It currently exposes REST APIs for:
• Cart: add product to cart, view cart
• Inventory: health endpoint (stub/TBD)
There’s no frontend and no obvious database/infrastructure integration in the tree; data appears in-memory and seeded via seedData/SeedData.java.
File structure → architectural slices
Use the package layout as your architectural guide:
Web/API layer (Controllers)
• controller/CartController.java
• controller/InventoryController.java
Service layer (Use cases / application services)
• service/CartService.java
• service/ProductService.java
• service/UserService.java
Domain model (Entities / aggregates / value objects)
• domain/Cart.java
• domain/Product.java + specializations FoodProduct, GroceryProduct
• domain/Outlet.java + specializations Restaurant, GroceryStore
• domain/User.java
DTOs (API contracts)
• dto/request/AddProductRequest.java
• dto/response/CartProductInfo.java
Seed / data initialization
• seedData/SeedData.java
Configuration
• src/main/resources/application.yaml
Tests
• controller/*Test.java, DeliveryApplicationTests.java
The README describes a broader product vision (tracking, payments, partner ecosystem), but the codebase currently implements only a small subset (cart + inventory health stub + seed data).
• Be faithful to what exists (single backend service, in-memory seed data)
API Client(s)
• Postman/cURL, Mobile App, Web App (even if not in repo)
JOI Delivery Backend (Spring Boot, Java 24)
Inside this container, split into subcomponents:
• CartController
• InventoryController
• CartService
• ProductService
• UserService
• Domain Model (Cart, Product hierarchy, Outlet hierarchy, User)
• DTOs (AddProductRequest, CartProductInfo)
• SeedData (in-memory)
(Optional placeholder) Persistence
Since no repository/DB layer exists in the tree, show:
• “In-memory seeded dataset” as the current “data store”
Relationships / interactions (key request flows)
Flow 1: Add Product to Cart
• Client → POST /cart/product → CartController
• CartController → CartService
• CartService → UserService (validate/find user)
• CartService → ProductService (lookup product by productId, validate outlet/store)
• Services → SeedData / in-memory collections (read/update)
• CartService → returns domain/response mapping → Controller → Client
Flow 2: View Cart
• Client → GET /cart/view?userId=... → CartController
• CartController → CartService
• CartService → SeedData/in-memory cart store → returns Cart → Client
Flow 3: Inventory Health (stub)
• Client → GET /inventory/health?storeid=... → InventoryController
• InventoryController → (likely ProductService / Inventory logic) → currently “to be implemented”
Architectural patterns to call out
• Layered architecture: Controller (web) → Service (use-case) → Domain (+ seed data as data source)
• DTO boundary: request/response models isolate API contract from domain model (even if domain is currently exposed in responses)
• Polymorphic domain: Product → FoodProduct / GroceryProduct; Outlet → Restaurant / GroceryStore
• Spring Boot (web, dependency injection)
• Gradle (build)
• Java 24
• HTTP/JSON REST
• Port 8080
• “In-memory seeded data” (current persistence approach)
Labels
• Use exact class names for components:
• CartController, InventoryController
• CartService, ProductService, UserService
• SeedData
• POST /cart/product
• GET /cart/view
• GET /inventory/health
Notes/callouts
Small callouts for:
• “Runs on port 8080”
• “Data is seeded (dev-only) via SeedData”
• “No persistence layer present (yet)”
Practical “don’t overthink it” decomposition (separate into many components)
• Domain Model
• Cart
• User
• Outlet → GroceryStore / Restaurant
• Product → GroceryProduct / FoodProduct
• API Contracts
• AddProductRequest
• CartProductInfo
• Seed Data
• Users seed
• Stores/Outlets seed
• Products seed
• Carts seed (if present/created)
• controllers → services → seed data
• domain model group
• Clients (Mobile/Web/Postman) → JOI Delivery API