How code-with-zoro/nearbuy-hyperlocal-product-discovery-platform works
HyperLocal Inventory is a microservices backend for discovering products from nearby vendors. The main workflow starts with a user search: Search Service requests nearby vendor IDs from Location Service, queries Inventory Service for matching products, and returns a limited, deduplicated result. Users and vendors can also sign up or log in, manage locations, and maintain stock. The gateway provides the documented request-routing and JWT/rate-limiting boundary, with Eureka supporting service discovery. Edges reflect excerpts or README statements; some service boundaries are documented but their routing configuration was not sampled.
Main entry points: ApiGatewayApplication.java API Gateway · UserEntryService.java User account service · SearchServices.java Search orchestration · PublicController.java Auth endpoints
Components 21
Gateway and discovery
- API Gateway
API-Gateway/src/main/java/com/Hyperlocal_Inventory/API_Gateway/ApiGatewayApplication.java - Rate limiting
API-Gateway/src/main/java/com/Hyperlocal_Inventory/API_Gateway/services/RateLimiterService.java - Eureka registry
Service-Registry/src/main/java/com/Hyperlocal_Inventory/Service_Registry/ServiceRegistryApplication.java
Identity and access
- Auth endpoints
User-Auth-Service/src/main/java/com/HyperLocal_Inventory/User_Auth_Service/controllers/PublicController.java - User account service
User-Auth-Service/src/main/java/com/HyperLocal_Inventory/User_Auth_Service/services/UserEntryService.java - User records
User-Auth-Service/src/main/java/com/HyperLocal_Inventory/User_Auth_Service/repository/UserEntryRepository.java - JWT utilities
User-Auth-Service/src/main/java/com/HyperLocal_Inventory/User_Auth_Service/utils/JwtUtil.java - Vendor inventory view
User-Auth-Service/src/main/java/com/HyperLocal_Inventory/User_Auth_Service/external/aggregation/InventoryAggregationService.java - Auth inventory client
User-Auth-Service/src/main/java/com/HyperLocal_Inventory/User_Auth_Service/external/feginServices/InventoryClient.java
Inventory management
- Product endpoints
Inventory-Service/src/main/java/com/HyperLocal_Inventory/Inventory_Service/controllers/ProductEntryController.java - Product management
Inventory-Service/src/main/java/com/HyperLocal_Inventory/Inventory_Service/service/ProductEntryService.java - Search and sales
Inventory-Service/src/main/java/com/HyperLocal_Inventory/Inventory_Service/service/SearchService.java - Product records
Inventory-Service/src/main/java/com/HyperLocal_Inventory/Inventory_Service/repository/ProductRepository.java
Location services
- Location endpoints
Loaction-Service/src/main/java/com/HyperLocal_Inventory/Loaction_Service/controllers/LocationEntryController.java - Location and proximity
Loaction-Service/src/main/java/com/HyperLocal_Inventory/Loaction_Service/services/LocationEntryService.java - Location records
Loaction-Service/src/main/java/com/HyperLocal_Inventory/Loaction_Service/repository/LocationRepository.java
Product discovery
- Search endpoint
Search_Service/src/main/java/com/HyperLocal_Inventory/Search_Service/controllers/SearchController.java - Search orchestration
Search_Service/src/main/java/com/HyperLocal_Inventory/Search_Service/services/SearchServices.java - Location client
Search_Service/src/main/java/com/HyperLocal_Inventory/Search_Service/external/LocationClient.java - Inventory client
Search_Service/src/main/java/com/HyperLocal_Inventory/Search_Service/external/InventoryClient.java
Other components
- Client
Connections 20
- Client → API Gateway: sends requests
README.md - API Gateway → Rate limiting: rate limits
README.md - API Gateway → Eureka registry: discovers services
README.md - API Gateway → Auth endpoints: routes requests
README.md - API Gateway → Search endpoint: routes requests
README.md - Auth endpoints → User account service: delegates signup
User-Auth-Service/src/main/java/com/HyperLocal_Inventory/User_Auth_Service/controllers/PublicController.java - User account service → User records: reads and writes
User-Auth-Service/src/main/java/com/HyperLocal_Inventory/User_Auth_Service/services/UserEntryService.java - User account service → JWT utilities: generates token
User-Auth-Service/src/main/java/com/HyperLocal_Inventory/User_Auth_Service/services/UserEntryService.java - Vendor inventory view → Auth inventory client: requests products
User-Auth-Service/src/main/java/com/HyperLocal_Inventory/User_Auth_Service/external/aggregation/InventoryAggregationService.java - Auth inventory client → Product endpoints: fetches inventory
- Product endpoints → Product management: delegates operations
Inventory-Service/src/main/java/com/HyperLocal_Inventory/Inventory_Service/controllers/ProductEntryController.java - Product management → Product records: reads and writes
Inventory-Service/src/main/java/com/HyperLocal_Inventory/Inventory_Service/service/ProductEntryService.java - Search and sales → Product records: searches and updates
Inventory-Service/src/main/java/com/HyperLocal_Inventory/Inventory_Service/service/SearchService.java - Location endpoints → Location and proximity: delegates location
Loaction-Service/src/main/java/com/HyperLocal_Inventory/Loaction_Service/controllers/LocationEntryController.java - Location and proximity → Location records: queries locations
Loaction-Service/src/main/java/com/HyperLocal_Inventory/Loaction_Service/services/LocationEntryService.java - Search endpoint → Search orchestration: handles search
Search_Service/src/main/java/com/HyperLocal_Inventory/Search_Service/controllers/SearchController.java - Search orchestration → Location client: requests nearby vendors
Search_Service/src/main/java/com/HyperLocal_Inventory/Search_Service/services/SearchServices.java - Search orchestration → Inventory client: queries products
Search_Service/src/main/java/com/HyperLocal_Inventory/Search_Service/services/SearchServices.java - Location client → Location endpoints: gets vendor IDs
- Inventory client → Search and sales: searches inventory