Secretly - AI Powered Anonymous Messaging Platform
Next.js 16React 19TypeScriptNextAuthMongoDBZodResendGemini AI
Secretly
Secretly is a full-stack anonymous messaging platform where users can create a public profile link and receive anonymous messages from anyone. The app focuses on privacy-first communication with a clean dashboard experience, secure auth flow, and AI-assisted message prompts for visitors.
Overview
The platform has two primary user roles:
- Registered user: creates an account, verifies email via OTP, logs in, manages message settings, and reads/deletes incoming messages from a dashboard.
- Visitor: opens a user�s public URL and sends anonymous messages without creating an account.
Each registered user gets a unique public route (/u/[username]) that acts as their anonymous inbox entry point.
Core features
- User sign-up with username/email/password
- Email OTP verification before account activation
- Credential-based sign-in
- JWT session-based authentication (NextAuth)
- Public profile link for anonymous message submission
- Dashboard controls:
- copy public profile link
- enable/disable receiving new messages
- refresh inbox and view latest messages
- delete messages with confirmation
- share message cards (preview + image download + WhatsApp share)
- AI prompt suggestions on public message page
- Toast-driven feedback for user actions and API responses
Application flow
- User signs up (
/sign-up) - Verification code is sent via email
- User verifies account at
/verify/[username] - User signs in at
/sign-in - Authenticated user lands on
/dashboard - User shares public URL (
/u/[username]) - Visitors submit anonymous messages from that public page
- Messages appear in dashboard inbox (newest first)
API surface (high-level)
POST /api/sign-upPOST /api/verify-codeGET /api/check-username-uniqueGET/POST /api/accept-messagesGET /api/get-messagesDELETE /api/delete-message/[messageid]POST /api/send-messagePOST /api/suggest-messagesGET/POST /api/auth/[...nextauth]
Tech stack
- Framework: Next.js 16 (App Router), React 19, TypeScript
- UI: Tailwind CSS v4, shadcn/ui, Radix UI, Lucide icons
- Auth: NextAuth (credentials + JWT sessions)
- Database: MongoDB + Mongoose
- Forms/validation: React Hook Form + Zod
- Networking: Axios
- Toasts: Sonner
- Email: Resend + React Email
- AI integration: AI SDK (
useCompletion) + server route for Gemini suggestions
Project structure (important folders)
src/app- routes, layouts, API handlerssrc/components- UI components and shared app componentssrc/schemas- Zod validation schemassrc/model- Mongoose modelssrc/lib- shared server/client utilitiessrc/context- providers (e.g., auth provider)emails- React Email templatesproxy.ts- route protection and redirect rules
Project workflow
| Content | Link |
|---|---|
| Workflow | click here |
Local setup
- Install dependencies
bash
npm install
- Configure environment variables in
.env
Required values (project-dependent keys/names may vary):
- MongoDB connection string
- NextAuth secret
- Resend API key
- AI provider key(s) used by suggestion API route
- Run development server
bash
npm run dev
Open http://localhost:3000.
Scripts
npm run dev- start development servernpm run build- production buildnpm run start- run production servernpm run lint- run lint checks
Notes
- This project uses App Router conventions and proxy-based access control.
- The public message experience is intentionally minimal to reduce sender friction.
- UI is built on reusable primitives to keep the design system consistent as features grow.