file-watcher-service
v1.0.0
Published
Standalone watcher for automated brief ingestion
Downloads
7
Readme
Automated Brief Watcher (Standalone)
This is a standalone service that watches brief files and posts them to Planx's automated ingestion API.
Why this exists
Use this repository when you want watcher dependencies isolated from the main Planx application.
Requirements
- Node.js 18+
- Reachable Planx API
- A watcher user account with access to the login and ingestion endpoints
Setup
- Install dependencies:
npm installCreate local config by copying
.env.exampleto.env.Update
.envwith your credentials and folder paths.
Run
Continuous watch mode:
npm run startOne-time mode (process existing files and exit):
npm run start:onceRun through the CLI command directly:
file-watcher
file-watcher --oncePublish as npm package
- Ensure the package is logged in and ready:
npm login- Publish:
npm publish- Install globally (on any machine):
npm install -g file-watcher-service- Run:
file-watcherEnvironment variables
AUTOMATED_INGEST_USERNAME(required)AUTOMATED_INGEST_PASSWORD(required)AUTOMATED_INGEST_API_BASE_URL(default:http://localhost:5000)AUTOMATED_INGEST_LOGIN_ENDPOINT(default:/api/auth/login)AUTOMATED_INGEST_PROCESS_ENDPOINT(default:/api/extractai/process-automated-brief)AUTOMATED_INGEST_WATCH_ROOT(default:./uploads/automated-briefs)AUTOMATED_INGEST_PROCESSED_ROOT(default:./uploads/automated-briefs/.processed)AUTOMATED_INGEST_WATCH_FOLDERS(default:us bank,newell)AUTOMATED_INGEST_ALLOWED_EXTENSIONS(default:.pdf,.doc,.docx)AUTOMATED_INGEST_FOLDER_CONFIG_MAP(optional JSON object mapping folder names to config IDs)
Push as separate repo
From the automated-brief-watcher folder:
git init
git add .
git commit -m "Initial standalone automated brief watcher"
git branch -M main
git remote add origin <your-new-repo-url>
git push -u origin main