True Feedback is a Next.js application that allows users to receive anonymous feedback messages. Users can create an account, generate a unique profile link, and receive messages without revealing their identity.
- Anonymous Messaging: Send anonymous messages to any user without revealing your identity
- User Authentication: Secure sign-up and sign-in with JWT tokens
- Unique Profile Links: Each user gets a unique URL to share (
/u/username) - Message Management: View, delete, and manage received messages
- Toggle Messages: Enable/disable message receiving at any time
- AI Message Suggestions: Get AI-powered suggestions for sending messages
- Responsive Design: Beautiful UI that works on all devices
- Frontend: Next.js 16, React 19, Tailwind CSS
- Backend: Next.js API Routes
- Database: MongoDB with Mongoose ODM
- Authentication: JWT (JSON Web Tokens) with bcryptjs
- UI Components: Radix UI, shadcn/ui
- Form Handling: React Hook Form with Zod validation
- AI Integration: Google AI SDK (@ai-sdk/google)
- HTTP Client: Axios
my-app/
├── app/
│ ├── (app)/ # Protected routes
│ │ └── dashboard/ # User dashboard
│ ├── (auth)/ # Authentication routes
│ │ ├── sign-in/ # Sign in page
│ │ └── sign-up/ # Sign up page
│ ├── api/ # API routes
│ │ ├── accept-message/ # Toggle message acceptance
│ │ ├── delete-message/# Delete messages
│ │ ├── get-message/ # Fetch user messages
│ │ ├── send-message/ # Send anonymous messages
│ │ ├── sign-in/ # User login
│ │ ├── sign-up/ # User registration
│ │ ├── suggest-message/# AI message suggestions
│ │ └── u/[username]/ # User profile data
│ ├── context/ # React context providers
│ ├── lib/ # Utility functions
│ │ ├── auth.ts # Authentication utilities
│ │ ├── db.ts # Database connection
│ │ └── proxy.ts # Proxy utilities
│ ├── model/ # Mongoose models
│ │ └── User.ts # User model with messages
│ ├── schema/ # Zod validation schemas
│ │ ├── acceptMessageSchema.ts
│ │ ├── messageSchema.ts
│ │ ├── signInSchema.ts
│ │ └── signUpSchema.ts
│ ├── types/ # TypeScript types
│ │ └── ApiResponse.ts
│ └── u/[username]/ # Public user profile page
├── components/ # React components
│ ├── ui/ # shadcn/ui components
│ ├── MessageCard.tsx # Message display component
│ └── Navbar.tsx # Navigation component
└── lib/ # Utility functions
└── utils.ts # General utilities
- Clone the repository
bash
git clone <repository-url>
cd my-app
- Install dependencies
bash
npm install
- Set up environment variables
Create a .env file in the root directory:
env
# MongoDB Connection
MONGODB_URI=your_mongodb_connection_string
# JWT Secret (generate a strong random string)
JWT_SECRET=your_jwt_secret_key
# Google AI API Key (for message suggestions)
GOOGLE_API_KEY=your_google_api_key
# NextAuth (optional, for advanced auth)
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your_nextauth_secret
- Run the development server
bash
npm run dev
- Open in browser
Navigate to https://feedback-five-rho.vercel.app/
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/sign-up |
Register a new user |
| POST | /api/sign-in |
Authenticate user |
| POST | /api/send-message |
Send anonymous message |
| GET | /api/get-message |
Get user's messages |
| DELETE | /api/delete-message/[messageid] |
Delete a message |
| POST | /api/accept-message |
Toggle message acceptance |
| GET | /api/suggest-message |
Get AI message suggestions |
| GET | /api/u/[username] |
Get user public profile |
- Navigate to
/sign-up - Enter username, email, and password
- Submit to create your account
- After login, go to dashboard
- Copy your unique profile link (
/u/yourusername) - Share it with others to receive anonymous messages
- Others can send you messages via your profile link
- Messages appear in your dashboard
- Toggle "Accept Messages" on/off as needed
- View all received messages in dashboard
- Delete unwanted messages
- Use AI suggestions to craft your own anonymous messages
- Password hashing with bcryptjs
- JWT-based authentication
- Input validation with Zod schemas
- Server-side database operations
- Protected API routes
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.