How aryanonit/model-doc-agent works
ModelDocAgent is a Google Chat bot that turns a GitHub repository link into architecture documentation and a diagram. A webhook is acknowledged immediately, then background processing fetches repository files, asks Gemini to produce structured content, renders a Mermaid diagram, and delivers results to Chat and Google Docs. The monolithic app.py implements the main runtime stages. The README documents several integrations and workflow links not visible in the sampled code; those documented relationships are cited to readme.md.
Main entry points: app.py Background worker · authorize_google.py OAuth authorization
Components 16
Request handling
- Flask webhook
app.py - Background worker
app.py
Repository analysis
- Repository ingestor
app.py - Doc orchestrator
app.py
Document generation
- Diagram renderer
app.py - Document builder
app.py - Chat card delivery
app.py
External services
- Google Chat
- GitHub API
- Gemini
- mermaid.ink
- Google Docs
- Service account
- OAuth authorization
authorize_google.py - Google Drive
Other components
- Developer
Connections 17
- Developer → Google Chat: submits repository link
readme.md - Google Chat → Flask webhook: sends webhook
readme.md - Flask webhook → Google Chat: acknowledges
readme.md - Flask webhook → Background worker: starts
readme.md - Background worker → Doc orchestrator: runs analysis
readme.md - Doc orchestrator → Repository ingestor: fetches repository
app.py - Repository ingestor → GitHub API: reads files
readme.md - Doc orchestrator → Gemini: generates structured content
readme.md - Doc orchestrator → Diagram renderer: renders diagram
app.py - Diagram renderer → mermaid.ink: requests image
readme.md - Background worker → Document builder: builds document
app.py - Document builder → Google Docs: creates document
readme.md - Background worker → Chat card delivery: delivers results
readme.md - Chat card delivery → Google Chat: sends card
readme.md - Chat card delivery → Service account: authenticates with
readme.md - OAuth authorization → Google Docs: authorizes document access
authorize_google.py - Document builder → Google Drive: uploads optional logo
app.py