IrisChat is a real-time, anonymous chat application that pairs users randomly for text-based conversations. I wanted to create something Omegle-like to learn more about WebSockets and build a project that isn't heavily dependent on databases. For now, I'm focusing on the backend. Built with Go (Gorilla WebSocket), it provides a seamless and secure chatting experience.
- Real-Time Messaging: Instant text-based communication between paired users.
- Anonymous Chat: No personal information is required to start chatting.
- Random Pairing: Users are paired randomly in a lobby system.
- WebSocket Support: Efficient and low-latency communication using WebSockets.
- Simple UI: Clean and intuitive user interface built with React and Tailwind CSS.
- Backend: Go (Gorilla WebSocket)
- Real-Time Communication: WebSockets
- Go (v1.20 or higher)
-
Clone the Repository:
git clone https://github.com/whotterre/iris_chat.git cd iris_chat -
Set Up the Backend:
- Navigate to the backend directory:
cd backend - Install dependencies:
go mod download
- Start the server:
go run cmd/main.go
- Navigate to the backend directory:
-
Set Up the Frontend:
- Navigate to the frontend directory:
cd frontend - Install dependencies:
npm install
- Start the development server:
npm start
- Navigate to the frontend directory:
-
Run with Docker (optional):
- Build and run the application using Docker Compose:
docker-compose up --build
- Build and run the application using Docker Compose:
- Open the application in your browser:
http://localhost:3000. - Click "Start Chat" to enter the lobby.
- Wait to be paired with another user.
- Start chatting in real time!
irischat/
├── backend/ # Backend (Go)
│ ├── cmd/ # Entry point for the server
│ ├── internal/ # Application logic
│ │ ├── handlers/ # HTTP and WebSocket handlers
│ │ ├── models/ # Data models (e.g., User, Message, Lobby, Room)
│ │
│ └── go.mod # Go module file
├── frontend/ # Frontend (Vanilla HTML + CSS + JavaScript)
│ ├── assets/ # Static assets
│ ├── index.html
│ |── style.css
└── script.js
├── docker-compose.yml # Docker Compose configuration
└── README.md # Project documentation
-
WebSocket:
ws://localhost:4000/ws- Handles real-time communication between users.
-
Health Check:
GET /health- Returns the server status.
-
Statistics:
GET /stats- Returns the number of active users and rooms.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature. - Commit your changes:
git commit -m 'Add some feature'. - Push to the branch:
git push origin feature/your-feature. - Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- Gorilla WebSocket for WebSocket support.
---