Stock & BOM Telemetry Dashboard
Component drawer locations, live USD-to-Rial exchange valuation, and multi-board BOM feasibility.
| Part ID & Component Name | Category | Drawer Code | Stock Qty | USD Price ($) | Fixed Rial (IRR) | Daily Calc (USD × Rate) | Actions & History |
|---|
No components match your active filter criteria.
BOM Production Feasibility Analyzer ("Do I have enough stock for N units?")
Inspect exact part shortages, drawer numbers to pull from, and live USD/Rial purchase costs.
| Component | Drawer | Qty / 1 Unit | Total Required (N) | In Stock | Status / Shortage | Shortage Cost (Daily IRR & USD) |
|---|
Clicking Build & Deduct Stock automatically deducts N × BOM quantities from drawers and logs a production event.
Hardware Products & Bill of Materials (BOM)
Manage board BOMs manually or import a BOM Excel/CSV spreadsheet with automatic component creation.
1. Complete Stock File Import & Export (.xls, .csv, .json)
100% offline native spreadsheet engine—no internet or external libraries required.
Export Stock Snapshot
Download all components with drawer locations, USD prices, fixed Rials, and live calculated daily Rials.
Import Stock File (.xls, .csv, .json)
2. Batch Purchase Order Import with Order Code
Import an invoice spreadsheet (.xls / .csv) or paste rows and tag every item with an Order Code (e.g., ORD-1405-08).
Select Purchase Order File (.xls / .csv)
Columns: Code, Name, Category, Drawer, Qty, DollarPrice, RialPrice
Previewing 0 rows
| Code | Name | Category | Drawer | Qty | USD | Rial |
|---|
Complete Charge & Consume History Ledger
Full audit log of every purchase order charge, drawer removal, and BOM production run.
| Timestamp | Component | Type | Qty Delta | Balance After | Order Code / Ref | Notes & Unit Price |
|---|
Intranet / Local Server Push & Pull Synchronization
Sync across Android phones and PCs over your Ubuntu 24 Server on the Iranian National Intranet (NIN) or local LAN.
Option 1: Ubuntu 24 Intranet / LAN Server (Recommended)
Option 2: GitHub Repository API (When Internet Active)
Zero-Internet Ubuntu 24 Server Script (No `npm install` needed!)
Uses 100% built-in Node.js modules (`http`, `fs`, `path`) so it works immediately during complete international internet blackouts.
# 1. Create directory on Ubuntu 24 server
mkdir -p /opt/mosharan-inventory/public /opt/mosharan-inventory/data
cd /opt/mosharan-inventory
# 2. Create Zero-Dependency Node.js Server (No npm install required!)
cat << 'EOF' > server.js
const http = require('http');
const fs = require('fs');
const path = require('path');
const PORT = process.env.PORT || 3080;
const API_SECRET = process.env.API_SECRET || 'mosharan-secret-token-2026';
const DB_FILE = path.join(__dirname, 'data', 'inventory-db.json');
const PUBLIC_DIR = path.join(__dirname, 'public');
if (!fs.existsSync(path.join(__dirname, 'data'))) fs.mkdirSync(path.join(__dirname, 'data'), { recursive: true });
const server = http.createServer((req, res) => {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');
res.setHeader('Access-Control-Allow-Headers', 'Content-Type, x-api-key');
if (req.method === 'OPTIONS') { res.writeHead(204); return res.end(); }
if (req.url === '/api/sync' && req.method === 'GET') {
if (API_SECRET && req.headers['x-api-key'] !== API_SECRET) {
res.writeHead(401, { 'Content-Type': 'application/json' });
return res.end(JSON.stringify({ error: 'Unauthorized' }));
}
if (!fs.existsSync(DB_FILE)) {
res.writeHead(200, { 'Content-Type': 'application/json' });
return res.end(JSON.stringify({ empty: true }));
}
res.writeHead(200, { 'Content-Type': 'application/json' });
return res.end(fs.readFileSync(DB_FILE, 'utf8'));
}
if (req.url === '/api/sync' && req.method === 'POST') {
if (API_SECRET && req.headers['x-api-key'] !== API_SECRET) {
res.writeHead(401, { 'Content-Type': 'application/json' });
return res.end(JSON.stringify({ error: 'Unauthorized' }));
}
let body = '';
req.on('data', chunk => { body += chunk.toString(); });
req.on('end', () => {
fs.writeFileSync(DB_FILE, body, 'utf8');
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({ ok: true, syncedAt: new Date().toISOString() }));
});
return;
}
const filePath = path.join(PUBLIC_DIR, req.url === '/' ? 'index.html' : req.url);
if (fs.existsSync(filePath) && fs.statSync(filePath).isFile()) {
res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
return res.end(fs.readFileSync(filePath));
}
res.writeHead(404);
res.end('Not found');
});
server.listen(PORT, '0.0.0.0', () => console.log('Mosharan Intranet Inventory running on port ' + PORT));
EOF
# 3. Run directly with Node or PM2 / Docker:
node server.js