Skip to content

Latest commit

 

History

History
185 lines (134 loc) · 10.1 KB

File metadata and controls

185 lines (134 loc) · 10.1 KB

Summary

The wms-demo-app is a full-stack reference Warehouse Management System (WMS) built with Spring Boot and Angular, designed to showcase how to consume real-time RFID tag streams from RFC OS, relate raw EPC codes to meaningful “items,” and provide a user interface for creating, searching, and monitoring inventory. In contrast, the rfcos-websocket-py project is a bare-bones Python sample that merely demonstrates how to establish a STOMP-over-WebSocket connection to RFC OS and print incoming tag identifiers—it does not include any inventory modeling, UI, or advanced processing.


wms-demo-app: What It Does

  • Item Management & Metadata Enrichment Allows users to create real-world items (with names, descriptions, images) and associate EPC codes to them, so you can search by item name rather than memorizing raw tag IDs (github.com).
  • Real-Time Monitoring Subscribes to RFC OS tag topics to display item locations on a live dashboard, updating positions as tags are read (github.com).
  • Business Logic & Data Smoothing Implements zone association (mapping raw antenna reads to warehouse “zones”) and clustering algorithms for confidence intervals in ZoneAssociationServiceImpl and TagWindowBO classes, demonstrating how to clean and interpret noisy tag data (github.com).
  • Full UI & Backend Stack Combines a Spring Boot backend (with REST endpoints for CRUD operations) and an Angular frontend to deliver an “enterprise-grade” demo of a working WMS, complete with Docker support and instructional videos (github.com).

rfcos-websocket-py: What It Does (and Doesn’t)

  • Basic WebSocket/STOMP Integration Connects to ws://<RFC-OS-HOST>:8888/websockets/messaging/websocket using Basic Auth, sends a CONNECT frame, then subscribes to /topic/tagBlinkLite.* to receive all tag events (github.com).
  • Raw Tag ID Output On each incoming frame, it unpacks the STOMP message and simply prints the body, which contains the raw EPC tag identifier (github.com).
  • No Inventory Context or UI It does not maintain any in-memory mapping from EPC to item metadata, nor does it include any zone logic, smoothing, or user interface—its sole purpose is to show how to hook into the RFC OS real-time stream.

Key Differences

Capability wms-demo-app rfcos-websocket-py
Tech Stack Spring Boot + Angular Python (asyncio, websockets, stomper) (github.com)
Inventory Modeling Yes (item creation, EPC→item association) (github.com) No
UI / Dashboard Yes (web frontend for search & monitoring) (github.com) No
Advanced Tag Processing Zone association, clustering & smoothing (github.com) None
Demonstration of REST Layers Yes (for regions, zones, history) No
Real-Time Stream Handling Yes (via STOMP client in Java, integrated with backend logic) Yes (prints raw IDs) (github.com)

Takeaway

  • Use rfcos-websocket-py when you need a quick proof-of-concept for connecting to RFC OS and examining raw tag streams in Python.
  • Use wms-demo-app as a comprehensive starting point for a production-like WMS, showing best practices for integrating real-time data, enriching it with business metadata, smoothing noisy reads, and delivering both RESTful and WebSocket interfaces with a polished UI.

Summary

Yes—you have more than enough context to spin up a React + Python proof-of-concept that mimics RFC OS’s real‐time streams and REST APIs. The rfcos-websocket-py repo shows exactly how STOMP-over-WebSocket streams are structured for live tag reads (github.com), and the wms-demo-app repo documents the REST endpoints and data models for items, regions, and zones in a warehouse management context (github.com). For a lean POC, you can use FastAPI to expose mock /api/* JSON routes and a WebSocket route emitting STOMP frames like /topic/tagBlinkLite.* (fastapi.tiangolo.com), and a Create React App (or Vite) front end leveraging @stomp/stompjs (or react-stomp-hooks) for real-time data plus Axios/Fetch for REST calls (npmjs.com, npmjs.com). You don’t need Next.js unless you require server-side rendering or file-based routing—plain React is fully capable for development and testing.


1. Extracting Schemas from the Public Repos

1.1 Real-time Tag Stream (STOMP/WebSocket)

  • Repo: rfcos-websocket-py provides a minimal Python example showing how to CONNECT over ws://…/websockets/messaging/websocket, SUBSCRIBE to topics like /topic/tagBlinkLite.*, and unpack frames to read raw EPC tag bodies (github.com).
  • What to Mock: Emulate STOMP frames with headers (destination, message-id, etc.) and a JSON body containing fields such as tagEpc, antennaId, regionId, and timestamp.

1.2 RESTful Configuration & History

  • Repo: wms-demo-app is a Spring Boot + Angular reference that defines REST endpoints for CRUD on regions, zones, and items—and historical tag lookups—so you can see example URL patterns and JSON shapes (github.com).

  • What to Mock: Provide stubbed JSON responses for routes like:

    • GET /api/regions[{ id, name, description }]
    • GET /api/zones?regionId=…[{ id, label, boundary }]
    • POST /api/items{ epc, sku, description }
    • GET /api/tags/history?start=…&end=…[{ epc, x, y, lastSeen }]

2. Mock Python Backend with FastAPI

  1. Project Setup

    python -m venv venv && source venv/bin/activate
    pip install fastapi uvicorn websockets stomp.py
  2. REST Endpoints

    from fastapi import FastAPI
    app = FastAPI()
    
    @app.get("/api/regions")
    def list_regions():
        return [{"id":"region1","name":"Aisle 1"}]
    
    @app.get("/api/items")
    def list_items():
        return [{"epc":"EPC0001","sku":"ABC123","desc":"Widget"}]
  3. WebSocket (STOMP) Route

    from fastapi import WebSocket
    import json, asyncio
    
    @app.websocket("/ws/tags")
    async def tag_stream(ws: WebSocket):
        await ws.accept()
        while True:
            # Build a mock STOMP MESSAGE frame
            frame = (
                "MESSAGE\n"
                "destination:/topic/tagBlinkLite.*\n"
                f"message-id:{random_id}\n\n"
                f"{json.dumps({'epc':'EPC0001','antennaId':'ant1','regionId':'reg1','timestamp':time.time()})}\x00"
            )
            await ws.send_text(frame)
            await asyncio.sleep(1)

3. React Front-End with STOMP & REST

  1. Initialize

    npx create-react-app wms-poc
    cd wms-poc
    npm install axios @stomp/stompjs
  2. STOMP Client

    import { Client } from '@stomp/stompjs';
    
    const stompClient = new Client({
      brokerURL: 'ws://localhost:8000/ws/tags',
      connectHeaders: {},
      debug: (msg) => console.log(msg),
    });
    stompClient.onConnect = () => {
      stompClient.subscribe('/topic/tagBlinkLite.*', msg => {
        console.log('Tag event:', JSON.parse(msg.body));
      });
    };
    stompClient.activate();
    • Library: @stomp/stompjs supports full STOMP specs over WebSockets (npmjs.com).
  3. REST Fetch

    import axios from 'axios';
    axios.get('/api/regions').then(res => setRegions(res.data));
  4. UI

    • Render lists of regions, zones, items, and live tag events in tables or maps.
    • Update state hooks on each WebSocket message.

4. Next.js vs. Plain React

  • Next.js adds SSR, file-based routing, and API routes, which can simplify co-hosting your Python mocks via a Node.js proxy—but it’s not required for a POC (medium.com, github.com).
  • Plain React (Create React App or Vite) is lighter and perfectly fine for proof-of-concept demos.

5. Conclusion

By reusing the message schemas and endpoint patterns evident in the two RFC OS sample repos, you can stand up a FastAPI mock server for STOMP streams and REST data, and a React front end to consume them. This yields a concise, decoupled React + Python POC without any Java or Angular dependencies—ideal for rapid experimentation and integration testing.