Project Rules

Standing rules that must be followed every time something is built for this project.

🌐 URLs & Links

  • •ALL public links, emails, redirects, and claim URLs must use: https://www.realprofoundation.org
  • •NEVER use req.headers.get('origin') as a URL base — always hardcode the production domain for public links
  • •NEVER use https://app.base44.com or any staging domain in customer-facing links

🎟️ Ticket System

  • •Direct ticket buyers → receive ticket email immediately with embedded QR code
  • •Sponsor complimentary tickets → sponsor gets a claim link email first, then guests get individual ticket emails with QR codes after assignment
  • •Ticket emails ALWAYS include an embedded QR code image — never just a plain text code
  • •Claim links format: https://www.realprofoundation.org/SponsorTicketClaim?token=CLAIM-XXXXX

🏢 Organization Info

  • •Foundation Name: REALPRO Foundation
  • •Address: 2202 Broad Street, Cranston, RI 02905
  • •Phone: (401) 443-9880
  • •Email: administration@therealproway.com
  • •Website: https://www.realprofoundation.org
  • •Tax Status: 501(c)(3) non-profit

🎨 Brand & Design

  • •Gold / Primary Accent: #c9a55c
  • •Dark / Background: #1a1a1a
  • •Email headers: dark #1a1a1a background with gold #c9a55c title text
  • •Always use branded HTML emails — never plain text
  • •Monthly newsletters, event invitations, bulk outreach, and blog highlights must use the REALPRO Foundation logo header, branded footer, and working unsubscribe/disclaimer language

💰 Financial Rules

  • •Artist sales split: 80% to artist, 20% to REALPRO Foundation
  • •Partner event sponsorship split: 80% to partner org, 20% to REALPRO Foundation (configurable per event)
  • •Always create a PartnerPayout record when a partner event receives a sponsorship
  • •Always create order/transaction records before sending confirmation emails

📧 Email Rules

  • •All emails sent from name: "REALPRO Foundation"
  • •Always send confirmation email to the buyer/sponsor first
  • •Always notify admin (GallerySettings.contact_email) of any payment or significant action
  • •Use Gmail connector (OAuth) when available; fall back to Core.SendEmail
  • •Every non-transactional email must include visible unsubscribe links for event emails, newsletters, and unsubscribe-all options
  • •Unsubscribe links must route to https://www.realprofoundation.org/UnsubscribePreferences and update UserPreference records

🔒 Security Rules

  • •Never expose Stripe secret keys or webhook secrets in frontend code
  • •Always validate Stripe webhooks with constructEventAsync (Deno async crypto)
  • •Admin-only backend functions must check user.role === 'admin' and return 403 if not
  • •Public-facing pages (ticket claim, tax docs, event detail) do NOT require login

🗂️ Code Architecture

  • •Keep component files under ~100 lines — break into focused sub-components
  • •All new pages MUST be added as explicit <Route> elements in App.jsx
  • •Use find_replace tool for all edits — never rewrite entire files unless necessary
  • •Never build new functionality into already-large files without refactoring first
Note: These rules are stored in PROJECT_RULES.md at the root of the codebase and should be referenced before building any new feature.