How devbenho/luka-platform works
Luka Platform is an e-commerce application with a Gin/MongoDB API and a Next.js interface. The backend workflow starts at HTTP routes, passes through handlers and domain services, and persists through repositories; order creation also prices products and reserves inventory, rolling back reservations if saving fails. User authentication, catalog, category, store, and inventory management are separate capabilities. The README also names warehouse management, but the tree shows only its model, so no operational warehouse flow is inferred. Edges are limited to route and service relationships evidenced by excerpts or the README.
Main entry points: server.go HTTP Server · routes.go Order Routes · database.go MongoDB Access · inventory_service.go Inventory Operations
Components 26
HTTP API
- HTTP Server
internal/server/http/server.go - User Routes
ports/http/users/routes.go - Order Routes
ports/http/orders/routes.go - Product Routes
ports/http/products/routes.go - Inventory Routes
ports/http/inventories/routes.go - Store Routes
ports/http/stores/routes.go - Category Routes
ports/http/categories/routes.go
Commerce Domains
- Order Processing
internal/orders/services/order_service.go - Order Repository
internal/orders/repositories/order_repository.go - Product Catalog
internal/product/services/product_service.go - Product Repository
internal/product/repositories/product_repository.go - Inventory Operations
internal/inventory/services/inventory_service.go - Inventory Repository
internal/inventory/repositories/inventory_repository.go - Store Management
internal/store/services/store_service.go - Store Repository
internal/store/repositories/store_repository.go - Category Management
internal/category/services/category_service.go - Category Repository
internal/category/repositories/category_repository.go - Warehouse Model
internal/warehouse/models/warehouse.go
Identity
- User Management
internal/user/services/user_service.go - User Repository
internal/user/repositories/user_repository.go - JWT Tokens
pkg/tokens/main.go - Password Hashing
pkg/hasher/main.go
Platform Services
- API Bootstrap
cmd/api/main.go - MongoDB Access
pkg/database/database.go
Web Interface
- Next.js Interface
web/src/app/(main)/(landing)/_sections/header.tsx
Other components
- API Client
Connections 46
- API Client → HTTP Server: sends requests
README.md - API Bootstrap → HTTP Server: starts
cmd/api/main.go - API Bootstrap → MongoDB Access: connects
cmd/api/main.go - HTTP Server → User Routes: maps routes
internal/server/http/server.go - HTTP Server → Order Routes: maps routes
internal/server/http/server.go - HTTP Server → Product Routes: maps routes
internal/server/http/server.go - HTTP Server → Inventory Routes: maps routes
internal/server/http/server.go - HTTP Server → Store Routes: maps routes
internal/server/http/server.go - HTTP Server → Category Routes: maps routes
internal/server/http/server.go - User Routes → User Management: constructs service
ports/http/users/routes.go - User Routes → User Repository: constructs repository
ports/http/users/routes.go - User Routes → JWT Tokens: constructs token service
ports/http/users/routes.go - User Routes → Password Hashing: constructs hasher
ports/http/users/routes.go - User Management → User Repository: reads and writes
internal/user/services/user_service.go - User Management → JWT Tokens: generates tokens
internal/user/services/user_service.go - User Management → Password Hashing: hashes passwords
internal/user/services/user_service.go - Order Routes → Order Processing: constructs service
ports/http/orders/routes.go - Order Routes → Order Repository: constructs repository
ports/http/orders/routes.go - Order Routes → Inventory Operations: constructs service
ports/http/orders/routes.go - Order Routes → Product Catalog: constructs service
ports/http/orders/routes.go - Order Routes → Store Repository: constructs repository
ports/http/orders/routes.go - Order Processing → Product Catalog: gets product pricing
internal/orders/services/order_service.go - Order Processing → Inventory Operations: reserves stock
internal/orders/services/order_service.go - Order Processing → Inventory Operations: releases stock
internal/orders/services/order_service.go - Order Processing → Order Repository: persists orders
internal/orders/services/order_service.go - Product Routes → Product Catalog: constructs service
ports/http/products/routes.go - Product Routes → Product Repository: constructs repository
ports/http/products/routes.go - Product Catalog → Product Repository: reads and writes
internal/product/services/product_service.go - Inventory Routes → Inventory Operations: constructs service
ports/http/inventories/routes.go - Inventory Routes → Inventory Repository: constructs repository
ports/http/inventories/routes.go - Inventory Operations → Inventory Repository: reads and writes
internal/inventory/services/inventory_service.go - Inventory Operations → Product Repository: checks product
internal/inventory/services/inventory_service.go - Store Routes → Store Management: constructs service
ports/http/stores/routes.go - Store Routes → Store Repository: constructs repository
ports/http/stores/routes.go - Store Management → Store Repository: reads and writes
internal/store/services/store_service.go - Category Routes → Category Management: constructs service
ports/http/categories/routes.go - Category Routes → Category Repository: constructs repository
ports/http/categories/routes.go - Category Management → Category Repository: reads and writes
internal/category/services/category_service.go - Product Repository → MongoDB Access: uses database
- Inventory Repository → MongoDB Access: uses database
internal/inventory/repositories/inventory_repository.go - Order Repository → MongoDB Access: uses database
internal/orders/repositories/order_repository.go - User Repository → MongoDB Access: uses database
internal/user/repositories/user_repository.go - Store Repository → MongoDB Access: uses database
internal/store/repositories/store_repository.go - Category Repository → MongoDB Access: uses database
internal/category/repositories/category_repository.go - API Client → Next.js Interface: uses interface
README.md - Next.js Interface → HTTP Server: API integration