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

Technical Architecture

Server Components

The backup server consists of:

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

  1. Extract the Windows installer package
  2. Right-click install.bat and select "Run as administrator"
  3. Follow the installation prompts
  4. Optionally add to Windows startup

Universal (Node.js)

npm install
node simple-server.js

Configuration

POS Integration

  1. Open TrafficPOS in your browser
  2. Navigate to Settings → System → Local Backup Server
  3. Enable "Use Local Backup Server"
  4. Verify connection (should auto-detect http://127.0.0.1:8888)
  5. Enable "Auto-sync" and "Sync on Sale"

Advanced Configuration

The following settings can be configured in the POS:

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:

Security

Network Security

Data Security

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:

  1. Stop the current server
  2. Install the new version
  3. Start the server
  4. Data is preserved automatically

System Requirements

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.