How thevickypedia/jarvismonitor works
Project type and purpose
• JarvisMonitor is a background monitoring service (a specialized backend tool) that periodically checks the health of Jarvis processes, generates an HTML status page (and optional email notification), and publishes it via GitHub Pages.
File structure
• Top-level scripts:
• run.py – entry point called by cron.
• monitor.py – contains the core monitoring logic.
• templates/ – Jinja2 templates for web and email reports.
• docs/ – output directory; committed to the docs branch for GitHub Pages.
• .github/workflows/ – GitHub Actions to build/cleanup the docs branch.
• requirements.txt – dependencies (GitPython, Jinja2, PyYAML, etc.).
README for additional insights
• Monitored processes come from a source_map YAML file (generated by Jarvis).
• Environment variables drive configuration (Git credentials, Gmail creds, schedule overrides).
• The service is intended to run every minute via a crontab entry.
• On each run it:
a. Reads the source_map file.
b. Checks process statuses.
c. Renders HTML using Jinja templates.
d. Optionally emails the report.
e. Commits and pushes to GitHub Pages via GitPython/GitHub API.
Main components & interactions (to include
a. Scheduler (Cron)
– Triggers run.py every minute.
b. JarvisMonitor Application (run.py → monitor.py → models → templates)
1. Configuration Loader (env vars)
2. YAML Reader (models/helper.py)
3. Health Checker (monitor.py)
4. Renderer (Jinja2 templates in templates/)
5. Output Writers:
• File Writer → docs/index.html
• Email Sender (SMTP) → Gmail service (conditional)
6. Git Publisher (GitPython / GitHub API) → pushes docs/ to docs branch
c. External Dependencies
– Source Map File (processes.yaml generated by Jarvis)
– GitHub (repo, docs branch → GitHub Pages)
– Gmail SMTP (optional email notifications)
Architectural patterns & principles
• Pipeline pattern: Read → Process → Render → Publish.
• Single Responsibility: each module (models, monitor, templating, Git ops, email) has a clear role.
• External integration: decoupled via environment variables.
• Static site generation: output is pure HTML served by GitHub Pages.