How iammanojpatel/order-hub works
This is a full-stack product-catalog application: users browse and manage tenant-scoped products through a Next.js interface and FastAPI API. The principal workflow is product request → API route → application use case → domain rules → transactional persistence; changes also produce events for asynchronous outbox dispatch. The README confirms the Next.js products experience and MySQL-backed API. The graph includes the documented event-driven capability, but sampled code shows only a logging subscriber. Some frontend page wiring and database setup are unsampled, so those connections are omitted.
Main entry points: main.py App composition · router.py Catalog API · services.py Catalog use cases · products.server.ts Server API client
Components 24
Product Web
- Products page
frontend/src/app/products/page.tsx - Create form
frontend/src/features/products/components/CreateProductForm.tsx - Product actions
frontend/src/features/products/api/actions.ts - Server API client
frontend/src/features/products/api/products.server.ts - Product schemas
frontend/src/features/products/model/schemas.ts
API Layer
- Catalog API
backend/src/app/catalog/api/router.py - API schemas
backend/src/app/catalog/api/schemas.py - App composition
backend/src/app/main.py
Catalog Domain
- Catalog use cases
backend/src/app/catalog/application/services.py - Catalog ports
backend/src/app/catalog/application/ports.py - Product aggregate
backend/src/app/catalog/domain/model.py - Repository contract
backend/src/app/catalog/domain/repository.py
Persistence and Events
- SQL unit of work
backend/src/app/catalog/infrastructure/uow.py - SQL repositories
backend/src/app/catalog/infrastructure/repository.py - Catalog tables
backend/src/app/catalog/infrastructure/tables.py - Outbox relay and bus
backend/src/app/shared/infrastructure/outbox.py
Shared Services
- Bearer authentication
backend/src/app/shared/api/auth.py - Database setup
backend/src/app/shared/infrastructure/db.py - Authorization rules
backend/src/app/shared/application/security.py - Request middleware
backend/src/app/shared/api/middleware.py - Problem responses
backend/src/app/shared/api/problems.py - Application settings
backend/src/app/config.py
Other components
- Catalog user
- MySQL database
Connections 26
- Catalog user → Products page: uses
- Create form → Product actions: submits
frontend/src/features/products/components/CreateProductForm.tsx - Product actions → Server API client: calls
frontend/src/features/products/api/actions.ts - Server API client → Product schemas: validates with
frontend/src/features/products/api/products.server.ts - Server API client → Catalog API: requests products
frontend/src/features/products/api/products.server.ts - App composition → Catalog API: registers
backend/src/app/main.py - App composition → SQL unit of work: configures
backend/src/app/main.py - App composition → Request middleware: installs
backend/src/app/main.py - App composition → Problem responses: registers
backend/src/app/main.py - App composition → Database setup: creates
backend/src/app/main.py - App composition → Outbox relay and bus: starts relay
backend/src/app/main.py - Catalog API → Bearer authentication: resolves principal
backend/src/app/catalog/api/router.py - Catalog API → Catalog use cases: dispatches
backend/src/app/catalog/api/router.py - Catalog API → API schemas: uses
backend/src/app/catalog/api/router.py - Catalog use cases → Authorization rules: checks permissions
backend/src/app/catalog/application/services.py - Catalog use cases → Catalog ports: uses
backend/src/app/catalog/application/services.py - Catalog use cases → Product aggregate: invokes
backend/src/app/catalog/application/services.py - Catalog ports → Repository contract: defines access
backend/src/app/catalog/application/ports.py - SQL unit of work → SQL repositories: provides
backend/src/app/catalog/infrastructure/uow.py - SQL unit of work → Outbox relay and bus: appends events
backend/src/app/catalog/infrastructure/uow.py - SQL repositories → Catalog tables: queries
backend/src/app/catalog/infrastructure/repository.py - Catalog tables → Database setup: uses database types
backend/src/app/catalog/infrastructure/tables.py - Database setup → MySQL database: connects
- SQL repositories → Product aggregate: hydrates
backend/src/app/catalog/infrastructure/repository.py - Outbox relay and bus → MySQL database: stores events
backend/src/app/shared/infrastructure/outbox.py - Application settings → App composition: configures
backend/src/app/main.py