社區花園地塊管理器後端範本
GardenPlot、用水記錄及季節性費用
一個在 Back4app 上的生產就緒的 社區花園地塊管理器後端,包括 GardenPlot、WaterAccessLog、SeasonalFee 和用戶。包括 ER 圖、字段指南、JSON 架構、API 沙箱和快速設置的 AI 代理提示。
花園要點
此模板為日常協調提供了一個花園後端:GardenPlot、WaterAccessLog、SeasonalFee 和 User 被建模在一個地方。
- 地塊記錄保持結構化 — GardenPlot 儲存 plotCode、尺寸、床型、季節、狀態、指定園丁和灌溉區,以便每個床都有明確的名冊條目。
- 水源訪問是通過事件記錄的 — WaterAccessLog 捕捉地塊、用戶、accessType、灌溉時間、持續時間(分鐘)和水管、閥門或灌溉檢查的備註。
- 季節性費用保持可見 — SeasonalFee 跟蹤地塊、用戶、季節、金額、狀態、到期日和每個花園會話的付款參考。
- 協調工作流程更易於審核 — 使用 User、GardenPlot、WaterAccessLog 和 SeasonalFee 之間的指針關係來查看誰改變了什麼。
什麼是社區花園地塊管理員模板?
當庫存、預訂和定價不一致時,社區花園經營者會感到壓力,尤其是在高峰週末。小的延遲會迅速累積。在 Back4app 上,GardenPlot、WaterAccessLog 和 SeasonalFee 支持完整的社區花園循環——從報價到退貨——提供符合經營者實際工作的 API。該架構涵蓋 User(用戶名、電子郵件、角色、顯示名稱)、GardenPlot(地塊代碼、尺寸、床型、季節、狀態、指派的園丁、灌溉區)、WaterAccessLog(地塊、用戶、訪問類型、灌溉時間、持續分鐘數、備註)和 SeasonalFee(地塊、用戶、季節、金額、狀態、到期日、付款參考)。連接您首選的前端,開始更快地管理花園操作。
最佳用途:
社區花園模板概述
當社區花園的需求激增時,非正式流程首先崩潰——並不是因為人們不再關心,而是因為記憶和消息無法擴展。
利益相關者可以在此檢查 GardenPlot、WaterAccessLog 和 SeasonalFee 的覆蓋範圍:名稱、關係以及它們所能啟用的工作流程。
花園記錄功能
此中心中的每個技術卡片都使用相同的花園後端架構,包括用戶、GardenPlot、水資源訪問日誌和季節性費用。
用戶個人資料和花園角色
用戶存儲協調者和園丁的用戶名、電子郵件、角色和顯示名稱。
地塊尺寸和分配
GardenPlot 存儲 plotCode、尺寸、床型、季節、狀態、分配的園丁和澆水區域。
水源訪問日誌
WaterAccessLog 捕獲地塊、用戶、訪問類型、澆水時間、持續分鐘數和備註。
季節性費用追蹤
SeasonalFee 存儲地塊、用戶、季節、金額、狀態、到期日和付款參考。
為什麼要用 Back4app 構建您的花園佈局管理後端?
Back4app 為您提供運行 GardenPlot 任務、WaterAccessLog 記錄和 SeasonalFee 跟蹤所需的類別、查詢和權限,所有這些都來自單一的後端合約。
- •將地塊和費用記錄集中在一處: GardenPlot 類別和 SeasonalFee 類別將 plotCode、season、amount、status 和 paymentReference 連接在每個生長週期中。
- •水源訪問保持可追蹤: WaterAccessLog 記錄地塊、用戶、accessType 和 wateredAt,以便協調員可以檢查誰使用了水管、閥門或灌溉系統。
- •即時準備的花園操作: Live Queries 可以在協調員保存新記錄後立即更新 GardenPlot 狀態或 WaterAccessLog 記錄。
從一個後端架構運行地塊分配、水源訪問追蹤和季節性費用檢查,適用於所有客戶端。
花園福利
一個保持地塊操作有序的花園後端,而不需要您強制進行表格維護。
地塊的尺寸易於驗證
使用 GardenPlot.dimensions、GardenPlot.bedType 和 GardenPlot.wateringZone 來確認地塊是否符合新的種植計劃。
水的使用變得可審計
WaterAccessLog.accessType、WaterAccessLog.wateredAt 和 WaterAccessLog.notes 在使用水管室或水龍頭時創建清晰的記錄。
季節性費用與每個地塊相關聯
SeasonalFee.amount、SeasonalFee.status 和 SeasonalFee.paymentReference 使每個季節的會費保持可見。
任務保持最新
GardenPlot.assignedGardener 和 User.role 使人們輕鬆了解哪位園丁負責某個地塊。
查詢對於協調員來說保持簡單
Back4app 可以返回 GardenPlot、WaterAccessLog 和 SeasonalFee 記錄,並對季節或 plotCode 進行篩選。
可重複的建立路徑
AI Agent 提示、架構和 API 範例為每個技術堆疊提供相同的園藝操作合約。
準備好啟動您的花園地塊管理器了嗎?
讓 Back4app AI 代理為您的花園後端搭建框架,並從一個提示中生成 GardenPlot、WaterAccessLog 和 SeasonalFee 工作流程。
免費開始 — 每月 50 次 AI 代理提示,無需信用卡
花園技術棧
此社區花園後端模板中包含所有內容。
花園ER圖
社區花園地塊管理器架構的實體關係模型。
涵蓋用戶、花園地塊、水接入日誌和季節性費用的架構。
查看圖表來源
erDiagram
User ||--o{ GardenPlot : "assignedGardener"
User ||--o{ WaterAccessLog : "user"
User ||--o{ SeasonalFee : "user"
GardenPlot ||--o{ WaterAccessLog : "plot"
GardenPlot ||--o{ SeasonalFee : "plot"
User {
String objectId PK
String username
String email
String password
String role
String displayName
Date createdAt
Date updatedAt
}
GardenPlot {
String objectId PK
String plotCode
String dimensions
String bedType
String season
String status
String assignedGardenerId FK
String wateringZone
Date createdAt
Date updatedAt
}
WaterAccessLog {
String objectId PK
String plotId FK
String userId FK
String accessType
Date wateredAt
Number durationMinutes
String notes
Date createdAt
Date updatedAt
}
SeasonalFee {
String objectId PK
String plotId FK
String userId FK
String season
Number amount
String status
Date dueDate
String paymentReference
Date createdAt
Date updatedAt
}
花園整合流程
用於登錄、載入 GardenPlot 記錄、記錄 WaterAccessLog 條目以及更新 SeasonalFee 記錄的典型運行流程。
查看圖表源
sequenceDiagram
participant User
participant App as Community Garden Plot Manager App
participant Back4app as Back4app Cloud
User->>App: Sign in to manage plots
App->>Back4app: POST /login
Back4app-->>App: Session token
User->>App: Open plot roster
App->>Back4app: GET /classes/GardenPlot?include=assignedGardener
Back4app-->>App: GardenPlot list
User->>App: Record a water access event
App->>Back4app: POST /classes/WaterAccessLog
Back4app-->>App: WaterAccessLog objectId
User->>App: Update seasonal fee status
App->>Back4app: PUT /classes/SeasonalFee/:objectId
Back4app-->>App: SeasonalFee updated
App->>Back4app: Subscribe to GardenPlot and WaterAccessLog changes
Back4app-->>App: Live updates for plot status and water logs野外指南
花園地塊架構中每個類的完整字段級參考。
| 字段 | 類型 | 描述 | 必需 |
|---|---|---|---|
| objectId | String | Auto-generated unique identifier | 自動 |
| username | String | Account login name | |
| String | Account email address | ||
| password | String | Hashed password (write-only) | |
| role | String | User role in the garden program (e.g. coordinator, manager, gardener) | |
| displayName | String | Name shown in garden rosters and assignments | |
| createdAt | Date | Auto-generated creation timestamp | 自動 |
| updatedAt | Date | Auto-generated last-update timestamp | 自動 |
8 欄位在 User
花園許可
如何通過 ACL 和 CLP 策略保障用戶、地塊、水日誌和季節性費用更新的安全。
檔案所有權
用戶記錄應僅由經過身份驗證的用戶或協調員更改。
地塊分配控制
限制 GardenPlot 更新,使只有協調員可以更改 plotCode、維度或所指派的園丁。
水日誌完整性
當 accessType 或用戶必須根據有效時間表進行驗證時,通過 Cloud Code 寫入 WaterAccessLog 條目。
JSON 架構
原始 JSON 架構定義,準備複製到 Back4app 或用作實作參考。
{
"classes": [
{
"className": "User",
"fields": {
"objectId": {
"type": "String",
"required": false
},
"username": {
"type": "String",
"required": true
},
"email": {
"type": "String",
"required": true
},
"password": {
"type": "String",
"required": true
},
"role": {
"type": "String",
"required": true
},
"displayName": {
"type": "String",
"required": true
},
"createdAt": {
"type": "Date",
"required": false
},
"updatedAt": {
"type": "Date",
"required": false
}
}
},
{
"className": "GardenPlot",
"fields": {
"objectId": {
"type": "String",
"required": false
},
"plotCode": {
"type": "String",
"required": true
},
"dimensions": {
"type": "String",
"required": true
},
"bedType": {
"type": "String",
"required": true
},
"season": {
"type": "String",
"required": true
},
"status": {
"type": "String",
"required": true
},
"assignedGardener": {
"type": "Pointer",
"required": false,
"targetClass": "User"
},
"wateringZone": {
"type": "String",
"required": false
},
"createdAt": {
"type": "Date",
"required": false
},
"updatedAt": {
"type": "Date",
"required": false
}
}
},
{
"className": "WaterAccessLog",
"fields": {
"objectId": {
"type": "String",
"required": false
},
"plot": {
"type": "Pointer",
"required": true,
"targetClass": "GardenPlot"
},
"user": {
"type": "Pointer",
"required": true,
"targetClass": "User"
},
"accessType": {
"type": "String",
"required": true
},
"wateredAt": {
"type": "Date",
"required": true
},
"durationMinutes": {
"type": "Number",
"required": false
},
"notes": {
"type": "String",
"required": false
},
"createdAt": {
"type": "Date",
"required": false
},
"updatedAt": {
"type": "Date",
"required": false
}
}
},
{
"className": "SeasonalFee",
"fields": {
"objectId": {
"type": "String",
"required": false
},
"plot": {
"type": "Pointer",
"required": true,
"targetClass": "GardenPlot"
},
"user": {
"type": "Pointer",
"required": true,
"targetClass": "User"
},
"season": {
"type": "String",
"required": true
},
"amount": {
"type": "Number",
"required": true
},
"status": {
"type": "String",
"required": true
},
"dueDate": {
"type": "Date",
"required": false
},
"paymentReference": {
"type": "String",
"required": false
},
"createdAt": {
"type": "Date",
"required": false
},
"updatedAt": {
"type": "Date",
"required": false
}
}
}
]
}使用 AI 代理構建
使用 Back4app AI 代理從此模板生成一個真正的社區花園地塊管理應用,包括前端、後端、身份驗證以及地塊、水和季節費用流。
在 Back4app 上創建一個安全的社區花園地塊管理後端,使用此確切的架構和行為。 架構: 1. 用戶(使用 Back4app 內建):用戶名、電子郵件、密碼、角色、顯示名稱;objectId、createdAt、updatedAt(系統)。 2. GardenPlot:plotCode(字串,必填)、dimensions(字串,必填)、bedType(字串,必填)、season(字串,必填)、status(字串,必填)、assignedGardener(指向用戶的指針,選填)、wateringZone(字串,選填);objectId、createdAt、updatedAt(系統)。 3. WaterAccessLog:plot(指向 GardenPlot 的指針,必填)、user(指向用戶的指針,必填)、accessType(字串,必填)、wateredAt(日期,必填)、durationMinutes(數字,選填)、notes(字串,選填);objectId、createdAt、updatedAt(系統)。 4. SeasonalFee:plot(指向 GardenPlot 的指針,必填)、user(指向用戶的指針,必填)、season(字串,必填)、amount(數字,必填)、status(字串,必填)、dueDate(日期,選填)、paymentReference(字串,選填);objectId、createdAt、updatedAt(系統)。 安全: - 協調員管理地塊記錄、費用狀態和用水記錄。 - 園丁可以查看他們分配的 GardenPlot 條目,並為自己的地塊添加 WaterAccessLog 項目。 - SeasonalFee 更新應限於授權人員,而園丁可以查看自己的費用狀態。 身份驗證: - 註冊、登錄、登出。 行為: - 列出和編輯 GardenPlot 的尺寸、狀態和季節分配。 - 記錄用水事件,包括地塊、accessType、wateredAt、durationMinutes 和 notes。 - 追蹤季節性費用、到期日和 paymentReference 值。 交付: - Back4app 應用,包含架構、CLPs、ACLs,以及用於地塊名單、水訪問記錄、季節性費用跟踪和基於角色的管理的前端。
按下下面的按鈕以使用此模板提示預填打開代理。
這是沒有技術後綴的基礎提示。您可以在之後調整生成的前端棧。
API 沙盒
嘗試使用 REST 和 GraphQL 端點對花園平臺模式進行測試。響應使用模擬數據,並且不需要 Back4app 帳戶。
使用與此模板相同的模式。
選擇你的技術
展開每個卡片以查看如何將 GardenPlot、WaterAccessLog 和 SeasonalFee 與您選擇的技術棧整合。
Flutter 花園地塊管理後端
React 花園地塊管理後端
React 原生 花園地塊管理後端
Next.js 花園地塊管理後端
JavaScript 花園地塊管理後端
Android 花園地塊管理後端
iOS 花園地塊管理後端
Vue 花園地塊管理後端
Angular 花園地塊管理後端
GraphQL 花園地塊管理後端
REST API 花園地塊管理後端
PHP 花園地塊管理後端
.NET 花園地塊管理後端
您每項技術所獲得的內容
每個堆疊使用相同的社區花園後端架構和 API 合約。
一個花園數據模型
使用一致的架構來管理用戶、花園地塊、水源訪問日誌和季節性費用。
地塊維度跟蹤
存儲每個地塊的 plotCode、尺寸、床型、季節、狀態和灌溉區域。
水源使用記錄
記錄每次共享水源事件的用戶、訪問類型、灌溉時間、持續分鐘數和備註。
季節性費用可見性
追蹤每個季節的到期日、金額、狀態和支付參考。
技術比較
比較所有支持技術的設置速度、SDK 風格和 AI 支持。
| 框架 | 設置時間 | 花園效益 | SDK 類型 | AI 支持 |
|---|---|---|---|---|
| 大約 5 分鐘 | 用於行動裝置和網頁的統一代碼基礎。 | 型別 SDK | 完整 | |
| 少於 5 分鐘 | 快速的網頁儀表板用於地塊分配和澆水日誌。 | 型別 SDK | 完整 | |
| 約 3–7 分鐘 | 跨平台的手機應用程式,專為花園協調員設計。 | 型別 SDK | 完整 | |
| 快速(5分鐘)設置 | 伺服器渲染的操作控制台,供花園工作人員使用。 | 類型化的SDK | 完整 | |
| ~3–5分鐘 | 輕量級的網頁整合,用於地塊和費用追蹤。 | 類型化的SDK | 完整 | |
| 大約5分鐘 | 原生Android應用程式,專為現場協調員設計。 | 類型化的SDK | 完整 | |
| 少於5分鐘 | 為園藝志願者和管理者提供的本地iOS應用程式。 | Typed SDK | 完整 | |
| 約3–7分鐘 | Reactive的網頁用戶介面,用於地塊和水資源監控。 | Typed SDK | 完整 | |
| 快速(5分鐘)設置 | 針對大型園藝計畫的結構化操作應用程式。 | Typed SDK | 完整 | |
| 少於2分鐘 | 靈活的 GraphQL API 用於圖表、水日誌和費用。 | GraphQL API | 完整 | |
| 快速設置(2分鐘) | REST API 整合用於園藝管理工具。 | REST API | 完整 | |
| 約 3 分鐘 | 伺服器端 PHP 整合用於園藝儀表板。 | REST API | 完整 | |
| 約 3–7 分鐘 | .NET 後端支持花園操作。 | 類型化 SDK | 完整 |
設定時間反映從項目啟動到首次使用此範本模式的 GardenPlot 或 SeasonalFee 查詢的預期持續時間。
家庭園藝常見問題
有關使用此模板構建社區花園作物管理後端的常見問題。