Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thuongtruong1009/zoomer

📱 Connect online with friends anytime. Updating...
https://github.com/thuongtruong1009/zoomer

api cache docker docker-compose echo firebase github-actions go golang gorm javascript minio nextjs nginx postgres redis typescipt typescript webrtc websocket

Last synced: about 3 hours ago
JSON representation

📱 Connect online with friends anytime. Updating...

Awesome Lists containing this project

README

        

ZOOMER

## Preview


signupsignin

## **Technologies**

[Swagger for Go](https://github.com/swaggo/swag)

## **What news**

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

## Architecture

![Architecture](./public/architecture.png)

## Usecase

![Usecase](./public/usecase.png)

## **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](https://www.gnu.org/software/make/) before using **make** command - Not required)

##### 1. Clone this repository

##### 2. Update .env file

##### 3. Install dependencies

```console
make setup
```

##### 3. Run the code

- ##### **With local**

```console
make run
```

- ##### **With Docker**

(Requirement: install [docker](https://docs.docker.com/get-docker/))

```console
make docker-dev
```

##### 4. Testing

```console
make tests
```

##### 5. Linting and Formatting

```console
make lint
```