How krod7/modulo works
Modulo is a local web application that deterministically turns a single-page flowchart into traceable Python. The main journey is upload and normalize, recognize shapes/text, recover connectors into a graph, validate and repair flagged regions, translate to pseudocode for user approval, then generate syntax-checked code and source mappings. The README also documents constrained corrections, diagnostics, downloads, and highlighting. Edges use the pipeline and API excerpts or README statements; several later UI/API details are documented but their handlers were not sampled.
Main entry points: pipeline.py Pipeline orchestration · app.js Review UI · app.py Flask API · validation_service.py Structure validation
Components 20
Browser experience
- Review UI
frontend/js/app.js - Upload controls
frontend/js/upload.js - Source highlighter
frontend/js/highlighter.js
Local API
- Flask API
backend/app.py - Runtime settings
backend/config.py - Temporary analysis store
backend/analysis_store.py - Analysis contracts
backend/models.py - Pipeline orchestration
backend/pipeline.py
Diagram analysis
- File intake
backend/services/intake_service.py - Shape and OCR recognition
backend/services/vision_service.py - Connector geometry
backend/services/connector_geometry.py - Flow graph recovery
backend/services/graph_service.py - Structure validation
backend/services/validation_service.py - OCR text validation
backend/services/programming_ocr_validation.py
Deterministic translation
- Safe notation rules
backend/notation.py - Control-flow IR
backend/services/logic_service.py - Pseudocode rendering
backend/services/pseudocode_service.py - Python generation
backend/services/codegen_service.py - Source trace mapping
backend/services/trace_service.py
Other components
- Flowchart author
Connections 26
- Flowchart author → Review UI: submits chart
README.md - Review UI → Upload controls: uses upload
frontend/js/app.js - Review UI → Source highlighter: binds highlighting
frontend/js/app.js - Review UI → Flask API: sends analysis
README.md - Flask API → File intake: inspects upload
backend/app.py - Flask API → Pipeline orchestration: runs analysis
backend/pipeline.py - Flask API → Temporary analysis store: stores analysis
backend/app.py - Flask API → Runtime settings: configures limits
backend/config.py - Pipeline orchestration → File intake: runs first
backend/pipeline.py - Pipeline orchestration → Shape and OCR recognition: runs recognition
backend/pipeline.py - Pipeline orchestration → Flow graph recovery: runs recovery
backend/pipeline.py - Pipeline orchestration → Structure validation: runs checks
backend/pipeline.py - Pipeline orchestration → Control-flow IR: builds IR
backend/pipeline.py - Pipeline orchestration → Pseudocode rendering: renders pseudocode
backend/pipeline.py - Pipeline orchestration → Python generation: generates code
backend/pipeline.py - Pipeline orchestration → Source trace mapping: builds trace
backend/pipeline.py - Shape and OCR recognition → Connector geometry: uses geometry
backend/services/vision_service.py - Flow graph recovery → Connector geometry: uses connector tools
backend/services/graph_service.py - Structure validation → OCR text validation: checks OCR
backend/services/validation_service.py - Structure validation → Safe notation rules: validates notation
backend/services/validation_service.py - Control-flow IR → Structure validation: uses branch analysis
backend/services/logic_service.py - Control-flow IR → Safe notation rules: normalizes rules
backend/services/logic_service.py - Python generation → Safe notation rules: applies safe rules
backend/services/codegen_service.py - Flowchart author → Review UI: approves pseudocode
README.md - Review UI → Flask API: requests generation
README.md - Review UI → Source highlighter: links chart and output
README.md