mirror of
https://github.com/vinta/awesome-python.git
synced 2026-08-04 15:05:39 +00:00
- render.yaml for one-click Render web service deploy - Fix PORT env var (Render sets $PORT, not $WEBHOOK_PORT) - Add farm-aggregator/.gitignore so .env stays local but .env.example commits - Commit .env.example so it's available after clone Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KBD2dN2KEjzz3UQFa9hEpu |
||
|---|---|---|
| .. | ||
| jobs | ||
| prompts | ||
| scripts | ||
| services | ||
| .env.example | ||
| .gitignore | ||
| config.js | ||
| index.js | ||
| package.json | ||
| README.md | ||
| render.yaml | ||
| start.bat | ||
Farm Aggregator
A lightweight Node.js service that runs on the farm server. It pulls data from AG-Refine and Dropbox, synthesises it with Claude Haiku, and pushes summaries back to Dropbox and WhatsApp on a schedule.
Data flow
AG-Refine (Render) ─┐
DairyComp logs ──┤ Dropbox ──→ farm-aggregator ──→ Haiku ──→ Dropbox /Summaries
FeedLync files ──┘ │ WhatsApp
│
TomTom geofence webhooks ────────────────→─┘
Setup
1. Install Node.js 20+
Download from https://nodejs.org/
2. Clone the repo and install dependencies
cd farm-aggregator
npm install
3. Create your .env file
copy .env.example .env
notepad .env
Fill in:
ANTHROPIC_API_KEY— your Anthropic keyDROPBOX_*— see Dropbox section belowWHATSAPP_*— optional, leave blank to skip
4. Dropbox OAuth setup
- Go to https://www.dropbox.com/developers/apps and create an app
- Set permissions:
files.content.read,files.content.write - Generate an access token OR set up the refresh token flow
- Copy App Key, App Secret, and Refresh Token into
.env
5. Start the service
start.bat
Or to run as a Windows service (stays running after logout):
npm install -g node-windows
node install-service.js
Schedules
| Job | Default | What it does |
|---|---|---|
| Pulse | Hourly | Quick snapshot — tickets, lab flags, ops |
| Daily | 06:00 | Full daily digest pushed to Dropbox + WhatsApp |
| Weekly | Mon 06:00 | Weekly summary (Sonnet, deeper analysis) |
Change schedules in .env using cron syntax.
TomTom geofencing
- In TomTom Geofencing API, create fences for each field boundary
- Set webhook URL to
http://YOUR_SERVER_IP:3001/webhook/tomtom - Entry/exit events are logged to Dropbox and sent to WhatsApp
Manual triggers (testing)
curl -X POST http://localhost:3001/run/pulse
curl -X POST http://localhost:3001/run/daily
curl -X POST http://localhost:3001/run/weekly
Planned integrations
- iyohtah / nTELL AI — herd health data once API access is confirmed
- Daitrix — AI camera feed events (scale automation, pen detection)
- Oracle Cloud — heavy data processing offload