How juaenmc/erpsagas works
SAGAS ERP combines an Express/Prisma commerce API with a React omnichannel administration panel. The principal workflow is an administrator managing catalog and stock through the panel and API; orders are created, stock is reserved, and payment confirmation or cancellation updates that reservation. The panel also exposes analytics, channel publishing, logistics, tracking, automation, integrations, and combo management. Some screen-to-service details and unsampled route internals are not shown, so those relationships are omitted rather than inferred.
Main entry points: App.tsx Admin app · index.ts REST API · db.ts Neon PostgreSQL · products.ts Products
Components 25
Admin panel
- Admin app
src/App.tsx - Product data hook
src/hooks/useProducts.ts - API client
src/services/apiClient.ts - Dashboard
src/components/DashboardView.tsx - BI analytics
src/components/BiAnalyticsDashboard.tsx
Commerce API
- REST API
server/index.ts - Products
server/routes/products.ts - Orders and checkout
server/routes/orders.ts - Stock
server/routes/stock.ts - Accounts and admin
server/routes/auth.ts - Cart and addresses
server/routes/cart.ts - Commerce extensions
server/routes/agent-api.ts
Omnichannel operations
- Product publishing
src/components/ProductPublisher.tsx - Logistics hub
src/components/LogisticsHub.tsx - Tracking hub
src/components/TrackingHub.tsx - Integrations hub
src/components/IntegrationsHub.tsx - Smart data
src/components/SmartDataHub.tsx - Automation engine
src/components/AutomationEngineView.tsx - Purchases and fashion
src/components/PurchasesAndFashionView.tsx - Combo manager
src/components/CombosManager.tsx - Combo engine
src/logic/combo-engine.ts - Profit calculator
src/services/ProfitCalculatorService.ts
Persistence and contracts
- Neon PostgreSQL
server/db.ts - Product DTO
server/dto/product.dto.ts
Other components
- Administrator
Connections 28
- Administrator → Admin app: uses
src/App.tsx - Admin app → Product data hook: loads products
src/App.tsx - Admin app → Dashboard: shows
src/App.tsx - Admin app → BI analytics: shows
src/App.tsx - Admin app → Product publishing: shows
src/App.tsx - Admin app → Logistics hub: shows
src/App.tsx - Admin app → Tracking hub: shows
src/App.tsx - Admin app → Integrations hub: shows
src/App.tsx - Admin app → Smart data: shows
src/App.tsx - Admin app → Automation engine: shows
src/App.tsx - Admin app → Purchases and fashion: shows
src/App.tsx - Admin app → Combo manager: shows
src/App.tsx - Combo manager → Combo engine: evaluates rules
src/components/CombosManager.tsx - Product data hook → API client: requests products
src/hooks/useProducts.ts - API client → REST API: sends HTTP requests
src/services/apiClient.ts - REST API → Products: registers
server/index.ts - REST API → Orders and checkout: registers
server/index.ts - REST API → Stock: registers
server/index.ts - REST API → Accounts and admin: registers
server/index.ts - REST API → Cart and addresses: registers
server/index.ts - REST API → Commerce extensions: registers
server/index.ts - Products → Product DTO: formats responses
server/routes/products.ts - Products → Neon PostgreSQL: reads and writes
server/routes/products.ts - Stock → Neon PostgreSQL: reads and writes
- Orders and checkout → Neon PostgreSQL: reserves and updates stock
README.md - Accounts and admin → Neon PostgreSQL: accesses records
server/routes/auth.ts - Cart and addresses → Neon PostgreSQL: accesses records
server/routes/cart.ts - Commerce extensions → Neon PostgreSQL: accesses records