Internships marketplace.
A two-way marketplace: YESS vets partner companies, companies post via revocable magic links, schools buy slots and choose allocation rules, students apply, and every placement closes with a supervisor evaluation.
- 3actors
- 5tables
- 12surfaces
- ≈9 minto read
The problem#
Schools want to send their students into real workplaces. Companies want trained interns from credible schools. Most platforms solve one side and force the other to live on email and LinkedIn. The friction compounds: companies post in fifty places, schools spam-spray applications nobody curated, and nobody knows which placements actually completed.
And when companies do get a portal in other systems, the price is a full user account inside the school's identity namespace — which the school's security team will never approve.
How YESS handles it#
YESS internships is a two-way curated marketplace where YESS is the broker. There are three actors and one source of truth.
- YESS super-admin vets partner companies, posts platform-level opportunities, sells slots cross-tenant to subscriber schools, and moderates anything companies submit themselves.
- Partner companies access their own portal via a magic link — no Supabase Auth account, no password, no user-namespace pollution. The link is the credential; revoking it bricks access immediately.
- Schools purchase slots per opportunity, choose the allocation method (merit / first-come / student-paid / admin-assigned / hybrid), and review their students' applications. Students at a paid-in school browse, apply, accept or decline offers, and after the placement upload their reflection.
The magic-link portal#
Companies don't get user accounts — they get a URL like /c/yic_<64-hex-chars>. The token is the secret. Behind the scenes it's 256 bits of entropy generated via gen_random_bytes(32), prefixed yic_ so it's distinguishable in logs. Every public RPC funnels through one internal resolver that checks revocation + expiry + scope on every call.
From the portal a verified partner can:
- See the company header + which scopes the link grants (
post,view_applications,manage_applications,manage_placements). - Post new opportunities from a guided form. Every submission lands in
moderation_status='pending'and is invisible to students until a YESS super-admin approves it. The reviewer can also request changes, sending feedback the company sees on their own list. - See every application across their opportunities, with a privacy-safe student snippet (first name, last name, school, country — never email/phone/address).
- Drive the company-side state machine: under_review → interview_scheduled → offer_received → rejected. Accepted and declined remain student-initiated. Status changes ping the student via the notification fanout.
- Submit the final supervisor evaluation with score, document URL, and outcome (completed / terminated_early / no_show). Closing this loop sets
completion_status, notifies the student, and surfaces the result in their portfolio.
Moderation queue#
Every company-submitted opportunity lands in /dashboard/internships/admin/moderation. The YESS team gets a notification (fanout to every user holding internships.moderate) and reviews: title, description, requirements, slots, deadline, eligibility, company verification status, and token provenance.
Three actions: approve flips it to approved + sets status='active' so schools see it immediately; request changes returns it to the company with notes and keeps it hidden from students; reject kills it with feedback. Every action is captured in audit_logs under internships.opportunity.
Schools pay, students apply#
The cross-tenant economics:
- A school's admin browses approved opportunities and asks YESS to sell them slots, or YESS reaches out proactively.
- YESS super-admin executes
useSellSlots()— inserts a row intoschool_opportunity_slotswith a price per slot and a payment status (paid / free / pending). - The school admin picks the allocation method from
/dashboard/internships/settings. This is the lever for "make students pay" or "use slots as motivation reward." - Students browse
/dashboard/internships, see only opportunities their school has paid slots for, and apply. Theenforce_slot_purchase()trigger validates eligibility on every applicationINSERT— if the school didn't pay, the application is rejected with42501. - Application flows through the company state machine, then into the placement lifecycle.
Complete it too#
Most platforms stop at "accepted." YESS marks the placement window, watches the company supervisor's evaluation come in, and closes the loop with a score, document, and notification.
After acceptance, the application carries:
placement_start_dateandplacement_end_date(scheduled window)completion_status:not_started→in_progress(auto-set when status='accepted' and start_date has passed) →completed/terminated_early/no_showsupervisor_evaluation_score,supervisor_evaluation_url,supervisor_notes(submitted by the company)student_reflection_url,student_reflection_notes(student uploads post-placement)certificate_url,certificate_generated_at(school-issued, ties into the C12 certificate engine)
Completion fires another notification. The school sees who actually finished where. The student carries the evaluation document into their alumni profile when they graduate.
Where this connects
- 25AlumniAn accepted student becomes a graduating alumnus carrying the supervisor evaluation into their alumni profile.
- 02AdmissionsEligible programs + min GPA on opportunities filter against the student's admission program and academic standing.
- 15CommunicationEvery status transition + badge unlock funnels through the notification engine — same fanout used by attendance + conduct.
- 27PlatformMagic-link partner tokens use the same security primitives + pg_cron housekeeping as the rest of the platform.
What makes this elite
- 01
Magic-link portal, no user-namespace pollution
Companies don't get auth.users rows. Instant revocation, forensic use_count + last_used_at per token, scope-gated RPCs. The same pattern works for any future external-partner integration.
- 02
Cryptographic tokens
256 bits of entropy via gen_random_bytes(32), prefixed yic_ for log distinguishability. Internal resolver checks revoke + expiry + scope on every call.
- 03
PII-safe by default
Company sees student name + school + country, never email / phone / address. Student PII never leaves the school's tenant.
- 04
Moderation is RLS-level
The public SELECT policy on internship_opportunities requires moderation_status='approved'. No UI workaround can bypass it.
- 05
Slot-purchase trigger is the federation door
No slot, no application, full stop. The trigger raises 42501 with a precise reason so the UI can show the student exactly what's missing.
- 06
Lifecycle to completion
Most platforms stop at 'accepted'. We mark 'completed' with a supervisor score and keep the record in the student's transcript.
- 07
End-to-end audit
Every token mint, revoke, opportunity state change, payment, and application transition lands in audit_logs under internships.*.
- 08
Auto-housekeeping
pg_cron sweeps daily at 03:15 UTC to mark expired tokens revoked. The UI status is always honest.