Skip to content

Latest commit

 

History

History
78 lines (52 loc) · 1.23 KB

README.MD

File metadata and controls

78 lines (52 loc) · 1.23 KB

Chicko Chat

Chicko chat is a real time multi room multi user chat using golang, websocket , mongodb with restful api

Sample Front

Install

All that you need is Golang.

 $ git clone https://github.com/oldcorvus/chicko_chat.git
$ go mod tidy
$ go build -o chat 
$ ./chat --mongoURI="mongodb://localhost:27017"

And navigate to http://127.0.0.1:8080/.

Running Locally with Docker

1.build the image:

  $ docker-compose build .

2.Spin up the containers

  $ 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 :

 $ cd controllers 
$ go test

Database

 $ cd database 
$ go test