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

5 at once
prospects per referral submission
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.
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.
- 01500-member goal
- 02trackable referrals
- 03broader engagement question
- 04PRFC Connect
one invitation flow, two useful views
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.
Multi-person referral
A member can add, edit, or remove as many as five prospective members before sending one bounded submission.
Invitation delivery
Successful referral records trigger branded SMTP email invitations with the co-op's identity embedded in the message.
Staff follow-through
An internal MUI data grid supports search, filtering, redeemed-state updates, and a print-ready PDF table.
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.
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.

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.

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.
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.
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.
results, with context
prospects per visit
A bounded multi-person flow instead of repeated one-by-one forms.
portal integration
The co-op’s account page links members into the referral system.
per batch
Partial referral batches are avoided.
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.