AnonMessage lets any visitor send a message to a registered user without creating an account. Every user gets a unique public profile URL. As long as the recipient has message acceptance turned on, anyone who knows the link can send them a message — no authentication, no tracking.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/dev0302/nextjs-project-1/llms.txt
Use this file to discover all available pages before exploring further.
Public Profile URL
Every registered user has a publicly accessible profile page at:username parameter from the URL, looks up the user, and renders the SendMessageProfile client component.
Sending a Message
The sender types their message in the text input on the profile page. When they click Send It, theSendMessageProfile component calls POST /api/send-message with a JSON body containing username and content:
- Finds the user document by
username. - Checks the
isAcceptingMessagesflag — returns403if it isfalse. - Constructs a new message object with
contentandcreatedAt. - Pushes it onto the user’s
messagesarray and callsuser.save().
201 Created with { success: true, message: "Message sent successfully" }.
Message Content Validation
Thecontent field is validated client-side and server-side against a Zod schema that enforces a minimum of 10 characters and a maximum of 300 characters:
Message Storage Model
Messages are stored as embedded subdocuments inside theUser document — there is no separate messages collection. Each message subdocument contains only two fields:
Acceptance Control
Users can pause and resume message delivery at any time from their dashboard. TheMessageToggle component on the dashboard calls POST /api/accept-messages whenever the user flips the switch:
getServerSession, then updates the isAcceptingMessages field on the user document:
When a user turns off message acceptance,
POST /api/send-message immediately
begins returning 403 Forbidden with the message
"User is not accepting messages". The sender sees this error on the profile
page. No message is stored, and the user’s messages array is not modified.No Sender Identity
The API stores only thecontent string and a server-generated createdAt timestamp. No sender IP address, device fingerprint, session cookie, or any other identifying information is recorded in the message subdocument or elsewhere in the request handler. Anonymity is structural — there is simply no code path that captures it.