Research EngineeringIn Progress2026

NRate.farm — Smart Nitrogen Calculator for Farmers

Full-stack agri-tech SaaS for economics-driven nitrogen fertilization decisions. Germany's first N-rate optimizer that balances marginal grain revenue against fertilizer cost — DüV-compliant, bilingual (DE/EN), deployed on nrate.farm.

NRate.farm — Smart Nitrogen Calculator for Farmers

Gallery

Problem

German farmers applying nitrogen fertilizer face a compound decision problem: agronomic yield targets, volatile input costs, real-time grain prices, and mandatory DüV (Düngeverordnung) regulatory constraints must all be reconciled simultaneously. Existing tools either ignore economics (yield-only models) or ignore regulations (simple calculators). No publicly available, free tool combined marginal revenue analysis with DüV compliance, regional soil/climate data, and multi-crop support in one production-ready interface — leaving farmers to make high-stakes fertilization decisions with incomplete information.

Approach

Built a full-stack Next.js 16 App Router application with bilingual routing: German default at `/`, English at `/de`. Core architecture uses an economics-based marginal optimization model that computes the N rate where the marginal value product of nitrogen (grain price × yield response) equals marginal fertilizer cost. Designed a bespoke design system using Tailwind CSS v4's new `@theme inline` directive, Space Grotesk + Inter fonts, and custom HSL token variables — all migrated from a Lovable-generated Vite prototype. Implemented production observability with PostHog analytics proxied through Next.js rewrites to bypass CSP restrictions. Landing pages feature full Framer Motion scroll animations, a server-rendered calculator with state hydration via URL params (`/calculator?crop=...`), and shadcn/ui components adapted from Radix UI primitives.

Data

Crop-specific agronomic parameters for six major German arable crops (winter wheat, winter barley, winter rapeseed, spring barley, silage corn, sugar beet): yield response curves, DüV crop-specific nitrogen limits, BBCH growth stage coefficients for split application timing, and regional soil Nmin baseline ranges (kg N/ha). Price inputs (grain €/dt, N fertilizer €/kg N) entered live by user to reflect current market conditions. Location field enables region-aware adjustments for climate and soil type. Translation database covers full bilingual (DE/EN) UI across nav, calculator, features, FAQ, and legal pages.

Validation

Economics model cross-checked against published marginal revenue / marginal cost (MR=MC) nitrogen optimization literature and University of Bonn agronomy guidelines. DüV crop limits verified against official Düngeverordnung 2017 (amended 2020) text for all six supported crops. PostHog event tracking validates user funnel from landing page → calculator → result, providing real-world usage data for iterative improvement. SEO metadata (hreflang alternates, canonical URLs, structured description) validated against Google Search Console standards.

Results

Live production deployment at nrate.farm. Bilingual landing page with 7 sections (Header, Hero, Features, How It Works, Blog, FAQ, Footer), full i18n across EN/DE. Calculator supports six crops with economics-optimized N-rate output. PostHog analytics operational with CSP-compliant reverse proxy. Tailwind v4 design system with custom gradient tokens, glow utilities, and responsive container centering. Blog infrastructure with static MDX generation for both language routes (`/blog/[slug]`, `/de/blog/[slug]`). Germany-Specific feature card conditionally rendered only on DE locale — content correctly segmented by language version.

My Role

Sole developer. Full-stack design and implementation: economics model architecture, Next.js App Router bilingual routing system, Tailwind v4 design system migration from Lovable/Vite prototype, PostHog analytics integration with CSP proxy, responsive UI components, and production deployment on Vercel.

Next Steps

Implement full MR=MC yield response curve engine (Mitscherlich function) per crop with live price feed integration. Add user accounts for saving field history and multi-year N-budget tracking. Expand to Austrian and Swiss DüV variants. Integrate weather API for location-aware growing season adjustment. Publish agronomic blog content in both languages for SEO and farmer education. Add WhatsApp/email result export for farmer-advisor sharing.

Key Outcomes

  • Live at nrate.farm — Germany's first economics-driven N calculator
  • MR=MC optimization model across 6 DüV-compliant crops
  • Bilingual (DE/EN) with locale-aware content segmentation
  • Tailwind v4 design system migrated from Lovable prototype
  • PostHog analytics via CSP-compliant reverse proxy

Tech Stack

Next.js 16TypeScriptTailwind CSS v4Framer Motionshadcn/uiPostHogVercel

Tags

agri-technextjstypescripti18nsaasfertilizationeconomics