The world has witnessed the digital transformation and Industry 4.0 technologies in the past decade. Nevertheless, there is still a lack of automation and digitalization in certain areas of the manufacturing industry; in particular, warehouse automation often has challenges in design and successful deployment. The effective management of the warehouse and inventory plays a pivotal role in the supply chain and production. In the literature, different architectures of Warehouse Management Systems (WMSs) and automation techniques have been proposed, but most of those have focused only on particular sections of warehouses and have lacked successful deployment. To achieve the goal of process automation, we propose an Internet-of-Things (IoT)-based architecture for real-time warehouse management by dividing the warehouse into multiple domains. Architecture viewpoints were used to present models based on the context diagram, functional view, and operational view specifically catering to the needs of the stakeholders. In addition, we present a generic IoT-based prototype system that enables efficient data collection and transmission in the proposed architecture. Finally, the developed IoT-based solution was deployed in the warehouse of a textile factory for validation testing, and the results are discussed. A comparison of the key performance parameters such as system resilience, efficiency, and latency rate showed the effectiveness of our proposed IoT-based WMS architecture.