Service Layer
Core business logic layer with clean, typed methods for handling signups and referrals.
WaitlistService
Core implementation of the waitlist service. It can be extended with additional features.
Required Constants
The below constants are used in WaitlistService
. Replace them or adjust their values based on your application setup and needs.
Key Design Decisions
- Uses upsert operation to handle both new signups and duplicate attempts gracefully.
- Generates URL-safe, cryptographically secure referral codes using base64url encoding.
- Separates referral URL generation from core signup logic for flexibility.
- Returns minimal response data to maintain clean service boundaries.
- Handles optional referral codes without requiring conditional logic in consumers.
- Uses 8-byte random values for referral codes, balancing uniqueness and usability.
- Implements URL generation with standard Web APIs for consistent formatting.