The Collaboration Project is a real-time web application that allows users to connect and communicate through a WebSocket server. It provides a simple API for user management and supports CORS for cross-origin requests. This project is built using Go and follows a microservices architecture.
- Real-time communication using WebSockets
- User management API
- CORS support for specified origins
- In-memory storage for user data
- Modular architecture for easy maintenance and scalability
- Go (version 1.23.0)
- Gorilla WebSocket
- Go Kit for microservices
- UUID for unique identifiers
- Go installed on your machine (version 1.23.0 or higher)
- Git for version control
-
Clone the repository:
git clone https://github.com/piyushpradhan/experiment-collaboration.git cd collaboration -
Install dependencies:
go mod tidy
To run the application, use the following command:
go run main.goThe server will start on port 5000 by default. You can change the port by modifying the listenAddr flag.
- GET /user: Retrieve user information by ID.
- DELETE /user/id: Delete a user by ID.
To connect to the WebSocket server, use the following URL:
ws://localhost:5000/
.
├── api
│ ├── decode.go
│ ├── endpoint.go
│ ├── server.go
│ ├── service.go
│ └── transport.go
├── cmd
│ ├── api
│ │ └── main.go
│ └── collaboration
│ └── main.go
├── services
│ ├── api
│ │ ├── middleware.go
│ │ └── transport.go
│ └── collaboration
│ ├── endpoint.go
│ ├── service
│ │ └── service.go
│ └── transport.go
├── storage
│ └── memory.go
├── types
│ ├── client.go
│ ├── message.go
│ └── user.go
└── util
└── util.go
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.
- Thanks to the Go community for their support and resources.
- Inspired by various open-source projects and microservices architecture principles. VB