can run all cli commands from bin or from source
Example
go run cmd/server/main.go
or ./bin/client
go run cmd/client/main.go --address=localhost:50051 --user=Alice --op=connect
or ./bin/client --address=localhost:50051 --user=Alice --op=connect
go run cmd/server/main.go
go run cmd/client/main.go --address=localhost:50051 --user=Alice --op=connect
go run cmd/client/main.go --address=localhost:50051 --user=Alice --op=create --target=CoolChat --type=GROUP
go run cmd/client/main.go --address=localhost:50051 --user=Alice --op=join --target=CoolChat
go run cmd/client/main.go --address=localhost:50051 --user=Alice --op=send --target=CoolChat --type=GROUP --msg="Hello everyone in CoolChat!"
go run cmd/client/main.go --address=localhost:50051 --user=Alice --op=list
go run cmd/client/main.go --address=localhost:50051 --user=Alice --op=leave --target=CoolChat
go run cmd/server/main.go
go run cmd/client/main.go --address=localhost:50051 --user=Alice --op=connect
go run cmd/client/main.go --address=localhost:50051 --user=Bob --op=connect
Create group as Alice
go run cmd/client/main.go --address=localhost:50051 --user=Alice --op=create --target=CoolChat --type=GROUP
Sent message as Alice
go run cmd/client/main.go --address=localhost:50051 --user=Alice --op=send --target=CoolChat --type=GROUP --msg="Hello everyone in Cool"
join group as Bob
go run cmd/client/main.go --address=localhost:50051 --user=Bob --op=join --target=CoolChat
in tab 3 Bob get all history messages
join group as Bob
go run cmd/client/main.go --address=localhost:50051 --user=Bob --op=join --target=CoolChat
Sent message as Alice
go run cmd/client/main.go --address=localhost:50051 --user=Alice --op=send --target=CoolChat --type=GROUP --msg="Hello everyone in Cool"
in tab 2 and in tab 3 all participants( Bob and Alice ), got message.
go run cmd/client/main.go --address=localhost:50051 --user=Alice --op=list
show list of all channels
go run cmd/client/main.go --address=localhost:50051 --user=Alice --op=send --target=Bob --type=USER --msg="Hello Bob"
message appeared to Bob connect(tab 3) tab.
go run cmd/client/main.go --address=localhost:50051 --user=Alice --op=send --target=Wally --type=USER --msg="Hello Bob"
rpc error: code = Unknown desc = user Wally doesn't exist
go run cmd/client/main.go --address=localhost:50051 --user=Alice --op=list
go run cmd/client/main.go --address=localhost:50051 --user=Alice --op=leave --target=CoolChat
go run cmd/client/main.go --address=localhost:50051 --user=Alice --op=list
Since I only have one day to develop and implementation rules are limited then the implementation turned out to be more for familiarization and presentation than for use in production.
Also dont have time for tests.
It doesn't handle several real-world scenarios, such as:
- Authentication of users
- Dockerization
- Persistence of data
- Proper error codes for gRPC responses
- More advanced concurrency and channel management (e.g., using context for cancellation)
- Monitoring
- Reconnection logic for clients
- Efficient broadcasting algorithms, especially for large-scale systems