Back to Home

Building GeniusPlants

Building GeniusPlants

AI-Powered Garden Planning That Makes Growing Easy

The Problem: Gardening Is Overwhelming

Home gardening should be relaxing, but for most people, it's confusing and frustrating:

  1. What plants will actually thrive in your specific location and conditions?
  2. When is the optimal time to plant, water, fertilize, and harvest?
  3. How do you arrange plants for maximum growth in limited space?
  4. Remembering all the care tasks throughout an entire growing season?
  5. Finding the right supplies without wasting money on the wrong products?

Existing gardening apps offer generic advice that doesn't account for your specific garden. They don't know your zip code, sun exposure, or whether you have an automated sprinkler system.

I built GeniusPlants to be the AI gardening assistant that adapts to you.

The Vision: Your Personal AI Garden Planner

GeniusPlants combines AI intelligence with personalized garden data to give users specific, actionable guidance. The core principles:

Location-Aware Recommendations

Zip code-based plant recommendations that account for your hardiness zone, local climate, and growing season timing.

AI-Powered Care Plans

GPT-4o generates comprehensive care tasks based on your specific plants, garden setup, and even whether you have automatic watering.

Smart Layout Generation

AI optimizes plant placement considering space requirements, companion planting, and sun exposure for maximum yield.

Automated Reminders

Timezone-aware email notifications at 5PM local time remind users about tomorrow's gardening tasks—never miss a watering day.

The Tech Stack: Modern Full-Stack Architecture

Next.js 15 with Turbopack

Using the latest Next.js with Turbopack for blazing fast development. The App Router provides excellent server component support for data fetching, while client components handle interactive UI elements like garden layouts and task management.

Prisma ORM + PostgreSQL

Type-safe database access with Prisma. The schema models users, gardens, plants, tasks, and care plans with proper relationships. PostgreSQL handles complex queries for task filtering, garden capacity calculations, and timezone-aware scheduling.

OpenAI GPT-4o-mini

The AI brain powering plant recommendations, garden layout optimization, care plan generation, and the QuickAddPlants natural language feature. Optimized for cost vs. quality with session-based caching to reduce API calls.

NextAuth.js Authentication

Full authentication flow with email verification and password reset via Resend. Secure token-based verification with time-limited expiration. JWT strategy for stateless session management.

Resend for Email

Transactional email delivery for verification, password reset, and daily task reminders. Custom email templates with React components render beautiful, responsive emails.

Zustand State Management

Lightweight client-side state for UI preferences like expanded/collapsed plant groups, with persistence capabilities. Much simpler than Redux while providing all the functionality needed.

The Architecture: AI-First Garden Management

Building an AI-powered gardening platform requires careful orchestration of data flow:

User Journey Flow

  1. User creates account with email verification
  2. User creates a garden with location (zip code), dimensions, sun exposure, and watering type
  3. AI generates plant recommendations based on garden parameters
  4. User adds plants to garden—AI auto-generates optimal layout
  5. User generates comprehensive care plan—AI creates tasks based on plant needs
  6. System sends daily email reminders for upcoming tasks

Database Schema Design

Core entities in the Prisma schema:

  • User: Account with email verification status, password hash, notification preferences
  • Garden: User's garden with dimensions, zip code, sun exposure, watering type (manual/sprinkler/drip)
  • GardenPlant: Plants added to gardens with position coordinates, space requirements, planting dates
  • Task: Care tasks with type (watering, fertilizing, pruning), priority, due date, completion status
  • VerificationToken: Secure tokens for email verification and password reset

The schema supports multiple gardens per user, each with independent plant collections and care plans.

The AI Features: Intelligence at Every Step

AI isn't just a feature—it's woven throughout the entire user experience:

1. Smart Plant Recommendations

Users specify preferences (edible garden, low maintenance, pollinator-friendly) and GPT-4o-mini generates personalized recommendations considering:

  • Local hardiness zone based on zip code
  • Garden sun exposure (full sun, partial shade, full shade)
  • Available space and plant spacing requirements
  • User skill level and time commitment

2. AI Garden Layout Generation

After adding plants, users can click "Generate Smart Layout with AI" to optimize placement:

// AI considers companion planting, space requirements, and sun patterns
const layoutPrompt = `
Garden: ${garden.width}ft x ${garden.length}ft, ${garden.sunExposure}
Plants: ${plants.map(p => `${p.name} (${p.spaceRequired} sq ft)`).join(', ')}

Generate optimal X,Y positions for each plant considering:
- Companion planting relationships
- Space requirements (1 block = 1 sq ft)
- Taller plants in north to avoid shading shorter ones
- Paths for maintenance access
`

3. QuickAddPlants: Natural Language Input

Type "3 tomato plants, 2 peppers, and some basil" and AI parses the request, identifies plants, generates care information, and adds them to your garden—all in one step.

4. Intelligent Care Plan Generation

The care plan system is the heart of GeniusPlants. AI generates tasks considering:

  • Plant age: Newly planted vs. established plants need different care
  • Watering type: Gardens with sprinklers get one garden-wide watering task instead of per-plant
  • Seasonal timing: Tasks scheduled appropriately for the current growing season
  • Plant-specific needs: Tomatoes need staking, peppers need specific fertilizer timing

The Task Reminder System: Never Miss a Watering Day

The most valuable feature for busy gardeners: automated email reminders that respect timezones:

How It Works

  1. Vercel Cron Job: Runs hourly via /api/cron/task-reminders
  2. Timezone Detection: Garden zip code maps to timezone via lib/timezone.ts
  3. 5PM Check: If it's 5PM in the user's timezone, process their tasks
  4. Task Aggregation: All tasks due tomorrow across all gardens grouped into single email
  5. Resend Delivery: Beautiful email template sent via Resend API
  6. Notification Tracking: Tasks marked as notified to prevent duplicates
// vercel.json cron configuration
{
  "crons": [
    {
      "path": "/api/cron/task-reminders",
      "schedule": "0 * * * *"  // Every hour
    }
  ]
}

This ensures users in New York and Los Angeles both receive reminders at 5PM local time, giving them time to prepare for tomorrow's garden tasks.

Inside GeniusPlants: A Visual Tour

Your Garden Dashboard

Clean, intuitive interface showing your gardens, plants, and upcoming care tasks. Manage multiple gardens, view AI-generated layouts, and track task completion all in one place.

GeniusPlants dashboard showing garden management interface

The Challenges and Trade-Offs

1. AI Response Consistency

GPT can return inconsistent JSON formats. I implemented strict response_format: { type: 'json_object' }and validation layers that filter invalid data before database insertion. Tasks with invalid dates or missing required fields are rejected gracefully.

2. API Cost Optimization

Plant recommendations and care plans can get expensive. I implemented session-based in-memory caching with 30-minute TTL (configurable via environment variable). Cache clears on logout for data isolation. GPT-4o-mini provides great quality at lower cost than GPT-4o.

3. Timezone Complexity

Mapping zip codes to timezones isn't trivial. I built a lib/timezone.ts utility that handles the conversion, with fallbacks for edge cases. The cron job runs hourly and checks if it's 5PM in each user's timezone before sending reminders.

4. Block-Based Space Management

Garden layouts use a block system where 1 block = 1 square foot. Tracking plant positions, calculating remaining capacity, and preventing overlap required careful coordinate math. Plant dimensions derive from space requirements with proper boundary validation.

5. Automated Watering Intelligence

Gardens with sprinkler systems shouldn't get per-plant watering tasks. The care plan generation detects watering_type: 'SPRINKLER' and creates a single garden-wide watering task instead. This seemingly simple feature required restructuring the entire task generation prompt.

The Results: From Overwhelmed to Organized

Before GeniusPlants

  • • Research plants: 2+ hours (Google, forums, trial and error)
  • • Plan garden layout: 1 hour (graph paper, guessing)
  • • Create care schedule: 1 hour (spreadsheets, calendar)
  • • Remember tasks: Constant stress (forgotten waterings)
  • Total: 4+ hours + ongoing mental load

After GeniusPlants

  • • Research plants: 2 minutes (AI recommendations)
  • • Plan garden layout: 1 minute (AI-generated)
  • • Create care schedule: 30 seconds (one click)
  • • Remember tasks: Zero stress (daily email reminders)
  • Total: Under 5 minutes + automated reminders

That's a 98% time reduction in planning, plus peace of mind knowing you'll never forget a task.

Key Features Overview

Location-Based

Zip code determines hardiness zone, growing season, and timezone for reminders.

AI Recommendations

GPT-4o-mini suggests plants based on your specific conditions and preferences.

Smart Layouts

AI optimizes plant placement for companion planting and maximum growth.

Care Plans

Comprehensive task lists with priorities, due dates, and completion tracking.

Watering Intelligence

Adapts care plans based on manual, sprinkler, or drip irrigation systems.

Daily Reminders

Email notifications at 5PM local time for tomorrow's tasks.

Technical Highlights

Next.js 15 with Turbopack and App Router
Prisma ORM with PostgreSQL
OpenAI GPT-4o-mini for all AI features
Resend for transactional emails
NextAuth.js with email verification
Zustand for client state management
Vercel Cron for scheduled task reminders
Timezone-aware notification system
Session-based caching for API optimization
Block-based garden layout system

Lessons Learned

1. AI Needs Guardrails

GPT is powerful but unpredictable. Always validate AI outputs before database insertion. Use response_format: { type: 'json_object' } and implement fallback strategies for invalid dates and missing fields.

2. Cache Early, Cache Often

AI API costs add up fast. Session-based caching with configurable TTL saved significant money without impacting user experience. Users rarely need fresh recommendations within 30 minutes.

3. Domain Knowledge Matters

Building for gardeners meant learning about companion planting, hardiness zones, and seasonal timing. The AI is only as good as the context you provide in prompts. Domain expertise translated directly into better AI outputs.

4. User Experience Drives Architecture

The decision to send reminders at 5PM local time seemed simple but required timezone mapping, hourly cron jobs, and task deduplication logic. Always trace user stories through the entire technical stack before implementation.

Complete Tech Stack

Frontend: Next.js 15 (App Router), React 19, TypeScript, Tailwind CSS, Zustand

Backend: Next.js API Routes, NextAuth.js, Prisma ORM, PostgreSQL

AI: OpenAI GPT-4o-mini for recommendations, layouts, care plans, and natural language input

Email: Resend for verification, password reset, and daily task reminders

Infrastructure: Vercel (hosting + cron jobs), managed PostgreSQL

Analytics: Vercel Analytics, Reddit Pixel for conversion tracking

Want to Build Something Amazing Together?

If you're looking for an engineer who can integrate AI into real products, build clean architectures, and ship production-ready software, let's talk.