A modern, real-time chat application that connects users based on their geographical proximity. Built with React, TypeScript, and Socket.IO.
- GPS Integration: Automatic location detection using browser geolocation API
- Distance Filtering: Adjustable distance ranges (100m to 50km)
- Smart User Sorting: Active users displayed by proximity
- Instant Messaging: Real-time chat with WebSocket connections
- Direct Messages: Private conversations between users
- Typing Indicators: See when someone is typing
- Message Status: Delivery and read receipts
- Individual Notifications: Separate notification counts per user
- Sound Alerts: Different notification sounds for various message types
- Desktop Notifications: Browser notifications when app is in background
- Customizable Settings: Control notification preferences
- Responsive Design: Works seamlessly on desktop and mobile
- Dark Mode: Eye-friendly dark theme
- Smooth Animations: Polished user interactions
- Real-time Updates: Live user presence and message updates
- Frontend: https://geo-chat-flax.vercel.app
- Backend: https://geo-chat-d184.onrender.com
- React 18 with TypeScript
- Vite for fast development and building
- Tailwind CSS for styling
- Socket.IO Client for real-time communication
- Lucide React for icons
- Node.js with Express
- Socket.IO for WebSocket connections
- TypeScript for type safety
- Helmet for security headers
- CORS for cross-origin requests
Geo_chat/
├── project/ # Frontend React application
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── hooks/ # Custom React hooks
│ │ ├── services/ # API and socket services
│ │ ├── types/ # TypeScript type definitions
│ │ └── utils/ # Utility functions
│ ├── public/ # Static assets
│ └── package.json # Frontend dependencies
├── backend/ # Node.js backend server
│ ├── src/
│ │ ├── handlers/ # Socket event handlers
│ │ ├── utils/ # Backend utilities
│ │ └── server.ts # Main server file
│ └── package.json # Backend dependencies
└── README.md # This file
- Node.js 18+
- npm or yarn
- Modern web browser with geolocation support
-
Clone the repository
git clone https://github.com/Basedonsearch-Dindayal/Geo_chat.git cd Geo_chat -
Setup Backend
cd backend npm install npm run dev -
Setup Frontend
cd project npm install npm run dev -
Open your browser
- Frontend: http://localhost:5173
- Backend: http://localhost:3001
VITE_SERVER_URL=http://localhost:3001NODE_ENV=development
PORT=3001
CORS_ORIGIN=http://localhost:5173- Connect your GitHub repository to Vercel
- Set environment variable:
VITE_SERVER_URL=https://your-backend-url - Deploy automatically on push to main branch
- Connect your GitHub repository
- Set root directory to
backend - Configure environment variables:
NODE_ENV=productionCORS_ORIGIN=https://your-frontend-url
- Input Validation: All user inputs are sanitized and validated
- CORS Protection: Configured for specific origins only
- Helmet Security: Security headers for enhanced protection
- XSS Prevention: No dangerous HTML rendering
- Safe Storage: Client-side data stored securely
- ✅ Chrome 80+
- ✅ Firefox 75+
- ✅ Safari 13+
- ✅ Edge 80+
- ✅ Mobile browsers (iOS Safari, Chrome Mobile)
Note: Geolocation API requires HTTPS in production environments.
- Grant Location Permission: Allow the app to access your location
- Enter Username: Choose a display name for the chat
- Set Distance Range: Adjust how far you want to connect with others
- Start Chatting: Send public messages or start direct conversations
- Customize Notifications: Configure your notification preferences
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Socket.IO for real-time communication
- Vercel for frontend hosting
- Render for backend hosting
- Tailwind CSS for beautiful styling
- React Team for the amazing framework
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed description
- Include browser console errors if applicable
Made with ❤️ for connecting people through proximity and technology