project

Te Waihora Farm Management System

Flask · MySQL · Bootstrap · view on github

Try it live · Opening the demo is faster than reading the write-up.

Open Live Demo →

A web farm-management simulator (FMS): move mobs between paddocks and simulate day-by-day pasture growth and grazing.

What it does

  • Mobs / Stock: see mob location, head count, average weight, plus age and weight per animal
  • Paddocks: show DM/ha and total DM per paddock; rows turn yellow/red below thresholds
  • Move mob: move a whole mob to an empty paddock (one mob per paddock at a time)
  • Edit paddocks: change area and pasture params, or add paddocks
  • Advance day: simulate “next day” and recalculate growth and consumption for all paddocks

Tech notes

  • Python Flask routes + Jinja2 templates, Bootstrap 5 UI
  • MySQL three-table relation: paddocks ← mobs ← stock
  • Simulation date lives in Session, separate from the real calendar; pasture updates daily as growth − consumption

Notes on this write-up

Built as coursework, then re-run locally after graduation — fixed day-advance and pasture formulas, cleaned docs and the GitHub repo. Code on GitHub; live demo is operable (Aliyun deploy).

Web 版农场管理模拟器(FMS):管理 mob(牛群)在 paddock(围场)之间的移动,按日模拟牧草生长与被吃掉的过程。

做什么

  • Mobs / Stock:查看牛群位置、头数、均重,以及每头牛的年龄与体重
  • Paddocks:展示每块围场的 DM/ha 与 total DM;低于阈值时行背景变黄/红
  • Move mob:把整群牛迁到空围场(一个围场同时只能有一群)
  • Edit paddocks:修改围场面积与牧草参数,或新增围场
  • Advance day:模拟「下一天」,自动重算所有围场的牧草生长与消耗

技术点

  • Python Flask 路由 + Jinja2 模板,Bootstrap 5 做界面
  • MySQL 三表关系:paddocks ← mobs ← stock
  • 模拟日期存在 Session,与真实日历分离;牧草按 growth − consumption 逐日更新

整理说明

课程期间完成初版,毕业后重新跑通本地环境,修复了日期推进与牧草计算公式等问题,并整理文档与 GitHub 仓库。代码见 GitHub,在线演示 可直接操作(阿里云部署)。