A simple real-time web chat application built with Node.js, Express, and Socket.IO.
- Real-time messaging using WebSocket connections
- Single chat room for all users
- Random nicknames assigned to each user
- Random colors for usernames
- Dark mode interface
- Mobile-friendly responsive design
- Typing indicators to show when users are typing
- User count display
- Connection status notifications
- Backend: Node.js, Express.js, Socket.IO
- Frontend: HTML5, CSS3, JavaScript (ES6+)
- Real-time Communication: WebSockets via Socket.IO
- Clone or download this repository
- Navigate to the project directory:
cd FlanerieChat - Install dependencies:
npm install
-
Start the server:
npm start
Or for development with auto-restart:
npm run dev
-
Open your browser and navigate to:
http://localhost:3000 -
Start chatting! Each user gets a random nickname and color automatically.
- Express.js web server serving static files
- Socket.IO for real-time WebSocket communication
- Random nickname generation (e.g., "CoolTiger123")
- Random color assignment for usernames
- User connection/disconnection handling
- Message broadcasting to all connected users
- Typing indicator support
- Clean, modern dark theme interface
- Mobile-responsive design
- Real-time message display
- Typing indicators
- Connection status notifications
- Automatic scrolling to latest messages
- Message timestamps
- User count display
FlanerieChat/
├── server.js # Main server file
├── package.json # Project dependencies and scripts
├── public/
│ ├── index.html # Main HTML page
│ ├── styles.css # CSS styling
│ └── script.js # Client-side JavaScript
└── README.md # This file
The server runs on port 3000 by default. You can change this by setting the PORT environment variable:
PORT=8080 npm startThis application works on all modern browsers that support:
- WebSockets
- ES6+ JavaScript
- CSS Grid and Flexbox
- CSS Custom Properties (variables)
To run in development mode with automatic server restart:
npm run devThis uses nodemon to restart the server automatically when files change.
For production deployment:
- Set the
NODE_ENVenvironment variable toproduction - Ensure all dependencies are installed
- Start the server with
npm start - Configure your reverse proxy (nginx, Apache) if needed
- Set up SSL/HTTPS for secure WebSocket connections
Feel free to submit issues and enhancement requests!
This project is licensed under the GNU GPL v3