Skip to content

thuongtruong1009/zoomer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

ZOOMER

Preview

signupsignin

Technologies

Swagger for Go

What news

  • Support JWT
  • Limit rooms per user in a day
  • Users can signup and login
  • The only way the user can message have to know the receiver user name.
  • Users can access their chat history.
  • Users can block each other
  • Dockerize
  • Support Redis cache
  • Support Peer connection
  • Support Swagger document
  • Support file upload/download
  • Testing
  • Support video call
  • Logging
  • Send email service
  • Support MessageQueue
  • Support OAuth2
  • Support notification
  • Add role/permission based validation
  • Implement more new features

Architecture

Architecture

Usecase

Usecase

Realtime Chat

  • First, we have the hub running on a separate goroutine which is the central place that manages different channels and contains a map of rooms. The hub has a Register and an Unregister channel to register/unregister clients, and a Broadcast channel that receives a message and broadcasts it out to all the other clients in the same room.

A room is initially empty. Only when a client hits the /chats/joinRoom endpoint, that will create a new client object in the room and it will be registered through the hub's Register channel.

Each client has a writeMessage and a readMessage method. readMessage reads the message through the client's websocket connection and send the message to the Broadcast channel in the hub, which will then broadcast the message out to every client in the same room. The writeMessage method in each of those clients will write the message to its websocket connection, which will be handled on the frontend side to display the messages accordingly.

How to run the code locally

(Recommend: install make before using make command - Not required)

1. Clone this repository
2. Update .env file
3. Install dependencies
make setup
3. Run the code
  • With local
make run
  • With Docker

(Requirement: install docker)

make docker-dev
4. Testing
make tests
5. Linting and Formatting
make lint