A simple, elegant real-time chatroom application built with Node.js and Socket.IO. Create private rooms with unique codes and chat with friends in a minimal, dark-themed interface.
- Create Rooms: Generate private chatrooms with unique 6-character codes
- Join Rooms: Enter any room using its code to join the conversation
- Leave Rooms: Easily switch between different rooms
- Room Isolation: Messages are only visible to users in the same room
- Instant Delivery: Messages appear immediately for all room participants
- User Presence: See when users join or leave your room
- Online Counter: Live count of active users in each room
- Message Timestamps: Every message shows when it was sent
- Minimal Design: Clean, distraction-free black theme
- No Registration: Just pick a username and start chatting
- Mobile Responsive: Works seamlessly on desktop and mobile devices
- Intuitive Navigation: Simple flow from username → room selection → chat
- Auto-reconnection: Handles network interruptions gracefully
- Input Validation: Username (20 chars) and message (500 chars) limits
- XSS Protection: Messages are safely escaped to prevent code injection
- Room Cleanup: Empty rooms are automatically deleted
- Node.js (v14 or higher)
- npm
-
Clone the repository
git clone https://github.com/nickxcii/gochat.git cd gochat
-
Install dependencies
npm install
-
Start the server
npm start
-
Open your browser Navigate to
http://localhost:3000
- Enter your username
- Click "Create Room"
- Optionally enter a custom room name
- Share the generated room code with friends
- Enter your username
- Enter the 6-character room code
- Click "Join Room"
- Start chatting!
- Room codes are 6 characters long (e.g.,
ABC123
) - They contain uppercase letters and numbers
- Each code is unique and automatically generated
- Codes are case-insensitive when entering
gochat/
├── server.js # Express + Socket.IO server
├── package.json # Dependencies and scripts
├── public/
│ ├── index.html # Main HTML interface
│ ├── style.css # Minimal dark theme styles
│ └── script.js # Client-side Socket.IO logic
└── README.md # This file
create-room
- Create a new chatroomjoin-room
- Join an existing room by codemessage
- Send a chat messageleave-room
- Leave the current room
room-created
- Room successfully createdroom-joined
- Successfully joined a roomroom-error
- Error joining room (invalid code)message
- Incoming chat messageuser-joined
- User joined the roomuser-left
- User left the roomuser-count
- Updated count of online users
- Friend Groups: Create private rooms for casual conversations
- Study Groups: Collaborate on projects with dedicated chat rooms
- Gaming: Coordinate with teammates in private channels
- Events: Set up temporary chat rooms for specific occasions
- Teams: Quick communication without account setup
- No Data Storage: Messages are not saved to any database
- Temporary Rooms: Rooms are deleted when all users leave
- No Personal Info: Only usernames are required (no email/phone)
- Local Hosting: Run on your own server for complete privacy
GoChat works on all modern browsers:
- ✅ Chrome/Chromium
- ✅ Firefox
- ✅ Safari
- ✅ Edge
- ✅ Mobile browsers (iOS Safari, Chrome Mobile)
- Backend: Node.js with Express.js framework
- Real-time: Socket.IO for WebSocket communication
- Frontend: Vanilla JavaScript (no frameworks)
- Styling: Pure CSS with CSS Grid/Flexbox
- Port: Default port 3000 (configurable via PORT env variable)
- Responsive design adapts to all screen sizes
- Touch-friendly buttons and inputs
- Optimized chat interface for mobile typing
- Swipe-friendly navigation
PORT=8080 npm start
Edit the generateRoomCode()
function in server.js
:
for (let i = 0; i < 6; i++) { // Change 6 to desired length
Edit public/style.css
to change colors, fonts, or layout.
- 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 ISC License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue if your problem isn't already reported
- Provide clear steps to reproduce any bugs
Made with ❤️ using Node.js and Socket.IO
GoChat - Simple, private, real-time chat rooms for everyone.