How techops-recsys-lateral-hiring/developer-joi-delivery-golang works
What this project is (type + purpose)
From the file tree + README, this is a Go backend HTTP API for a delivery domain (“JOI Delivery”) with initial capabilities around:
• Cart: add product to cart, view cart
• Inventory: health endpoint stub (to be implemented)
• Domain entities: users, outlets (stores/restaurants), products (grocery/food), carts
There is no obvious database adapter/repository layer in the tree; instead there’s internal/service/test_data.go suggesting seeded/in-memory data for development/testing. So architecturally, it’s a layered monolith (single service) with packages separated by concern.
Entrypoints / runtime
• cmd/app/main.go — likely the executable entrypoint (starts server)
• cmd/server/server.go (+ server_test.go) — server creation/configuration
• cmd/api/routes.go — route registration
• cmd/api/handler/* — HTTP handlers (cart, inventory, common handler wiring)
Core application / domain
• internal/service/* — business logic/services
• cart_service.go (+ tests)
• product_service.go
• user_service.go
• test_data.go (seed data / in-memory store)
• internal/models/* — domain models/entities
• cart, user, product hierarchy, outlets (grocery_store/restaurant/etc.)
• internal/dto/request/* and internal/dto/response/* — API contracts
Project/build artifacts
• Makefile — build/test/run entry points
This maps cleanly to a typical HTTP layering:
Client → Router → Handler → Service → (in-memory data / models) → Response DTO
Routing
• cmd/api/routes.go
Handlers (HTTP layer)
• cmd/api/handler/cart_handler.go
• cmd/api/handler/inventory_handler.go
• cmd/api/handler/handler.go (shared wiring/structs)
DTOs (API contracts)
• Requests: internal/dto/request/add_to_cart.go
• Responses: internal/dto/response/cart.go
Services (business logic)
• internal/service/cart_service.go
• internal/service/product_service.go
• internal/service/user_service.go
Domain Models
• internal/models/cart.go, user.go
• product.go, grocery_product.go, food_product.go
• outlet.go, grocery_store.go, restaurant.go
Data Source (current implementation)
• internal/service/test_data.go (seed/in-memory)
• Make it a distinct component to avoid implying persistence exists.
Server bootstrap
• cmd/app/main.go → cmd/server/server.go → registers routes/handlers
CartHandler
• parses JSON into AddToCartRequest (internal/dto/request/add_to_cart.go)
• calls CartService.AddProduct(...) (method name inferred; use “Cart Service” if unsure)
CartService
• queries UserService (validate/find user) and ProductService (validate/find product + outlet/store relationship)
• updates Cart model (add product)
• reads/writes to Seed Data / In-Memory Store (test_data.go) if that’s how it’s done
4. Service returns domain objects → Handler maps to response DTO (internal/dto/response/cart.go)
Flow 3: Inventory Health (GET /inventory/health)
It routed to inventory_handler.go, and annotate as:
• “Not implemented” / “stub” (based on README response body comment)
• Layered architecture: HTTP (handlers/routes) → services → domain models/data
• DTO boundary: internal/dto indicates API contracts separated from domain models
• Domain modeling: product/outlet polymorphism via separate model files (food vs grocery, store vs restaurant)
• Single deployable: all code runs in one Go server process
• Testability: service and server tests exist (*_test.go)—indicates separable components and dependency boundaries
(Optional) Sequence: Add-to-cart and View-cart request lifecycle
This combination will be the most accurate reflection of what exists in the repository today, while still being detailed enough for principal-level review.