How lee-dongwook/product_engineering works
This is an AI-assisted supply-chain platform: a manager requests a product’s purchase proposal, the backend gathers tenant-scoped inventory and sales history, runs demand/supplier/supervisor workflow stages, and saves a draft for review. Users can then approve, modify, or reject proposals, with decision events and metrics; workflow progress is also exposed through streaming endpoints. Authentication and tenant context guard API access. The README documents frontend, SSE, and workflow capabilities; several tracking and persistence implementations were not sampled, so their internal connections are omitted.
Main entry points: router.py API router · orders.py Proposal decisions · prediction_service.py Prediction orchestration · deps.py Identity and roles
Components 22
Web interface
- Next.js interface
frontend/app/orders/page.tsx - API client
frontend/lib/api.ts
API and access
- API router
app/api/v1/router.py - Login and profile
app/api/v1/endpoints/auth.py - Identity and roles
app/api/deps.py - JWT security
app/core/security.py - Product inventory API
app/api/v1/endpoints/inventory.py - Proposal decisions
app/api/v1/endpoints/orders.py - Progress streaming API
app/api/v1/endpoints/streaming.py - Tracking API
app/api/v1/endpoints/tracking.py
Inventory planning
- Prediction orchestration
app/services/prediction_service.py - Inventory and draft service
app/services/inventory_service.py - Sales history service
app/services/sales_record_service.py - SCM agent workflow
app/services/agent_workflow.py
Workflow tracking
- Tracked workflow runner
app/services/run_tracked_workflow.py - Execution history service
app/services/workflow_execution_service.py - Async worker tasks
app/worker/tasks.py
Data and storage
- Database sessions
app/core/database.py - Tenant and SCM models
app/models/domain.py - Workflow execution model
app/models/workflow_execution.py
Other components
- SCM user
- PostgreSQL
Connections 25
- SCM user → Next.js interface: reviews proposals
- Next.js interface → API client: uses
- API client → API router: REST and SSE
- API router → Login and profile: routes
app/api/v1/router.py - API router → Product inventory API: routes
app/api/v1/router.py - API router → Proposal decisions: routes
app/api/v1/router.py - API router → Progress streaming API: routes
app/api/v1/router.py - API router → Tracking API: routes
app/api/v1/router.py - Login and profile → Identity and roles: loads profile
app/api/v1/endpoints/auth.py - Login and profile → JWT security: verifies and issues JWT
app/api/v1/endpoints/auth.py - Identity and roles → JWT security: decodes token
app/api/deps.py - Product inventory API → Identity and roles: checks access
app/api/v1/endpoints/inventory.py - Proposal decisions → Identity and roles: checks roles
app/api/v1/endpoints/orders.py - Proposal decisions → Prediction orchestration: runs prediction
app/api/v1/endpoints/orders.py - Progress streaming API → Prediction orchestration: streams prediction
app/api/v1/endpoints/streaming.py - Prediction orchestration → Inventory and draft service: loads product; saves draft
app/services/prediction_service.py - Prediction orchestration → Sales history service: loads sales history
app/services/prediction_service.py - Prediction orchestration → SCM agent workflow: creates and runs
app/services/prediction_service.py - Proposal decisions → Inventory and draft service: uses inventory service
app/api/v1/endpoints/orders.py - Proposal decisions → PostgreSQL: reads and records decisions
app/api/v1/endpoints/orders.py - Database sessions → Tenant and SCM models: uses ORM base
app/core/database.py - Database sessions → PostgreSQL: opens sessions
app/core/database.py - Execution history service → Workflow execution model: persists executions
app/services/workflow_execution_service.py - Async worker tasks → SCM agent workflow: runs workflow
app/worker/tasks.py - Tracked workflow runner → Execution history service: tracks execution