Hack4Impact · Paso Robles Food Co-op · 2024–2025

PRFC Referral Program

A referral workflow that helps co-op members invite friends while staff keep track.

  • Next.js 15
  • TypeScript
  • PostgreSQL
  • Prisma
  • MUI
  • Nodemailer
Paso Robles Food Co-op referral form
a production referral flow in the co-op’s visual language
the short version:
5 at once
prospects per referral submission
the first membership-growth tool

what can a software team realistically help with?

Paso Robles Food Co-op is working toward a community of 500 member-owners. Our Hack4Impact team was not a marketing agency, so we looked for a part of that goal software could support honestly: make member-to-member referrals easier to send and possible for staff to follow.

The result was a two-sided product. Members use a short, prefilled form to invite up to five people at once; co-op staff use an internal table to search, review, mark, print, and export the resulting referral activity.

one product story, two chapters

referrals became the starting point, not the finish line

The referral program tested one concrete membership-growth lever. The next Hack4Impact team kept referrals but widened the question from recruiting new members to engaging the whole existing community.

  1. 01500-member goal
  2. 02trackable referrals
  3. 03broader engagement question
  4. 04PRFC Connect
what the product does

one invitation flow, two useful views

01

Personalized entry

The existing member portal opens the referral form with the member's name, email, referral code, and a link-integrity checksum already attached.

02

Multi-person referral

A member can add, edit, or remove as many as five prospective members before sending one bounded submission.

03

Invitation delivery

Successful referral records trigger branded SMTP email invitations with the co-op's identity embedded in the message.

04

Staff follow-through

An internal MUI data grid supports search, filtering, redeemed-state updates, and a print-ready PDF table.

how it works

from one member to a trackable referral batch

  1. 01

    Member portal

    The co-op generates a deep link carrying nm, em, ref, and cs parameters for the signed-in member.

  2. 02

    Prefill + integrity check

    The form reads the identity fields, locks the referrer email, and calls the teammate-built checksum endpoint before submission.

  3. 03

    Client validation

    The interface checks every prospect and caps the list at five before building the nested prospects payload.

  4. 04

    Server validation

    The route repeats array, field, and count checks because direct API calls can bypass the browser.

  5. 05

    Atomic write

    Prisma creates the full batch inside one transaction so a partial referral group cannot be stored.

  6. 06

    Email + staff view

    Nodemailer sends each invitation; staff can then review the same records in the protected admin grid.

under the hood

why each layer exists

Next.js App Router

Hosts the member form, staff page, and referral/checksum Route Handlers in one TypeScript application.

Prisma + PostgreSQL

Stores one row per referred prospect and gives the batch operation transactional all-or-nothing behavior.

Nodemailer + SMTP

Turns a saved referral into the real side effect the product needs: an invitation in the prospective member's inbox.

MUI Data Grid + jsPDF

Makes referral activity operable for staff on screen and as a structured print/export artifact.

Checksum + password gate

The teammate-built checksum protects link integrity; a lightweight query-password gate limits the internal staff view.

GitHub Actions

Builds and tests against Node 18, 20, and 22 on pushes and pull requests.

member flow

Several invitations, one submission

I changed the payload from one prospect to an array and used a Prisma transaction so a group of referrals is either saved together or not at all.

Each prospect is validated individually, and the five-person limit is enforced on both sides of the request.

Referral form
the form keeps a multi-person action approachable
integration

Arriving with the member context intact

The co-op portal sends a member into the referral tool with name, email, and referral-code parameters. I finished the prefill behavior and made the identity field read-only once supplied.

Co-op portal referral entry point
the real workflow begins before the app screen
staff tools

Exports staff could actually read

I replaced a brittle hand-positioned PDF with a real table export, aligned on-screen and exported dates, and fixed alternating row colors that broke while the virtualized grid scrolled.

my contribution

where I worked inside the flow

I focused on the member-to-database seam and the staff-facing output: the multi-prospect request shape, validation on both sides, the atomic transaction, portal-prefill behavior, and a more dependable staff export.

The surrounding product also includes teammate-built checksum validation, the original Prisma setup, and the admin access gate. Those pieces are shown because they complete the workflow; my implementation work is the set below.

  • Changed the referral payload from one prospect to an array of prospects.
  • Enforced the five-person boundary in both the UI and API to limit accidental or abusive email side effects.
  • Used prisma.$transaction so a batch succeeds or fails together.
  • Finished URL-prefill behavior and made the supplied member identity read-only.
  • Rebuilt the PDF export with jsPDF AutoTable and stabilized date formatting and zebra striping.
how we worked

a 12-person nonprofit product team

Two tech leads, a product manager, three designers, and six developers moved the product from tickets and design review through pull requests, tests, demos, and nonprofit feedback.

An early self-service redemption form I prototyped did not survive the product process. The shipped system uses a staff-managed redeemed toggle instead, a smaller workflow that fit the co-op's operations better.

shape

Translate the co-op's referral need into a bounded technical workflow.

split

Break form, API, data, email, and staff-tool work into team-owned tickets.

review

Use pull requests, CI, and design/client feedback before merging.

operate

Keep the live member and staff paths legible enough for daily use.

what happened

results, with context

5

prospects per visit

A bounded multi-person flow instead of repeated one-by-one forms.

live

portal integration

The co-op’s account page links members into the referral system.

1 transaction

per batch

Partial referral batches are avoided.

looking back...

An early self-service redemption idea was replaced by a staff-managed flow, which was the better product fit. The checksum implementation belonged to teammates, so the technical story here stays with the multi-referral and staff-tool work I can explain deeply.