Waitlist Signup
A prospective user visits the Encache landing page and submits their email address and optional metadata to join the product waitlist; the server deduplicates the entry and sends an internal notification to the team.
Flow
-
User submits the form — The landing web app (
apps/landing-web) sends aPOSTrequest to the waitlist endpoint with{ "email": "...", "metadata": { "name", "glassesType", "useCase", "from" } }. -
CORS preflight —
OPTIONSrequests return 200 with permissive CORS headers. Non-POST methods return 405. -
Input parsing — The request body is parsed as JSON. Invalid JSON returns 400.
-
Email validation — The email is trimmed and lowercased. Missing, malformed (missing
@or.), or too-long (>254 chars) emails return 400 with a descriptive message. -
Field length validation —
name(≤100),glassesType(≤100),useCase(≤2000), andfrom(≤100) are checked. Oversized fields return 400. -
DynamoDB upsert — A conditional
update_itemis performed with the email as the key: name,glassesType, anduseCaseare always updated.createdAtis set only on first insert (if_not_exists).-
fromis set only on first insert (if_not_exists), preserving the original referral source. -
Team notification — If
NOTIFY_EMAILSandNOTIFY_SENDERare configured, SES sends an internal notification email. Notification failure is caught and logged but does not affect the response. -
Response — Returns HTTP 200
{ "message": "Success" }.
Entry Point
- Lambda:
main/server/api/waitlist/app.py→lambda_handler - HTTP method:
POST /waitlist(API Gateway, no auth)
Dependencies
- DynamoDB:
WAITLIST_TABLE(defaultencache-waitlist) - AWS SES:
NOTIFY_SENDER,NOTIFY_EMAILS(comma-separated) - CORS:
CORS_ORIGIN(default*)