Dive into the World of Anonymous Feedback - Where your identity remains a secret.
A modern, secure platform for sending and receiving anonymous messages built with Next.js, TypeScript, and MongoDB.
- Secure user registration and login with NextAuth.js
- Email verification system with OTP
- Password hashing with bcryptjs
- Protected routes and middleware
- Send anonymous messages to any user by username
- Toggle message acceptance on/off
- Real-time message management
- Message deletion capabilities
- OpenAI-powered message suggestions
- Smart content recommendations
- Enhanced user experience with AI assistance
- Automated verification emails
- Beautiful HTML email templates with React Email
- Reliable email delivery with Resend
- Responsive design with Tailwind CSS
- Accessible components with Radix UI
- Interactive carousels and animations
- Dark/light theme support
- Toast notifications
Core Technologies Next.js (v14.2.3): A React-based framework that offers server-side rendering, static site generation, and other powerful features for building modern web applications. React (v18) and React-DOM (v18): For building the user interface components. Mongoose (v8.4.1): For interacting with MongoDB, which will likely be your database for storing user accounts and messages. Next-Auth (v4.24.7): A library for implementing authentication in your Next.js app. Axios (v1.7.2): A promise-based HTTP client for making API requests. bcryptjs (v2.4.3): For hashing passwords, which is crucial for securing user accounts. Form Handling and Validation React-Hook-Form (v7.52.0): A library for managing form state in React, focusing on performance and simplicity. Zod (v3.23.8): A schema declaration and validation library, which can be used with React-Hook-Form for validating input. UI and Design Tailwind CSS (v3.4.1): A utility-first CSS framework for styling the app. Radix UI Components: A set of accessible UI primitives for building consistent user interfaces. Embla Carousel (v8.1.6): For creating carousels/sliders in the app. Lucide-React (v0.396.0): A library of icons for your UI. Additional Features Dayjs (v1.11.11): A lightweight JavaScript library for parsing, validating, manipulating, and displaying dates and times. OpenAI (v4.52.0): Integration with OpenAI's API, possibly for generating or filtering content. React-Email (v2.1.4): For handling email-related functionalities in your app, such as sending notifications or verifications. Resend (v3.3.0): Likely used for sending emails programmatically. Dev Tools and Utilities TypeScript (v5): Adds static typing to your JavaScript code, enhancing development and reducing bugs. ESLint (v8) and eslint-config-next (14.2.3): For maintaining code quality and consistency. App Overview The app allows users to send anonymous messages to others based on usernames they create. Given the dependencies and purpose, it likely includes features such as:
User authentication (with Next-Auth and bcryptjs). Form handling (with React-Hook-Form and Zod). Secure storage of data (using Mongoose and MongoDB). A responsive, modern UI (built with Tailwind CSS and Radix UI components). Email notifications or verifications (using React-Email and Resend). This combination of technologies makes for a robust and feature-rich application, ideal for your projectβs goal of anonymous messaging.
This is a Next.js project bootstrapped with create-next-app.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Inter, a custom Google Font.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
- Node.js (v18 or later)
- MongoDB database
- npm or yarn package manager
-
Clone the repository
git clone https://github.com/Gourav830/annonymusmessage.git cd annonymusmessage -
Install dependencies
npm install # or yarn install -
Set up environment variables Create a
.env.localfile in the root directory:# Database MONGODB_URI=your_mongodb_connection_string # NextAuth NEXTAUTH_SECRET=your_nextauth_secret NEXTAUTH_URL=http://localhost:3000 # Email Service RESEND_API_KEY=your_resend_api_key # OpenAI OPENAI_API_KEY=your_openai_api_key
-
Run the development server
npm run dev # or yarn dev -
Open your browser Navigate to http://localhost:3000 to see the application.
- Next.js 14.2.3 - React framework with server-side rendering
- React 18 - UI library for building user interfaces
- TypeScript - Static type checking for JavaScript
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Accessible component primitives
- Next.js API Routes - Serverless API endpoints
- NextAuth.js - Authentication library
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- Resend - Email delivery service
- React Email - Email template components
- OpenAI - AI-powered features
- React Hook Form - Performant form library
- Zod - TypeScript-first schema validation
- Hookform Resolvers - Form validation integration
- Lucide React - Beautiful icon library
- Embla Carousel - Lightweight carousel library
- class-variance-authority - CSS utility for component variants
- usehooks-ts - Collection of React hooks
src/
βββ app/ # Next.js App Router
β βββ (app)/ # Main application pages
β β βββ dashboard/ # User dashboard
β β βββ u/ # User profile pages
β βββ (auth)/ # Authentication pages
β β βββ sign-in/ # Login page
β β βββ sign-up/ # Registration page
β β βββ verify/ # Email verification
β βββ api/ # API routes
β βββ auth/ # Authentication endpoints
β βββ accept-messages/
β βββ check-username/
β βββ delete-message/
β βββ get-messages/
β βββ send-message/
β βββ sign-up/
β βββ suggest-messages/
β βββ verify-code/
βββ components/ # Reusable UI components
β βββ ui/ # Base UI components
β βββ messagecard.tsx # Message display component
β βββ navbar.tsx # Navigation component
βββ contex/ # React context providers
βββ helpers/ # Utility functions
βββ lib/ # Configuration and utilities
βββ model/ # MongoDB schemas
βββ schemas/ # Zod validation schemas
βββ types/ # TypeScript type definitions
# Development
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
# Additional commands
npm run type-check # Run TypeScript compiler checkUsers can send messages to any registered user without revealing their identity. The system ensures complete anonymity while maintaining a respectful communication environment.
- Unique username validation
- Real-time availability checking
- User-friendly profile URLs (
/u/[username])
- Toggle message acceptance on/off
- View all received messages in dashboard
- Delete unwanted messages
- AI-powered message suggestions
- Secure OTP-based verification
- Beautiful HTML email templates
- Automatic verification status tracking
- Password Hashing: All passwords are securely hashed using bcryptjs
- Email Verification: Users must verify their email before accessing features
- Protected Routes: Middleware ensures only authenticated users access protected pages
- Input Validation: All user inputs are validated using Zod schemas
- CSRF Protection: Built-in Next.js security features
The application is deployed on Vercel. To deploy your own instance:
- Fork the repository
- Connect to Vercel
- Import your GitHub repository to Vercel
- Configure environment variables
- Deploy
- Vercel will automatically build and deploy your application
Make sure to set all the required environment variables in your deployment platform:
MONGODB_URINEXTAUTH_SECRETNEXTAUTH_URLRESEND_API_KEYOPENAI_API_KEY
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js for the amazing React framework
- Vercel for hosting and deployment
- MongoDB for the database
- Radix UI for accessible components
- Tailwind CSS for styling
If you have any questions or need help, please:
- Check the Issues page
- Create a new issue if your question isn't already addressed
- Visit the live demo to see the application in action
Built with β€οΈ by Gourav830