How kouljihate/farm-irrigation-system works
Farm Irrigation Workbench is a Flask application for designing farm irrigation layouts, with MongoDB as the documented source of truth. Users initialize a project with farm and water-source geometry, refine sectors and zones on a shared map, plan pipework and valves, lay out rows, trees, and driplines, then review hydraulic checks and export reports. The graph preserves those documented domain stages and the principal supporting layers. Several route and core relationships are based on the SOURCE INDEX or README because their implementations were not excerpted; unsupported details are omitted.
Main entry points: app.py Flask app · field.py Field layout · hydrology.py Hydrology planning · geometry.py Sectors and zones
Components 28
Web application
- Flask app
app.py - Design configuration
config.py - Authentication
routes/auth.py - Shared map editor
static/js/map.js - GeoJSON API
routes/api.py
Farm design
- Project setup
routes/project.py - KML import
core/kml_io.py - Sectors and zones
routes/geometry.py - Geometry operations
core/geometry.py - Smart geometry
core/smart_geometry.py - Geometry task queue
core/async_tasks.py - Field layout
routes/field.py - Row layout
core/rows.py - Tree placement
core/trees.py - Dripline layout
core/driplines.py
Engineering
- Input validation
core/validation.py - Hydrology planning
routes/hydrology.py - Hydraulic checks
core/hydraulics.py - Pipe routing
core/piping.py - Valve rules
core/valve_rules.py
Persistence and reporting
- Exports and BOM
routes/export.py - Bill of materials
core/bom.py - Read queries
db/queries.py - Write repository
db/repository.py - MongoDB
- Database connection
db/connection.py - Database schema
db/schema.py
Other components
- Farm designer
Connections 38
- Farm designer → Flask app: uses
README.md - Flask app → Authentication: registers
app.py - Flask app → Project setup: registers
app.py - Flask app → Sectors and zones: registers
app.py - Flask app → Hydrology planning: registers
app.py - Flask app → Field layout: registers
app.py - Flask app → Exports and BOM: registers
app.py - Flask app → GeoJSON API: registers
app.py - Project setup → KML import: imports with
routes/project.py - Project setup → Write repository: writes project
routes/project.py - Farm designer → Shared map editor: edits geometry
README.md - Shared map editor → GeoJSON API: loads and saves
README.md - Sectors and zones → Smart geometry: uses
routes/geometry.py - Sectors and zones → Geometry operations: uses
routes/geometry.py - Sectors and zones → Input validation: validates with
routes/geometry.py - Sectors and zones → Geometry task queue: dispatches tasks
routes/geometry.py - Sectors and zones → Write repository: writes geometry
routes/geometry.py - Hydrology planning → Geometry operations: uses
routes/hydrology.py - Hydrology planning → Pipe routing: uses
routes/hydrology.py - Hydrology planning → Valve rules: uses
routes/hydrology.py - Hydrology planning → Input validation: validates with
routes/hydrology.py - Hydrology planning → Read queries: reads via
routes/hydrology.py - Hydrology planning → Write repository: writes via
routes/hydrology.py - Project setup → Hydraulic checks: runs checks
routes/project.py - Field layout → Row layout: uses
routes/field.py - Field layout → Tree placement: uses
routes/field.py - Field layout → Dripline layout: uses
routes/field.py - Field layout → Input validation: validates with
routes/field.py - Field layout → Read queries: reads via
routes/field.py - Field layout → Write repository: writes via
routes/field.py - Exports and BOM → Bill of materials: builds BOM
routes/export.py - Exports and BOM → Geometry operations: uses
routes/export.py - Exports and BOM → Read queries: reads via
routes/export.py - GeoJSON API → Read queries: reads via
routes/api.py - Read queries → Database connection: gets database
db/queries.py - Write repository → Database connection: gets database
db/repository.py - Database connection → MongoDB: connects to
db/connection.py - Database connection → Database schema: ensures indexes
db/connection.py