AnonMessage reads its configuration exclusively from environment variables so that secrets are never hard-coded in source files. During local development these values live inDocumentation 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.
.env.local at the project root; in production they are set through your hosting provider’s environment configuration (e.g., Vercel project settings).
Database
MongoDB connection string. AnonMessage uses Mongoose to connect to your cluster. For MongoDB Atlas the format is:The database name at the end of the URI (
anonmessage above) will be created automatically by Mongoose on first write. The application calls dbConnect() at the top of every API route and guards against multiple connections in the Next.js hot-reload environment.NextAuth
NEXTAUTH_URL must match the exact canonical URL of your deployment — including the protocol and port — for NextAuth’s session callbacks, CSRF protection, and redirect handling to work correctly. For local development use http://localhost:3000; for production set it to your full domain, e.g. https://anonmessage.example.com.A random, high-entropy string used by NextAuth to sign and encrypt JWT tokens and CSRF cookies. Must be at least 32 characters long. Generate a suitable value with:Changing this value in production will immediately invalidate all existing sessions, logging out every user.
The canonical base URL of your application. NextAuth uses this for constructing callback URLs and validating redirect targets.
- Local development:
http://localhost:3000 - Production:
https://yourdomain.com
Email (Brevo)
AnonMessage sends OTP verification emails through the Brevo (formerly Sendinblue) transactional email API. You will need a free Brevo account with at least one verified sender domain or email address.The email address that OTP verification emails are sent from. This address must be verified in your Brevo account under Senders & IPs → Senders. Unverified addresses will cause the Brevo API to reject the request with a 401 error.Example:
noreply@yourdomain.comYour Brevo API key, used to authenticate requests to the Brevo v3 SMTP API (
https://api.brevo.com/v3/smtp/email). Find or create one at app.brevo.com → SMTP & API → API Keys.The key begins with xkeysib- and should be treated as a secret.Google Gemini AI
AnonMessage uses the@google/genai SDK to call Google’s Gemini models from the GET /api/suggest-messages route. The API generates three open-ended question suggestions for the anonymous sender on the /u/[username] page.
API key for the Google AI Generative Language API. Obtain one for free at Google AI Studio under Get API Key. The key is passed directly to the
GoogleGenAI client:The Gemini model name to use for generating message suggestions. Defaults to
gemini-1.5-flash if this variable is not set. You can switch to a different model (e.g., gemini-1.5-pro) by setting this variable, without changing any source code.Default: gemini-1.5-flashComplete .env.local Example
The following block contains every variable AnonMessage reads. Copy it to .env.local in the project root and replace the placeholder values before running the development server.
.env.local