A real-time anonymous chat application where users can match and chat based on preferences, with features like identity reveals, reporting, and admin management.
- User authentication with OTP verification for MIET domain emails
- Anonymous chat matching based on year and gender preferences
- Real-time messaging with typing indicators and emoji support
- Profile picture upload and management
- Reporting and blocking users
- Admin panel for user oversight and moderation
- Password reset functionality
- Responsive design with dark/light theme support
- Node.js with Express.js
- MongoDB with Mongoose
- Socket.IO for real-time communication
- JWT for authentication
- Cloudinary for image storage
- SendGrid for email services
- Multer for file uploads
- Next.js with React
- TypeScript
- Tailwind CSS for styling
- Socket.IO client for real-time features
- Axios for API calls
- Node.js (v16 or higher)
- MongoDB
- npm or yarn
-
Clone the repository:
git clone https://github.com/ashankgupta/guftagu.git cd guftagu -
Install backend dependencies:
cd backend npm install -
Install frontend dependencies:
cd ../frontend npm install -
Set up environment variables (see Environment Variables section below)
-
Start MongoDB on your system
MONGODB_URI=mongodb://localhost:27017/guftagu
JWT_SECRET=your_jwt_secret_here
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
SENDGRID_API_KEY=your_sendgrid_api_key
EMAIL_FROM=noreply@guftagu.com
NEXT_PUBLIC_API_URL=http://localhost:5000
-
Start the backend server:
cd backend npm run devThe backend will run on http://localhost:5000
-
Start the frontend development server:
cd frontend npm run devThe frontend will run on http://localhost:3000
-
Open http://localhost:3000 in your browser
- POST /api/auth/send-otp - Send OTP for registration
- POST /api/auth/register - Register new user
- POST /api/auth/login - User login
- POST /api/auth/logout - User logout
- POST /api/auth/forgot-password - Send password reset email
- POST /api/auth/reset-password - Reset password
- PUT /api/user/profile-picture - Update profile picture
- GET /api/admin/users - Get all users (admin only)
- GET /api/admin/user/:id - Get user details (admin only)
- PUT /api/admin/remove-report/:userId/:reportId - Remove user report (admin only)
- PUT /api/admin/unsuspend/:userId - Unsuspend user (admin only)
- PUT /api/admin/clear-blocks/:userId - Clear user blocks (admin only)
- join-lobby: Join chat lobby with preferences
- leave-lobby: Leave chat lobby
- send-message: Send message to matched user
- report-user: Report current chat partner
- block-user: Block current chat partner
- reveal-identity: Request identity reveal
- disconnect: Handle user disconnection
- matched: Notify when matched with another user
- receive-message: Receive message from chat partner
- user-typing: Notify when partner is typing
- user-stopped-typing: Notify when partner stopped typing
- user-reported: Notify when user is reported
- user-blocked: Notify when user is blocked
- identity-revealed: Notify when identity is revealed
- partner-disconnected: Notify when chat partner disconnects
guftagu/
├── backend/
│ ├── config/
│ ├── middleware/
│ ├── models/
│ ├── routes/
│ ├── utils/
│ ├── index.js
│ └── package.json
├── frontend/
│ ├── public/
│ ├── src/
│ │ ├── app/
│ │ ├── components/
│ │ ├── context/
│ │ └── lib/
│ └── package.json
└── README.md
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
This project is licensed under the MIT License.