A desktop application that automatically monitors a folder for scanned claim documents, uploads them via SFTP, and creates workflow records in your claims management system.
-
Set Up File Storage:
- Configure a folder on your VPS or SFTP server
- Gather your host, username, password, and port details
-
Set Up Database:
- Connect to your standard PostgreSQL database via pgAdmin or psql
- Execute the contents of
database-schema.sqlto create the initial tables
-
Install API Dependencies:
npm install --package-lock-only # Use the api-package.json # Or manually install: npm install express cors pg dotenv nodemon
-
Configure API Environment:
- Copy your
.env.apifile or create a new one for the API - Ensure it has your standard Postgres
DATABASE_URL
- Copy your
-
Start API Server:
node api-server.js # Or for development: npm run dev # (if using api-package.json)
The API will run on
http://localhost:3000
-
Install Dependencies:
npm install
-
Configure Environment:
- The
.envfile needs to be configured with your SFTP credentials (SFTP_HOST, etc) - Update
API_URLif your API is running on a different port
- The
-
Replace Icons (Optional):
- Replace placeholder files in
src/assets/with actual icons:icon.png(512x512)icon.ico(Windows)icon.icns(macOS)
- Replace placeholder files in
-
Run the Application:
npm run dev
- File Detection: Monitors
C:\ScannedClaims\for new files - Validation: Checks file size, type, and extracts barcode from filename
- Upload: Sends files to the VPS via SFTP
- Database: Creates records in your database via the API
- Organization: Moves processed files to subfolders
- TIFF (.tiff, .tif)
- PDF (.pdf)
- JPEG (.jpg, .jpeg)
- PNG (.png)
Files should be named with barcodes like:
BC001234.pdfBC-001234.tiffBC_001234.jpg
/
├── src/
│ ├── main.js # Electron main process
│ ├── preload.js # IPC bridge
│ ├── renderer/
│ │ ├── index.html # UI
│ │ ├── styles.css # Styles
│ │ └── app.js # Frontend logic
│ └── services/ # Backend services
├── api-server.js # Express API
├── database-schema.sql # Database setup
└── package.json
# Windows
npm run build:win
# macOS
npm run build:mac
# Linux
npm run build:linux
# All platforms
npm run buildSFTP_HOST: Your SFTP server URL or IPSFTP_USERNAME: Your SFTP usernameSFTP_PASSWORD: Your SFTP passwordAPI_URL: Your API server URLWATCHED_FOLDER: Folder to monitorUPLOAD_USER: Identifier for uploadsLOG_LEVEL: Logging level (info, warn, error)
- Watched folder path
- Upload retry attempts
- File size limits
- Auto-start behavior
Creates a document record and workflow entry.
Request Body:
{
"file_name": "BC001234",
"original_file_name": "BC001234.pdf",
"file_type": "pdf",
"file_size_bytes": 1024000,
"mime_type": "application/pdf",
"storage_bucket": "claim-documents",
"storage_path": "dmg-bin/2024/01/BC001234.pdf",
"storage_url": "https://...",
"barcode": "BC001234",
"batch_id": null,
"scan_date": "2024-01-15T10:30:00.000Z",
"uploaded_by": "scanner_app",
"status": "dmg_bin"
}Response:
{
"success": true,
"documentId": "uuid",
"workflowId": "uuid"
}- "Cannot find module 'electron'": Install Electron globally or use
npx electron - API connection failed: Ensure API server is running on correct port
- SFTP upload failed: Check server host, credentials, and path permissions
- File not detected: Check folder permissions and file types
Application logs are stored in:
- Windows:
%APPDATA%/claims-scanner-app/logs/ - macOS:
~/Library/Application Support/claims-scanner-app/logs/ - Linux:
~/.config/claims-scanner-app/logs/
MIT License - feel free to use and modify as needed.