Public
Remixed
BEML-KMRCL DLP Store Inventory Management System
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

BEML-KMRCL Smart DLP Store Inventory Management System (SDSIMS)

Enterprise-grade inventory management system for BEML/KMRCL to manage DLP (Defect Liability Period) materials through their complete lifecycle.

🚀 Live Application

Open the App

🔐 Demo Login Credentials

RoleEmailPassword
Adminadmin@beml.inadmin123
Store Personstore@beml.instore123
Officerofficer@beml.inofficer123

✨ Features

  • Role-Based Access Control — Admin, Store Person, Officer, Viewer
  • Google Sheets Integration — Sync inventory master data from Google Sheets
  • Material Request Workflow — Officer requests → Store approves/rejects → Issue material
  • Automatic Inventory Updates — Stock reduces on issue, restores on repair return
  • Gate Pass Generation — BEML letterhead format with print/PDF support
  • Repair Tracking — Full repair lifecycle with auto-inventory restoration
  • Search & Filters — Every module supports search, status, trainset, and date filters
  • CSV Export — Export inventory, requests, issues, and gate passes
  • Audit Trail — Complete action logging for all operations
  • Responsive Design — Works on mobile, tablet, and desktop

📊 Google Sheet Structure

Create a Google Spreadsheet with these sheet tabs:

Sheet: "Inventory" (required)

Columns: Item ID | OEM | System | Subsystem | Material Name | Part Number | Description | Qty | Available Qty | Repair Qty | Issued Qty | Returned Qty | Location | Rack | Shelf | Vendor | Warranty | DLP Expiry | Status | Updated Date | Updated By

Sheet: "Vendors" (optional)

Columns: Vendor Name | Address | Contact Person | Phone | Email | GST | Remarks

Sheet: "Trainsets" (optional)

Columns: Trainset Number | Car Number | System | OEM | Commissioning Date | Status

⚙️ Environment Variables

👉 Add google_service_account here: https://www.val.town/x/shashimishra/beml-dlp-inventory/environment-variables?key=google_service_account

Set this to the full JSON contents of your Google Cloud service account key file. See the Google Sheets guide for setup instructions.

🏗️ Architecture

Rendering mermaid diagram...

📁 File Structure

index.ts                          ← Hono server (API routes + serves frontend)
lib/
  db.ts                           ← SQLite schema, auth, all CRUD operations
  sheets.ts                       ← Google Sheets API integration
  documents.ts                    ← PDF/HTML & CSV generation with BEML letterhead
frontend/
  index.html                      ← HTML shell (Twind + React)
  index.tsx                       ← React entry point
  components/
    App.tsx                       ← Root component (auth state + routing)
    Login.tsx                     ← BEML-branded login page
    Dashboard.tsx                 ← Sidebar layout + dashboard home
    InventoryPage.tsx             ← DLP inventory with filters & sync
    RequestsPage.tsx              ← Material request workflow
    IssuesPage.tsx                ← Material issue with auto stock update
    GatePassPage.tsx              ← Gate pass generation (store only)
    RepairsPage.tsx               ← Repair tracking with auto restoration
    ReportsPage.tsx               ← CSV exports + audit log
    UsersPage.tsx                 ← User management (admin only)
    SettingsPage.tsx              ← Google Sheets config + company settings
    api.ts                        ← API client with auth
    ui.tsx                        ← Shared UI components

🔄 DLP Material Lifecycle

  1. Inventory Sync — Admin configures Google Sheet ID, system syncs inventory
  2. Material Request — Officer creates request with trainset, car, NCR, job card details
  3. Approval — Store Person approves or rejects the request
  4. Issue Material — Store issues material with healthy/faulty part numbers; stock auto-reduces
  5. Gate Pass — Store generates gate pass with vendor details (BEML letterhead format)
  6. Repair/Replace — Material sent to vendor for repair
  7. Return — Material received, inspected; if accepted, stock auto-restores
  8. Reports — Export all data in CSV format; audit trail for compliance