Skip to content

Conversation

@benjaminshafii
Copy link
Member

Summary

Implements an email-based whitelist system to control which users can receive starter virtual accounts. Users must be added to the whitelist by admins before they can get starter accounts.

Changes

Database

  • New starter_account_whitelist table
  • Migration generated: 0113_amused_black_bird.sql
  • Email stored lowercase with unique constraint
  • Foreign key to admins table for audit trail

Backend

  • Modified createStarterVirtualAccounts to check whitelist
  • Case-insensitive email matching
  • Graceful fallback if email not whitelisted
  • Admin TRPC procedures: list, add, remove from whitelist

Frontend

  • New Starter Whitelist tab in admin dashboard
  • Email input with validation
  • Table view with add/remove functionality
  • Optional notes field for context
  • Real-time updates

Integration

  • Email extraction from Privy (email auth, Google, etc.)
  • Updated both user registration flows
  • Comprehensive documentation in STARTER_ACCOUNT_WHITELIST.md

How to Use

Admin Flow:

  1. Navigate to /admin → Starter Whitelist tab
  2. Click Add Email → enter user's email
  3. User will now receive starter accounts on signup

User Flow:

  • No UX change - whitelisted users automatically get starter accounts
  • Non-whitelisted users proceed normally without starter accounts

Files Changed (11 files, 5,270 additions)

Key Files:

  • packages/web/src/db/schema.ts - Schema definition
  • packages/web/src/server/services/align-starter-accounts.ts - Whitelist logic
  • packages/web/src/components/admin/starter-whitelist-panel.tsx - Admin UI
  • packages/web/src/server/routers/admin-router.ts - Admin API
  • STARTER_ACCOUNT_WHITELIST.md - Full documentation

Deployment Notes

  1. Migration will run automatically on deploy
  2. Initial whitelist will be empty - add emails via admin UI
  3. No breaking changes - existing users unaffected

- Add starter_account_whitelist table with email, addedBy, notes
- Modify createStarterVirtualAccounts to check email whitelist before creation
- Add admin TRPC procedures: listStarterWhitelist, addToStarterWhitelist, removeFromStarterWhitelist
- Create StarterWhitelistPanel component with combobox for email selection
- Integrate whitelist tab into admin dashboard
- Pass userEmail to starter account creation flows in align-router and register-primary route
- Emails are stored lowercase and checked case-insensitively
- Only whitelisted emails can receive starter virtual accounts
@vercel
Copy link

vercel bot commented Oct 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
zerofinance Error Error Oct 21, 2025 5:06am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
zero-finance-weloveyourstartup Ignored Ignored Oct 21, 2025 5:06am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants