TrafficPOS Local Backup Server
Purpose: Provides durable local data backup that survives browser crashes and data clearing.
Overview
The TrafficPOS Local Backup Server is a standalone application that runs on each POS terminal, providing automatic backup of all POS data to permanent storage. This ensures data persistence even if the browser's IndexedDB is cleared.
Key Features
- Automatic Sync: Backs up data after every sale
- Durable Storage: Uses SQLite database (Linux) or file system (Windows)
- Multi-Platform: Available for Windows, Linux, and Mac
- Lightweight: Minimal resource usage (< 50MB RAM)
- Background Operation: Runs in system tray
Technical Architecture
Server Components
The backup server consists of:
- HTTP API Server: Runs on port 8888
- Database Engine: SQLite for data persistence
- Sync Engine: Handles incremental data updates
- System Tray Interface: For easy management
API Endpoints
Endpoint | Method | Description |
---|---|---|
/health |
GET | Server health check and status |
/sync |
POST | Sync data for a specific table |
/stats |
GET | Get sync statistics and record counts |
/backup |
GET | Export complete backup data |
Installation
Ubuntu/Debian Linux
sudo dpkg -i "TrafficPOS Local Server_1.0.0_amd64.deb"
The server will start automatically and appear in the system tray.
Windows
- Extract the Windows installer package
- Right-click
install.bat
and select "Run as administrator" - Follow the installation prompts
- Optionally add to Windows startup
Universal (Node.js)
npm install
node simple-server.js
Configuration
POS Integration
- Open TrafficPOS in your browser
- Navigate to Settings → System → Local Backup Server
- Enable "Use Local Backup Server"
- Verify connection (should auto-detect
http://127.0.0.1:8888
) - Enable "Auto-sync" and "Sync on Sale"
Advanced Configuration
The following settings can be configured in the POS:
- Server URL: Default is
http://127.0.0.1:8888
- Sync Interval: How often to sync in minutes (default: 5)
- Sync on Sale: Sync immediately after each sale
- Auto-sync: Enable periodic background sync
Data Storage
Storage Locations
Platform | Location |
---|---|
Linux (Tauri) | ~/.local/share/trafficpos-local-server/trafficpos_backup.db |
Windows | %LOCALAPPDATA%\trafficpos-backup\ |
Node.js | ./data/ (JSON files) |
Database Schema
The backup server stores the following tables:
products
- Product catalogsales
- Complete transaction recordsemployees
- Employee accountsusers
- User accountscustomers
- Customer recordstimeClocks
- Time tracking datastoreSessions
- Till sessionsinventoryCounts
- Inventory tracking
Security
Network Security
- Server binds only to localhost (127.0.0.1)
- Not accessible from network
- CORS configured for local POS only
Data Security
- Data stored locally on each terminal
- No cloud connectivity required
- File system permissions protect data
Troubleshooting
Common Issues
Port 8888 Already in Use
Another application is using port 8888. Either close that application or change the port in the server configuration.
Windows Firewall Blocking
Allow the backup server through Windows Firewall when prompted. Select "Private networks" for security.
Server Not Starting
On Windows, ensure you run the installer as administrator. On Linux, check system logs with journalctl -f
.
Verify Server Status
curl http://127.0.0.1:8888/health
Should return:
{
"status": "running",
"version": "1.0.0",
"port": 8888,
"database_status": "healthy"
}
Maintenance
Backup Data
To manually backup the server's data:
curl http://127.0.0.1:8888/backup > backup.json
Check Statistics
View sync statistics and record counts:
curl http://127.0.0.1:8888/stats
Updates
To update the backup server:
- Stop the current server
- Install the new version
- Start the server
- Data is preserved automatically
System Requirements
- OS: Windows 7+, Ubuntu 20.04+, macOS 10.15+
- RAM: 512MB minimum
- Storage: 1GB free space
- Network: Localhost only (no internet required)
Best Practice
Install the local backup server on every POS terminal. This ensures each terminal has its own complete backup that can survive browser issues or system crashes.