How caspergamingone/smart-factory-management-system works
Purpose and Shape
Smart Factory Management System is an early-stage .NET solution for managing factory operations through a terminal UI. It separates a reusable domain library from a console-oriented UI application. The solution root is Smart-Factory-Management-System.slnx; project boundaries are Core/Core.csproj and UI/UI.csproj.
Runtime Entry and Session Flow
UI/Program.cs is the application entry point. It initializes the interactive application flow, with authentication handled by UI/LoginHandler.cs, then routes users into menu-driven operations. UI/TUIHelpers.cs provides terminal-display/input support across the UI boundary.
Domain Aggregate: Factory
Core/Factory.cs is the central in-memory business model and likely ownership boundary for operational entities. It coordinates factory-level state and relationships among employees, machines, products, and production work. The project currently shows no persistence, API, or database layer; state is expected to live in process.
Workforce and Equipment Management
Employee and machine capabilities are modeled separately:
• Core/Employee.cs represents workforce records.
• Core/Machine.cs represents production equipment.
• Core/MachinePart.cs models machine-component/maintenance-related data.
UI workflows for these areas are isolated in UI/EmployeeMenuHandler.cs and UI/MachineMenuHandler.cs, keeping terminal interaction outside the domain objects.
Product and Production Pipeline
Production data flows from product definition into scheduled work:
• Core/Product.cs defines manufactured goods.
• Core/ProductionOrder.cs represents requested/planned production.
• Core/ProductionBatch.cs represents batch-level execution or tracking.
UI/ProductMenuHandler.cs manages product-facing commands, while UI/ProductionMenuHandler.cs drives production-order and batch interactions. These handlers should invoke domain operations rather than duplicate business rules.
Feature Routing and Reporting
UI/MenuOptions.cs defines available navigation/options, and feature handlers partition operational concerns: accounting (UI/AccountingMenuHandler.cs), sales (UI/SalesMenuHandler.cs), factory reporting (UI/FactoryReportMenuHandler.cs), and general reports (UI/ReportMenuHandler.cs). This is a command/menu-controller layer rather than a web or service interface.
Delivery and Documentation Infrastructure
The runtime targets the .NET SDK version pinned by global.json. GitHub Actions publish an executable and GitHub Pages documentation via .github/workflows/publish-executable.yml and .github/workflows/github-pages-docs.yml. Documentation is generated from repository structure by scripts/generate_repo_map.py, producing docs/PROJECT_OVERVIEW.md and the Pages-facing index.html; it is documentation infrastructure, not application runtime behavior.
Main entry points: Factory.cs Factory · MenuOptions.cs Menu Routing · Program.cs Application Entry · ProductionOrder.cs Production Order
Components 22
Terminal UI
Console interaction and feature routing.
- Application Entry
UI/Program.cs - Authentication
UI/LoginHandler.cs - Menu Routing
UI/MenuOptions.cs - Terminal Helpers
UI/TUIHelpers.cs - Workforce Commands
UI/EmployeeMenuHandler.cs - Equipment Commands
UI/MachineMenuHandler.cs - Product Commands
UI/ProductMenuHandler.cs - Production Commands
UI/ProductionMenuHandler.cs - Business & Reports · Accounting, sales, factory reports, and general reports.
Core Domain
In-memory factory operations model.
- Factory · Owns in-memory operational state and relationships.
Core/Factory.cs - Employee
Core/Employee.cs - Machine
Core/Machine.cs - Machine Part
Core/MachinePart.cs - Product
Core/Product.cs - Production Order
Core/ProductionOrder.cs - Production Batch
Core/ProductionBatch.cs
Delivery & Docs
Build publishing and generated documentation.
- .NET SDK Pin
global.json - Executable Publish
.github/workflows/publish-executable.yml - Repository Map Generator
scripts/generate_repo_map.py - Pages Documentation
.github/workflows/github-pages-docs.yml - Project Overview
docs/PROJECT_OVERVIEW.md - Pages Index
index.html
Connections 25
- Application Entry → Authentication: authenticates session
- Application Entry → Menu Routing: routes commands
- Application Entry → Terminal Helpers: uses
- Menu Routing → Workforce Commands: selects
- Menu Routing → Equipment Commands: selects
- Menu Routing → Product Commands: selects
- Menu Routing → Production Commands: selects
- Menu Routing → Business & Reports: selects
- Workforce Commands → Factory: operates on
- Equipment Commands → Factory: operates on
- Product Commands → Factory: operates on
- Production Commands → Factory: operates on
- Business & Reports → Factory: reads operations
- Factory → Employee: manages
- Factory → Machine: manages
- Factory → Product: manages
- Factory → Production Order: coordinates
- Machine → Machine Part: contains
- Product → Production Order: is requested by
- Production Order → Production Batch: creates or tracks
- .NET SDK Pin → Executable Publish: pins build SDK
- Executable Publish → Application Entry: publishes executable
- Repository Map Generator → Project Overview: generates
- Repository Map Generator → Pages Index: generates
- Pages Documentation → Pages Index: publishes