OpenFarmPlanner is a full-stack web application for planning and managing market-garden or CSA farm operations. It combines a Django REST backend and a React frontend in one repository, with project-based workflows, planting planning, and operational farm data management.
Deployment and infrastructure are maintained in a separate repository: OpenFarmPlanner-ops.
- Farm structure management (locations, fields, beds)
- Culture management with agronomic details and history/restore support
- Planting plans, task planning, and Gantt/yield-oriented views
- Seed demand and supplier workflows
- Multi-project support with project switching and invitations
- Session-based authentication (registration, activation, login/logout, password reset, account deletion/restore)
- Notes and media attachments
- Backend (
backend/): Django + Django REST Framework API, authentication, business logic, data persistence, media handling. - Frontend (
frontend/): React + TypeScript SPA (Vite), UI workflows, routing, i18n resources, and API integration. - Operations (
OpenFarmPlanner-ops): deployment, runtime environment, and operational automation (separate repository).
.
├── backend/ # Django backend application
├── frontend/ # React frontend application
│ └── e2e/ # Playwright end-to-end tests
├── docs/ # Additional design/technical notes
├── scripts/ # Shared utility and quality scripts
├── CONTRIBUTING.md # Commit and contribution conventions
└── README.md # Canonical repository entry point
Backend
- Python 3.12+
- Django 5.2
- Django REST Framework
- PDM for dependency and script management
- SQLite by default (PostgreSQL supported via env configuration)
Frontend
- React 19 + TypeScript
- Vite
- Material UI
- React Router
- Axios
- Vitest + Testing Library
- Playwright (E2E)
- Python 3.12+
- PDM
- Node.js 20+
- npm 10+
cd backend
cp .env.example .env
pdm install
pdm run migrate
pdm run runserverBackend API base path: http://localhost:8000/api/
In a new terminal:
cd frontend
cp .env.example .env
npm install
npm run devFrontend dev server: http://localhost:5173/
- The frontend sends credentialed requests to
/api/and includes CSRF headers for write operations. - The backend enforces authenticated access for API endpoints by default and supports project scoping via
X-Project-Id. - Public flows (registration, activation, login, password reset, invitation acceptance) are exposed through dedicated auth/invitation endpoints.
OpenFarmPlanner uses Django session authentication with CSRF protection:
- Register account
- Activate account by email link
- Login / logout
- Password reset request and confirmation
- Account deletion request with grace period and restoration flow
Authentication endpoints are available under:
/api/auth/*
cd backend
pdm run testcd frontend
npm run testcd frontend
npm run test:e2eProject version is defined in backend/config/version.py as a semantic version (MAJOR.MINOR.PATCH).
Use the provided script via Make:
make bump-version TYPE=fixSupported change types:
TYPE=feat→ bumps minor (x.Y.z) and resets patch to0TYPE=fix→ bumps patch (x.y.Z)TYPE=breaking→ bumps major (X.y.z) and resets minor/patch to0
The update is validated and applied safely:
- exactly one
VERSION = "..."definition must exist, - version format must be valid semver,
- file writes are done via atomic replace.
This repository uses a GitHub Action (.github/workflows/auto-release-label.yml) to auto-assign one release label on pull requests:
release:majorrelease:minorrelease:patch
Trigger events:
pull_requestwith types:opened,edited,synchronize
Decision rules:
release:majorif PR content includesBREAKING CHANGEorbreakingrelease:minorfor feature keywords:add,feature,implement,newrelease:patchfor maintenance keywords:fix,bug,refactor,docs,localize,translation,ui- fallback defaults to
release:patchif no keyword matches
Safety behavior:
- if any release label is already present, the workflow logs and skips reassignment,
- if none exists, it ensures labels exist at repository level, removes any release labels from the PR (defensive cleanup), and assigns exactly one.
backend/README.md– backend-specific development detailsfrontend/README.md– frontend-specific development detailsfrontend/e2e/README.md– E2E testing notesCONTRIBUTING.md– commit conventions and contribution expectations
Deployment and runtime operations are intentionally separated from this repository. Use the ops repository for deployment guides, infrastructure configuration, and environment-specific operational steps:
Pull requests are welcome.
For larger changes, please open an issue first to align on scope and approach. Keep contributions focused, incremental, and consistent with the existing project structure and style.
See CONTRIBUTING.md for commit format requirements.
This project is licensed under the MIT License. See LICENSE.