TrueFeedBack is an anonymous feedback platform where users can create an account, share a public profile link, and receive anonymous messages. It includes email verification, secure authentication, message management, and AI-generated prompt suggestions to help visitors start conversations.
- User registration with email verification (OTP)
- Secure sign-in with NextAuth credentials provider
- Public user profile links for receiving anonymous messages
- Dashboard to:
- View received messages
- Delete messages
- Toggle accepting/not accepting messages
- AI-powered suggested message prompts (Google Gemini)
- Responsive UI built with Tailwind CSS and shadcn/ui components
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Database: MongoDB with Mongoose
- Authentication: NextAuth.js (JWT session strategy)
- Validation: Zod + React Hook Form
- Email: Resend + React Email
- AI Integration: Google Generative AI SDK
- Styling: Tailwind CSS
src/
app/
(auth)/ # Sign-up, sign-in, verify pages
(app)/ # Home and dashboard pages
u/[username]/ # Public anonymous message page
api/ # Route handlers
components/ # UI and feature components
context/ # Auth provider
helpers/ # Utility helpers (email sending)
hooks/ # Custom hooks
lib/ # DB, resend client, shared utilities
model/ # Mongoose models
schemas/ # Zod validation schemas
types/ # Type definitions
emails/ # Email templates
POST /api/sign-up- Register a new user and send verification codeGET /api/check-username-unique- Check username availabilityPOST /api/verify-code- Verify user account with codePOST /api/auth/[...nextauth]- Authentication endpoints (managed by NextAuth)POST /api/send-message- Send anonymous message to a userPOST /api/suggest-messages- Generate AI message suggestionsGET /api/get-messages- Fetch authenticated user's messagesGET /api/accept-messages- Get message acceptance statusPOST /api/accept-messages- Update message acceptance statusDELETE /api/delete-message/[messageid]- Delete a specific message
- Node.js 18+ (recommended LTS)
- npm
- MongoDB database
- Resend account/API key
- Google AI API key
Create a .env.local file in the project root:
MONGODB_URI=your_mongodb_connection_string
NEXTAUTH_SECRET=your_nextauth_secret
RESEND_API_KEY=your_resend_api_key
GOOGLE_API_KEY=your_google_ai_api_keyFor local NextAuth usage, you can also set
NEXTAUTH_URL=http://localhost:3000.
-
Install dependencies:
npm install
-
Add your environment variables in
.env.local. -
Run the development server:
npm run dev
-
Open http://localhost:3000.
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run lint checks
You can deploy this app on any Node.js-compatible hosting platform (for example Vercel). Ensure all required environment variables are configured in your deployment environment.
This project is currently unlicensed. Add a LICENSE file if you want to define usage terms.