Projects

Berry Besties Farm

React Supabase React Router CSS

Description

This project is a farm-themed React app where users create and manage a team of animal helpers. Each Bestie has a name, animal type, farm job, and favorite berry. Supabase stores the full crew so users can create, view, edit, and delete Besties, with a unique detail page for every character.

Features

  • Create form with animal cards, farm jobs, and favorite berry choices
  • Berry Barn gallery sorted by newest Besties first
  • Unique detail pages with join date and a short character story
  • Edit and delete flows connected to Supabase
  • Form validation and disabled submit until every field is filled
  • Loading, empty, not-found, and delete confirmation states

Inserts a new Bestie into Supabase, then sends the user to the Berry Barn:

const handleSubmit = async (event) => {
  event.preventDefault()

  const newBestie = {
    name: name.trim(),
    animal,
    job,
    berry,
  }

  const { error } = await supabase
    .from("besties")
    .insert(newBestie)

  if (error) {
    alert("Something went wrong. Please try again.")
    return
  }

  navigate("/barn")
}

Loads the full crew from Supabase when the Berry Barn page opens:

useEffect(() => {
  const fetchBesties = async () => {
    const { data, error } = await supabase
      .from("besties")
      .select("*")
      .order("created_at", { ascending: false })

    if (error) {
      alert("Something went wrong. Please try again.")
      return
    }

    setBesties(data)
  }

  fetchBesties()
}, [])

Gives every Bestie its own create, gallery, detail, and edit routes:

<Routes>
  <Route path="/" element={<Home />} />
  <Route path="/create" element={<CreateBestie />} />
  <Route path="/barn" element={<BestieBarn />} />
  <Route path="/bestie/:bestieId" element={<BestieDetail />} />
  <Route path="/edit/:bestieId" element={<EditDetails />} />
</Routes>

Outcome

A complete CRUD app with a playful farm theme and persistent data. This project helped me connect React forms and routes to a real database, including loading existing records into an edit form and handling empty or missing states.

Berry Besties Farm screenshot 1 Berry Besties Farm screenshot 2 Berry Besties Farm screenshot 3