How to Create a Warehouse Management System in NodeJS with Live Tracking & Dispatch?
(GitHub Inside)

By Atit Purani

November 10, 2025

It can be difficult to handle a warehouse for industries like manufacturing, retail, eCommerce, and many more.

If you have ever worked with a warehouse that relies on manual entries, spreadsheets, or outdated desktop software, you already know the pain.

Stock numbers don’t match reality, updates are delayed, and the dispatch team often works with incomplete information. It causes shipment delays & financial loss.

Traditional warehousing fails because:

  • Stock is updated manually, so data is always delayed.
  • Employees must communicate changes by phone or message.
  • Dispatch teams often ship items without knowing current stock levels.
  • There is no real-time view of what is happening inside the warehouse.

Businesses are looking to have a Warehouse management system with the functionality of real-time tracking.

You can see stock movements instantly, track dispatch progress, and log every action automatically; operations become smooth and efficient.

In this blog, we will build a Warehouse Management System in NodeJS that provides:

  • Live stock quantity updates
  • Real-time dispatch tracking
  • Easy warehouse location mapping
  • Activity logs for complete visibility

We will build everything step by step and also share the full GitHub repository, so you can use or improve it for your business.

What Is a Warehouse Management System (WMS) & Why Use NodeJS?

A Warehouse Management System (WMS) system that helps businesses manage inventory levels, track stock movement, process dispatches, & maintain warehouse efficiency in real time.

You will commonly find WMS in eCommerce companies, logistics companies, manufacturing units, retail distribution centers, and large storage facilities.

Why build it using NodeJS?

A Warehouse Management System in NodeJS works extremely well because:

Reason Benefit
Event-driven architecture Perfect for tracking real-time stock movements.
WebSocket friendly (Socket.io support) Enables instant dashboard updates.
Highly scalable Can handle large warehouses and multi-user operations smoothly.

NodeJS is known for processing updates quickly and concurrently, which is exactly what a warehouse requires.

When inventory changes or a dispatch begins, all connected users should see updates immediately. NodeJS makes this easy.

What Are the Key Features We Will Build? (With Live Tracking & Dispatch)

Key-Features-We-Will-Build

These features will make your warehouse operations traceable, efficient, and transparent.

Feature Description
Real-time Stock Tracking Live quantity updates every time stock moves in or out.
Inbound / Outbound Logging Automatically logs product arrival and dispatch activities.
Warehouse Location Mapping Assign products to racks, shelves, and zones for easy lookup.
Dispatch Module Create dispatch orders, assign loads, and track shipment progress.
Activity Logs Every change is recorded, so nothing is ever lost or unclear.

What Will the System Architecture Be?

To build a real-time warehouse system, we will follow this simple architecture:

User → Dashboard (React or HTML UI)

API (NodeJS + Express)

Database (MongoDB)

Socket Server (Socket.io) for Live Tracking Updates

Operational Flow inside the warehouse:

Warehouse Stock Arrival → Item Stored → Inventory Updated → Dispatch Order Created → Shipment Tracked → Delivery

  • When stock comes in, we log it.
  • When stock moves out, inventory updates.
  • The system broadcasts these changes to all users instantly via Socket.io.
  • The dashboard updates in real time, so no one waits, guesses, or checks manually.

This architecture ensures the system remains fast, accurate, and reliable, even with multiple users working at once.

How to Set Up a Warehouse Management System in NodeJS?

Warehouse-Management-System-in-NodeJS

Before building the features, let’s set up our backend environment for the Warehouse Management System in NodeJS.

We will use Express for routing, Mongoose for MongoDB interaction, and Socket.io for real-time warehouse tracking and dispatch updates.

Step 1: Initialize the Node Project

Open a terminal and run:

        
            mkdir warehouse-management-nodejs
            cd warehouse-management-nodejs
            npm init –y
        
    

Step 2: Install Dependencies

        
            npm install express mongoose dotenv cors jsonwebtoken bcrypt socket.io
            npm install nodemon --save-dev
        
    

Step 3: Create Environment File

Create .env file:

        
            PORT=5000
            MONGO_URI=mongodb+srv://yourUser:yourPassword@cluster.mongodb.net/wms
            JWT_SECRET=your_jwt_secret_key
        
    

Step 4: Recommended Folder Structure

/warehouse-management-nodejs

├── server.js
├── /config
│ └── db.js
├── /models
│ ├── User.js
│ ├── Product.js
│ ├── Movement.js
│ └── Dispatch.js
├── /routes
│ ├── authRoutes.js
│ ├── inventoryRoutes.js
│ └── dispatchRoutes.js
└── /middleware
└── authMiddleware.js

Server Setup (server.js)

        
            import express from "express";
            import http from "http";
            import { Server } from "socket.io";
            import dotenv from "dotenv";
            import cors from "cors";
            import connectDB from "./config/db.js";
            
            dotenv.config();
            connectDB();
            
            const app = express();
            app.use(cors());
            app.use(express.json());
            
            const server = http.createServer(app);
            const io = new Server(server, { cors: { origin: "*" } });
            
            io.on("connection", () => console.log("Client connected"));
            
            app.set("io", io);
            
            server.listen(process.env.PORT, () => {
            console.log(`Server running on port ${process.env.PORT}`);
            });

        
    

Database Connection (config/db.js)

        
            import mongoose from "mongoose";
 
            const connectDB = async () => {
            try {
                await mongoose.connect(process.env.MONGO_URI);
                console.log("MongoDB Connected");
            } catch (error) {
                console.log("DB Connection Failed", error);
                process.exit(1);
            }
            };
            
            export default connectDB;


        
    

User Authentication with JWT

Model: models/User.js

        
            import mongoose from "mongoose";
            import bcrypt from "bcrypt";
            
            const userSchema = new mongoose.Schema({
            name: String,
            email: { type: String, unique: true },
            password: String,
            });
            
            userSchema.pre("save", async function () {
            this.password = await bcrypt.hash(this.password, 10);
            });
            
            export default mongoose.model("User", userSchema);
        
    

Auth Route: routes/authRoutes.js

        
            import express from "express";
            import jwt from "jsonwebtoken";
            import User from "../models/User.js";
            import bcrypt from "bcrypt";
            
            const router = express.Router();
            
            router.post("/login", async (req, res) => {
            const { email, password } = req.body;
            const user = await User.findOne({ email });
            if (!user || !(await bcrypt.compare(password, user.password)))
                return res.status(400).json({ message: "Invalid login" });
            
            const token = jwt.sign({ userId: user._id }, process.env.JWT_SECRET);
            res.json({ token });
            });
            
            export default router;
        
    

We need to track inbound and outbound movements instantly.

Model: models/Movement.js

        
            import mongoose from "mongoose";
 
            const movementSchema = new mongoose.Schema({
            productId: String,
            type: String, // inbound or outbound
            quantity: Number,
            timestamp: { type: Date, default: Date.now },
            });
            
            export default mongoose.model("Movement", movementSchema);

        
    

Inventory API with Live Stock Updates (routes/inventoryRoutes.js)

        
            import express from "express";
            import Movement from "../models/Movement.js";
            import Product from "../models/Product.js";
            
            const router = express.Router();
            
            router.post("/update-stock", async (req, res) => {
            const { productId, quantity, type } = req.body;
            const io = req.app.get("io");
            
            await Movement.create({ productId, quantity, type });
            
            const product = await Product.findById(productId);
            product.stock = type === "inbound" ? product.stock + quantity : product.stock - quantity;
            await product.save();
            
            io.emit("stockUpdated", { productId, newStock: product.stock });
            res.json({ success: true });
            });
            
            export default router;
        
    

This automatically broadcasts real-time stock updates to dashboards.

How to Create the Dispatch Management System?

Model: models/Dispatch.js

        
            import mongoose from "mongoose";
 
            const dispatchSchema = new mongoose.Schema({
            orderId: String,
            items: Array,
            status: { type: String, default: "pending" },
            updatedAt: { type: Date, default: Date.now }
            });
            
            export default mongoose.model("Dispatch", dispatchSchema);

        
    

Dispatch API (routes/dispatchRoutes.js)

        
            import express from "express";
            import Dispatch from "../models/Dispatch.js";
            
            const router = express.Router();
            
            router.post("/create", async (req, res) => {
            const dispatch = await Dispatch.create(req.body);
            req.app.get("io").emit("dispatchCreated", dispatch);
            res.json(dispatch);
            });
            
            router.post("/update-status", async (req, res) => {
            const { id, status } = req.body;
            const dispatch = await Dispatch.findByIdAndUpdate(id, { status }, { new: true });
            req.app.get("io").emit("dispatchUpdated", dispatch);
            res.json(dispatch);
            });
            
            export default router;
        
    

This ensures real-time delivery & dispatch tracking.

How to Create Dashboard UI?

You can use React or simple HTML + JS. Here’s a minimal example to show live updates:

        
            <script src="https://cdn.socket.io/4.5.0/socket.io.min.js"></script>
            <script>
            const socket = io("http://localhost:5000");
            
            socket.on("stockUpdated", (data) => {
            console.log("Live Stock Update:", data);
            // Update DOM dashboard fields here
            });
            
            socket.on("dispatchUpdated", (data) => {
            console.log("Dispatch Status Updated:", data);
            });
            </script>
        
    

This displays live warehouse updates without refreshing.

Here’s the Complete GitHub Code to Develop a Warehouse Management System.

Why We Are Your Partner in Smart Warehouse Automation?

We are building real-time Warehouse Management Systems in NodeJS that help businesses track inventory, manage dispatch, and improve warehouse performance.

  • Real-time Stock Tracking System that updates instantly using Socket.io / WebSockets.
  • Custom NodeJS warehouse system designed according to your business.
  • Smart Dispatch Management System in NodeJS for faster delivery and fewer mistakes.
  • Secure User Roles & Authentication (JWT) to control warehouse access.
  • Smooth Integration with barcode scanners, ERP, IoT devices, RFID, and mobile apps.

Want a Warehouse Management System? Contact Us Now!

Your Warehouse System Is Ready

Once you follow all the steps given in the blog, you have a ready-to-use Warehouse Management System in NodeJS.

You have real-time stock tracking, dispatch monitoring, and a clear dashboard to manage everything smoothly.

This setup can be used in real businesses or extended into a full enterprise solution. You can also add barcode scanning, RFID, or AI-based alerts later.

FAQs

  • NodeJS is event-driven and supports real-time communication, which is ideal for live stock updates.
  • It can handle multiple users and large transaction volumes efficiently to make it perfect for warehouse operations.

  • Yes. We use Socket.io for real-time warehouse management in NodeJS.
  • Whenever stock is added or removed, all connected dashboards update instantly without refreshing.

  • We suggest MongoDB because it works well with NodeJS and handles dynamic warehouse data smoothly.
  • However, you can switch to PostgreSQL or MySQL if needed, with minor code changes.

  • Yes. The system can be extended to support multiple warehouse locations.
  • Each warehouse can track its own stock, dispatches, and activity logs.

Get in Touch

Got a project idea? Let's discuss it over a cup of coffee.

    Get in Touch

    Got a project idea? Let's discuss it over a cup of coffee.

      COLLABORATION

      Got a project? Let’s talk.

      We’re a team of creative tech-enthus who are always ready to help business to unlock their digital potential. Contact us for more information.