How mm95w/aws-3tier-infra works
StockFlow is an inventory-management application with a React client, Express API and PostgreSQL access through Prisma. Users authenticate, then use dashboard, product and order screens; the API also exposes category, supplier, user and notification capabilities. The graph preserves those documented modules, including areas whose implementation was not excerpted. Edges follow shown imports, calls and route registration; client-to-server HTTP links are dashed because endpoint wiring was not shown.
Main entry points: app.ts API application · products.routes.ts Product routes · orders.routes.ts Order routes · App.tsx Client routes
Components 34
Web client
- Client routes
app/client/src/App.tsx - Session context
app/client/src/auth/AuthContext.tsx - Route guard
app/client/src/auth/ProtectedRoute.tsx - App layout
app/client/src/components/layout/Layout.tsx - Login screen
app/client/src/pages/LoginPage.tsx - Dashboard screen
app/client/src/pages/DashboardPage.tsx - Products screen
app/client/src/pages/ProductsPage.tsx - Orders screen
app/client/src/pages/OrdersPage.tsx - API resources
app/client/src/api/resources.ts - HTTP client
app/client/src/api/axiosClient.ts
API and authentication
- API application
app/server/src/app.ts - Auth routes
app/server/src/modules/auth/auth.routes.ts - Auth controller
app/server/src/modules/auth/auth.controller.ts - Auth service
app/server/src/modules/auth/auth.service.ts - Auth validation
app/server/src/modules/auth/auth.schema.ts
Inventory operations
- Product routes
app/server/src/modules/products/products.routes.ts - Product controller
app/server/src/modules/products/products.controller.ts - Product service
app/server/src/modules/products/products.service.ts - Product validation
app/server/src/modules/products/products.schema.ts - Order routes
app/server/src/modules/orders/orders.routes.ts - Order controller
app/server/src/modules/orders/orders.controller.ts - Order service
app/server/src/modules/orders/orders.service.ts - Order validation
app/server/src/modules/orders/orders.schema.ts - Categories
app/server/src/modules/categories/categories.routes.ts - Suppliers
app/server/src/modules/suppliers/suppliers.routes.ts - User management
app/server/src/modules/users/users.routes.ts - Dashboard data
app/server/src/modules/dashboard/dashboard.service.ts - Dashboard routes
app/server/src/modules/dashboard/dashboard.routes.ts - Notifications
app/server/src/modules/notifications/notifications.routes.ts
Runtime and data
- Token authentication
app/server/src/middleware/auth.ts - Role access
app/server/src/middleware/rbac.ts - Request validation
app/server/src/middleware/validate.ts - Async handler
app/server/src/utils/asyncHandler.ts
Other components
- User
Connections 48
- User → Login screen: signs in
- Client routes → Login screen: routes to
app/client/src/App.tsx - Client routes → Route guard: protects pages
app/client/src/App.tsx - Client routes → App layout: wraps pages
app/client/src/App.tsx - Client routes → Dashboard screen: routes to
app/client/src/App.tsx - Client routes → Products screen: routes to
app/client/src/App.tsx - Client routes → Orders screen: routes to
app/client/src/App.tsx - Login screen → Session context: uses session
app/client/src/pages/LoginPage.tsx - Route guard → Session context: checks session
app/client/src/auth/ProtectedRoute.tsx - App layout → Session context: uses session
app/client/src/components/layout/Layout.tsx - Session context → API resources: calls auth API
app/client/src/auth/AuthContext.tsx - API resources → HTTP client: sends requests
app/client/src/api/resources.ts - Dashboard screen → API resources: fetches data
app/client/src/pages/DashboardPage.tsx - Products screen → API resources: fetches data
app/client/src/pages/ProductsPage.tsx - Orders screen → API resources: fetches data
app/client/src/pages/OrdersPage.tsx - HTTP client → API application: HTTP requests
- API application → Auth routes: mounts routes
app/server/src/app.ts - API application → Product routes: mounts routes
app/server/src/app.ts - API application → Order routes: mounts routes
app/server/src/app.ts - API application → Categories: mounts routes
app/server/src/app.ts - API application → Suppliers: mounts routes
app/server/src/app.ts - API application → User management: mounts routes
app/server/src/app.ts - API application → Dashboard routes: mounts routes
app/server/src/app.ts - API application → Notifications: mounts routes
app/server/src/app.ts - Auth routes → Auth controller: dispatches to
app/server/src/modules/auth/auth.routes.ts - Auth routes → Auth validation: validates with
app/server/src/modules/auth/auth.routes.ts - Auth routes → Request validation: uses middleware
app/server/src/modules/auth/auth.routes.ts - Auth routes → Token authentication: uses middleware
app/server/src/modules/auth/auth.routes.ts - Auth routes → Async handler: wraps handlers
app/server/src/modules/auth/auth.routes.ts - Auth controller → Auth service: calls
app/server/src/modules/auth/auth.controller.ts - Auth service → Token authentication: uses token type
app/server/src/modules/auth/auth.service.ts - Product routes → Product controller: dispatches to
app/server/src/modules/products/products.routes.ts - Product routes → Product validation: validates with
app/server/src/modules/products/products.routes.ts - Product routes → Token authentication: authenticates
app/server/src/modules/products/products.routes.ts - Product routes → Role access: checks roles
app/server/src/modules/products/products.routes.ts - Product routes → Request validation: uses middleware
app/server/src/modules/products/products.routes.ts - Product routes → Async handler: wraps handlers
app/server/src/modules/products/products.routes.ts - Product controller → Product service: calls
app/server/src/modules/products/products.controller.ts - Order routes → Order controller: dispatches to
app/server/src/modules/orders/orders.routes.ts - Order routes → Order validation: validates with
app/server/src/modules/orders/orders.routes.ts - Order routes → Token authentication: authenticates
app/server/src/modules/orders/orders.routes.ts - Order routes → Role access: checks roles
app/server/src/modules/orders/orders.routes.ts - Order routes → Request validation: uses middleware
app/server/src/modules/orders/orders.routes.ts - Order routes → Async handler: wraps handlers
app/server/src/modules/orders/orders.routes.ts - Order controller → Order service: calls
app/server/src/modules/orders/orders.controller.ts - Dashboard routes → Token authentication: authenticates
app/server/src/modules/dashboard/dashboard.routes.ts - Dashboard routes → Dashboard data: calls
app/server/src/modules/dashboard/dashboard.routes.ts - Categories → Token authentication: authenticates
app/server/src/modules/categories/categories.routes.ts