Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oldcorvus/chickochat
real time multi room multi user chat using golang, websocket , mongodb with restful api
https://github.com/oldcorvus/chickochat
chat gin-gonic golang golang-channels gorilla-websocket goroutines mongodb websocket
Last synced: about 1 month ago
JSON representation
real time multi room multi user chat using golang, websocket , mongodb with restful api
- Host: GitHub
- URL: https://github.com/oldcorvus/chickochat
- Owner: oldcorvus
- Created: 2023-02-28T18:57:42.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-07-27T09:05:23.000Z (over 1 year ago)
- Last Synced: 2024-10-12T05:21:56.192Z (about 1 month ago)
- Topics: chat, gin-gonic, golang, golang-channels, gorilla-websocket, goroutines, mongodb, websocket
- Language: Go
- Homepage:
- Size: 17.2 MB
- Stars: 17
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# Chicko Chat
Chicko chat is a real time multi room multi user chat using golang, websocket , mongodb with restful api
[ Sample Front ](https://github.com/younes-nb/chicko-frontend)
## Install ##
All that you need is [Golang](https://golang.org/).
```sh
$ git clone https://github.com/oldcorvus/chicko_chat.git```
```sh
$ go mod tidy```
```sh
$ go build -o chat```
```sh
$ ./chat --mongoURI="mongodb://localhost:27017"```
And navigate to `http://127.0.0.1:8080/`.## Running Locally with Docker
1.build the image:
```sh
$ docker-compose build .
```
2.Spin up the containers```sh
$ docker-compose up
```
And navigate to `http://127.0.0.1:8080/`.## ChatRoom API ##
* `GET /chats/`: to join a room and start chat
* `GET /ws/:roomId/:userId/`: to start a websocket connection* `POST /start/`: register and obtain user id
* `POST /user-rooms/`: ro get user rooms based on user id
* `POST /room-history/`: to retrieve messages of room based on room id
* `POST /add-user-room/`: to register user in room
* `POST /room-user-details/`: to retrieve user data of a room## Test ##
to run tests
Controllers :
```sh
$ cd controllers```
```sh
$ go test```
Database```sh
$ cd database```
```sh
$ go test```