A comprehensive mock implementation of RF Controls RFID tracking system for development and demonstration purposes. This system simulates real-time RFID tag reads, provides REST APIs for metadata, and includes a React-based dashboard for visualization.
- Real-time STOMP-over-WebSocket simulation - Mimics RF Controls' tag event streams
- REST API endpoints - Zones, products, antennas, and tag history
- Mock data generation - Continuous tag reads with realistic timestamps and positions
- Cross-origin support - CORS enabled for frontend integration
- Real-time visualization - Live map showing tag positions across zones
- Interactive map - React Leaflet with zone overlays and tag markers
- Data tables - TanStack Table for live tag event history
- Connection monitoring - Real-time status of WebSocket connection
- Responsive design - Works on desktop and mobile devices
- 5 Zones: Electronics Aisle, Clothing Section, Home & Garden, Storage Area, Point of Sale
- 2 Antennas: ant1, ant2
- 8 Products: Various categories (electronics, clothing, home) with EPC-to-SKU mappings
- Generated Events: Realistic tag reads with coordinates, signal strength, timestamps
- Python 3.8+
- Node.js 16+
- npm or yarn
# Navigate to backend directory
cd backend
# Create virtual environment
python -m venv venv
# Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Start the server
python main.pyThe backend will start on http://localhost:8000
# Navigate to frontend directory
cd frontend
# Install dependencies
npm install
# Start the development server
npm startThe frontend will start on http://localhost:3000
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | API status and version |
/api/zones |
GET | List all zones with boundaries |
/api/products |
GET | List all products with EPC mappings |
/api/antennas |
GET | List all available antennas |
/api/tags/history |
GET | Historical tag read data |
| Endpoint | Protocol | Description |
|---|---|---|
/ws/tags |
WebSocket/STOMP | Real-time tag event stream |
{
"epc": "EPC0001",
"antennaId": "ant1",
"zoneId": "zone1",
"regionId": "zone1",
"timestamp": 1703123456789,
"x": 5.2,
"y": 2.8,
"rssi": -45,
"messageId": "uuid-string"
}{
"id": "zone1",
"name": "Electronics Aisle",
"boundary": [[0, 0], [10, 0], [10, 5], [0, 5]]
}{
"epc": "EPC0001",
"sku": "SKU123",
"category": "electronics",
"name": "Bluetooth Speaker"
}┌─────────────────┐ WebSocket/STOMP ┌─────────────────┐
│ React App │◄──────────────────────│ FastAPI Server │
│ │ │ │
│ - Map View │ REST API │ - Mock Data Gen │
│ - Tag Table │◄──────────────────────│ - STOMP Frames │
│ - Status Panel │ │ - REST Routes │
└─────────────────┘ └─────────────────┘
Edit the MOCK_ZONES array in backend/main.py:
MOCK_ZONES = [
{"id": "zone6", "name": "New Zone", "boundary": [[20, 0], [30, 0], [30, 10], [20, 10]]},
# ... existing zones
]Edit the MOCK_PRODUCTS array in backend/main.py:
MOCK_PRODUCTS = [
{"epc": "EPC0009", "sku": "SKU100", "category": "books", "name": "Programming Guide"},
# ... existing products
]Modify the generate_mock_tag_read() function in backend/main.py to change:
- Generation frequency
- Position algorithms
- Signal strength simulation
- Tag movement patterns
- Port 8000 in use: Change port in
main.py:uvicorn.run(app, port=8001) - CORS errors: Check CORS middleware configuration in
main.py - WebSocket connection fails: Verify firewall settings and port accessibility
- Map not loading: Check Leaflet CSS import in
public/index.html - WebSocket connection fails: Verify backend is running on correct port
- Table not updating: Check browser console for JavaScript errors
- No tag events: Backend generates events every 1-3 seconds automatically
- Map positioning issues: Zone boundaries use simple coordinate system (not lat/lng)
- Performance: Large tag history (100+ items) may slow table rendering
This is a mock system for development/demo purposes. For production:
- Authentication: Add API authentication (JWT, Basic Auth, etc.)
- Database: Replace in-memory data with persistent storage
- Rate Limiting: Implement API rate limiting
- Monitoring: Add logging, metrics, and health checks
- Security: Enable HTTPS/WSS, validate inputs, sanitize data
- Scalability: Add database connection pooling, caching
This implementation follows patterns from:
- RF Controls
wms-demo-app(Spring Boot + Angular reference) - RF Controls
rfcos-websocket-py(Python WebSocket client) - RFC-OS API documentation and samples
The mock system provides realistic simulations suitable for:
- Development against RF Controls APIs
- Customer demonstrations
- Integration testing
- Training and education
This project is for educational and development purposes. RF Controls is a trademark of RF Controls, LLC.