A comprehensive steel fabrication tracking and inventory management system with automatic material deduction, Excel import, and real-time dashboard.
Live Azure deployment: https://industryerp-06161244878.azurewebsites.net
Deployment target: Microsoft Azure App Service for Containers, backed by Azure Container Registry and Azure Database for PostgreSQL.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β KUMARBROTHERS STEEL ERP WORKFLOW β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
STEP 1 STEP 2 STEP 3
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Add Raw β β Add Customerβ βUpload Excel β
β Materials β β β /Project β β β Tracking β
β (Profiles) β β β β File β
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β β
β βΌ
β ββββββββββββββββββββββββββββ
β β System Auto-Links β
β β PROFILE β Raw Material β
β β (e.g., UB203X133X25) β
βββββββββββββββββββββββββββββββββββββΊββββββββββββββββββββββββββββ
β
βΌ
TRACKING STAGES (Sequential - Cannot Skip)
βββββββββββββββββββ¬ββββββββββββββββββ¬ββββββββββββββββββ
β FABRICATION β PAINTING β DISPATCH β
β (Stage 1) β (Stage 2) β (Stage 3) β
β β β β
β β Complete β β Complete β β Complete β
β β β β β β β
β AUTO-DEDUCT β Move to next β FINISHED! β
β from inventory β stage β β
βββββββββββββββββββ΄ββββββββββββββββββ΄ββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββ
β Dashboard Updates β
β - Stock reduced β
β - Progress shown β
β - All users see changes β
ββββββββββββββββββββββββββββ
Page: Raw Materials β /raw_material.html
Before tracking can auto-deduct materials, you must add your steel profiles:
| Field | Example Value | Description |
|---|---|---|
| Name | UB203X133X25 | Profile name (must match Excel PROFILE column) |
| Total | 5000 | Total quantity in kg |
| Used | 0 | Already used (starts at 0) |
| Unit | kg | Unit of measurement |
Example Raw Materials to Add:
UB203X133X25 - Universal Beam 203x133x25
UB254X146X31 - Universal Beam 254x146x31
ISMC250 - Indian Standard Medium Channel 250
β οΈ Important: The material NAME must match the PROFILE column in your tracking Excel/CSV file for auto-deduction to work.
Page: Customers β /customers.html
- Click "+ Add Customer"
- Enter customer name and project details
- Save the customer
Each customer can have multiple tracking Excel files uploaded.
Page: Customers β Click "Upload Excel" button on any customer
- β Excel (.xlsx)
- β Macro/template Excel (.xlsm, .xltx, .xltm)
- β CSV (.csv)
The system auto-detects these columns:
| Excel Column | Maps To | Example |
|---|---|---|
| Drawing no | Item Code | TCI-SFD-49-02-11-07-000-01817 |
| ASSEMBLY | Assembly | B1, B2, C1 |
| NAME | Item Name | BEAM, COLUMN |
| PROFILE | Section | UB203X133X25 (links to Raw Material) |
| QTY. | Quantity | 1, 2, 5 |
| WT-(kg) | Weight | 45.6, 123.4 |
| AR(mΒ²) | Area | 1.23 |
| PAINT | Paint Status | - |
| LOT 1 | Lot Number | Lot tracking |
- Preview shows which profiles match inventory (β
) vs unmatched (
β οΈ ) - Auto-Link: System links PROFILE column to Raw Materials
- Import: Creates tracking items in Fabrication stage
- Notification: Warns if any profiles need to be added to Raw Materials
Page: Tracking β /tracking_v2.html
All items follow this sequence (cannot skip stages):
FABRICATION β PAINTING β DISPATCH β COMPLETED
- Start Stage β Status becomes "In Progress"
- Complete Stage β Status becomes "Completed", moves to next stage
When Fabrication is marked Complete:
- β System automatically deducts materials from inventory
- β Deduction = Weight (kg) Γ Quantity from Excel
- β Only happens ONCE per item (tracked by system)
- β Dashboard immediately shows updated stock
Page: Dashboard β /index.html
Real-time display (auto-refreshes every 10 seconds):
| Metric | Description |
|---|---|
| Total Stock (kg) | Current available raw materials |
| Total Consumed (kg) | Materials deducted by completed fabrication |
| Utilization % | Consumed / Purchased ratio |
| Low Stock Alerts | Items below 15% remaining |
| Stage Counts | Jobs in Fabrication/Painting/Dispatch |
1. Admin adds Raw Materials:
UB203X133X25 - 5000 kg
ISMC250 - 3000 kg
2. Admin adds Customer: "TCIL Corporation"
3. Admin uploads tracking CSV with 100 items:
Drawing no,NAME,PROFILE,QTY.,WT-(kg)
DWG-001,BEAM,UB203X133X25,1,45.6
DWG-002,BEAM,UB203X133X25,2,91.2
DWG-003,CHANNEL,ISMC250,1,38.5
...4. System shows preview:
- β UB203X133X25 β Matched to "UB203X133X25" (5000 kg available)
- β ISMC250 β Matched to "ISMC250" (3000 kg available)
5. Import creates 100 tracking items in Fabrication stage
6. Worker completes fabrication for DWG-001:
- Click "Complete" on Fabrication
- System deducts 45.6 kg from UB203X133X25
- Item moves to Painting stage
- Dashboard shows: UB203X133X25 = 4954.4 kg remaining
7. Dashboard shows:
- Fabrication: 99 jobs remaining
- Painting: 1 job
- Stock: 4954.4 kg (UB203X133X25)
| Feature | Description |
|---|---|
| Flexible Excel Import | Supports 40+ column name variations |
| Auto Material Linking | PROFILE column auto-matches to inventory |
| Auto Deduction | Materials deduct when Fabrication completes |
| Stage Enforcement | Cannot skip stages (Fab β Paint β Dispatch) |
| Real-time Dashboard | Updates every 10 seconds for all users |
| Low Stock Alerts | Notifications when materials run low |
| Edit & Checklist | Each item has edit and checklist features |
| Search & Filter | Find items by name, code, customer, stage |
- Python 3.10+
- pip (Python package manager)
cd D:\industryERP
# Create and activate virtual environment (optional but recommended)
python -m venv .venv
.venv\Scripts\Activate.ps1
# Install dependencies
pip install -r requirements.txtpython -m uvicorn backend_core.app.main:app --reload --host 127.0.0.1 --port 8000Backend and frontend will be available from the same local server: http://127.0.0.1:8000
Open your browser and navigate to: http://127.0.0.1:8000/login.html
| Username | Password | Role | Permissions |
|---|---|---|---|
admin |
Boss1234! |
Boss | Full access to all seeded local demo features |
After logging in as admin, you can create users with different roles:
| Role | Description |
|---|---|
| Boss | Full system access |
| Software Supervisor | Inventory, GRN, Dispatch management |
| Store Keeper | Stock operations, GRN creation |
| QA Inspector | Quality inspection and approval |
| Dispatch Operator | Dispatch operations only |
| User | View-only access |
| Page | URL | Description |
|---|---|---|
| Login | /login.html |
User authentication |
| Dashboard | /index.html |
Overview and stats |
| Raw Materials | /raw_material.html |
Add/manage steel profiles |
| Customers | /customers.html |
Customer management + Excel upload |
| Tracking | /tracking_v2.html |
Stage tracking (Fab/Paint/Dispatch) |
| GRN | /grn.html |
Goods Receipt Notes |
| Dispatch | /dispatch.html |
Outward dispatch management |
| Settings | /settings.html |
System settings |
Once the backend is running, access the interactive API docs:
- Swagger UI: http://127.0.0.1:8000/docs
- ReDoc: http://127.0.0.1:8000/redoc
| Endpoint | Description |
|---|---|
POST /auth/login |
User authentication |
GET /inventory/ |
List all raw materials |
GET /inventory/dashboard-data |
Dashboard statistics |
POST /excel/preview-import/{customer_id} |
Preview Excel with material matching |
POST /excel/import-tracking/{customer_id} |
Import tracking items |
POST /tracking/complete-stage |
Complete a stage (triggers auto-deduction) |
GET /tracking/all-items |
List all tracking items |
industryERP/
βββ backend_core/ # FastAPI Backend
β βββ app/
β β βββ main.py # App entry point
β β βββ models.py # Database models
β β βββ excel.py # Excel/CSV import with auto-linking
β β βββ tracking.py # Stage tracking with auto-deduction
β β βββ inventory.py # Raw materials & dashboard stats
β β βββ security.py # Authentication & RBAC
β β βββ deps.py # Dependencies
β β βββ routers/ # Additional API routers
β βββ data/
β βββ kumar_core.db # SQLite database
β
βββ kumar_frontend/ # Frontend (HTML/JS/CSS)
β βββ index.html # Dashboard with grand totals
β βββ login.html # Login page
β βββ raw_material.html # Raw materials management
β βββ customers.html # Customers + Excel upload
β βββ tracking_v2.html # Stage tracking
β βββ grn.html # Goods Receipt Notes
β βββ dispatch.html # Dispatch management
β βββ js/
β β βββ config.js # API config
β β βββ main.js # Main application JS
β βββ css/
β βββ main.css # Styles
β
βββ scripts/
β βββ create_admin.py # Admin user creation script
β
βββ requirements.txt # Python dependencies
A: Make sure:
- The PROFILE column in your Excel matches the material NAME in Raw Materials
- The item has WT-(kg) value in the Excel
- You clicked "Complete" on Fabrication stage (not just "Start")
A: Yes! The system supports 40+ column name variations. It auto-detects columns like "Drawing no", "PROFILE", "QTY.", "WT-(kg)", etc. Column order doesn't matter.
A: The item will still be imported, but no auto-deduction will happen. You'll see a warning to add the missing profile.
A: No, stages must be completed in order: Fabrication β Painting β Dispatch.
A: Go to Tracking page and filter by customer name.
For production deployment, set these environment variables:
$env:KUMAR_SECRET_KEY = "your-secure-64-char-secret-key"
$env:ENVIRONMENT = "production"
$env:DATABASE_URL = "postgresql://..."
$env:CORS_ORIGINS = "https://industryerp-06161244878.azurewebsites.net"Production deployment is handled by GitHub Actions workflow
.github/workflows/deploy.yml.
The deploy workflow runs manually through workflow_dispatch and automatically
after the KBSteel CI workflow succeeds on main.
Required GitHub repository variables:
| Variable | Purpose |
|---|---|
AZURE_WEBAPP_NAME |
Azure App Service name |
AZURE_RESOURCE_GROUP |
Production resource group |
AZURE_CONTAINER_REGISTRY |
ACR login server |
AZURE_IMAGE_NAME |
Container image repository name |
AZURE_LIVE_URL |
Public Azure URL used for health verification |
Required GitHub repository secrets:
| Secret | Purpose |
|---|---|
AZURE_CLIENT_ID |
GitHub OIDC Azure application client ID |
AZURE_TENANT_ID |
Azure tenant ID |
AZURE_SUBSCRIPTION_ID |
Azure subscription ID |
Azure runtime settings are configured on the App Service. Secret runtime values
such as DATABASE_URL, KUMAR_SECRET_KEY, and admin credentials must remain in
Azure App Service configuration, not in the repository.
# Find and kill process on port 8000
netstat -ano | findstr :8000
taskkill /PID <PID> /F# Delete database and restart server (will recreate tables)
Remove-Item backend_core/data/kumar_core.db
# Restart backend server
# Run create_admin.py to create admin user againcd D:\industryERP
python scripts/create_admin.pyFor issues or questions, contact the development team.


