A modern, real-time messaging web application built with Node.js, Express, Socket.io, and TailwindCSS.
- PIN-based Authentication: Users must enter PIN
190125to access the chat - Anonymous Sessions: Each user gets a unique anonymous identifier (e.g., "User#1234")
- Secure Session Management: Sessions persist for 24 hours
- WebSocket Integration: Real-time message synchronization using Socket.io
- Live Typing Indicators: See when other users are typing
- Online Status: Real-time online user count and status
- Message Delivery Confirmation: Track message delivery status
- Modern Design: Clean, intuitive interface using TailwindCSS
- Fully Responsive: Optimized for desktop and mobile devices
- Material Design: Modern UI components and animations
- Touch-friendly: Optimized for mobile interactions
- Single Public Channel: All users communicate in one shared space
- Message Timestamps: Display when messages were sent
- Auto-cleanup: Messages are automatically deleted after 24 hours
- Cross-browser Compatibility: Works on all modern browsers
- Progressive Web App: Native-like experience on mobile
- Adaptive Layout: Responsive design for all screen sizes
- Touch Interactions: Optimized for touch devices
- Performance: Fast loading and smooth animations
- Node.js (v14 or higher)
- npm or yarn
-
Clone the repository
git clone <repository-url> cd mapp
-
Install dependencies
npm install
-
Start the development server
npm run dev
-
Access the application
- Open your browser and navigate to
http://localhost:3000 - Enter PIN:
190125 - Start messaging!
- Open your browser and navigate to
-
Install dependencies
npm install --production
-
Set environment variables (optional)
export PORT=3000 export NODE_ENV=production
-
Start the server
npm start
POST /api/verify-pin- Verify PIN and create sessionGET /api/session- Check current session status
GET /api/messages- Get recent messages (last 24 hours)
authenticate- Authenticate user with Socket.iosendMessage- Send a new messagetyping- Send typing indicator
newMessage- Receive new messageuserJoined- User joined notificationuserLeft- User left notificationonlineUsers- List of online usersuserTyping- Typing indicator from other usersmessageDelivered- Message delivery confirmation
- Node.js - Runtime environment
- Express.js - Web framework
- Socket.io - Real-time communication
- Express-session - Session management
- CORS - Cross-origin resource sharing
- Vanilla JavaScript - No framework dependencies
- TailwindCSS - Utility-first CSS framework
- Font Awesome - Icons
- Socket.io Client - Real-time communication
- In-memory Storage - Messages stored in memory (for demo)
- Session Storage - User sessions with cookies
- Auto-cleanup - Messages automatically deleted after 24 hours
- PIN Authentication - Required for access
- Session Management - Secure session handling
- Input Sanitization - XSS protection
- CORS Configuration - Cross-origin security
- Anonymous Users - No personal data collection
- Efficient Message Loading - Only recent messages loaded
- Auto-cleanup - Automatic message deletion
- Optimized Animations - Smooth CSS transitions
- Mobile Optimization - Touch-friendly interface
- Lazy Loading - Efficient resource management
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Mobile browsers (iOS Safari, Chrome Mobile)
mapp/
├── server.js # Main server file
├── package.json # Dependencies and scripts
├── public/ # Static files
│ ├── index.html # Main HTML file
│ └── app.js # Frontend JavaScript
├── README.md # This file
└── .gitignore # Git ignore rules
npm start- Start production servernpm run dev- Start development server with nodemon
- Set up your server with Node.js
- Clone the repository to your server
- Install dependencies:
npm install --production - Configure your web server (nginx/Apache) to proxy to port 3000
- Set up SSL for HTTPS
- Start the application:
npm start
PORT- Server port (default: 3000)NODE_ENV- Environment (development/production)
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - see LICENSE file for details
For issues and questions, please create an issue in the repository.
Built with ❤️ for real-time communication