• Stars
    star
    132
  • Rank 274,205 (Top 6 %)
  • Language
    Go
  • License
    MIT License
  • Created over 2 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Go WhatsApp Multi-Device Implementation in REST API with Multi-Session/Account Support

Go WhatsApp Multi-Device Implementation in REST API

This repository contains example of implementation go.mau.fi/whatsmeow package with Multi-Session/Account Support. This example is using a labstack/echo version 4.x.

Features

  • Multi-Session/Account Support
  • Multi-Device Support
  • WhatsApp Authentication (QR Code and Logout)
  • WhatsApp Messaging Send Text
  • WhatsApp Messaging Send Media (Document, Image, Audio, Video, Sticker)
  • WhatsApp Messaging Send Location
  • WhatsApp Messaging Send Contact
  • WhatsApp Messaging Send Link
  • And Much More ...

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment section for notes on how to deploy the project on a live system.

Prerequisites

Prequisites packages:

  • Go (Go Programming Language)
  • Swag (Go Annotations Converter to Swagger Documentation)
  • GoReleaser (Go Automated Binaries Build)
  • Make (Automated Execution using Makefile)

Optional packages:

  • Docker (Application Containerization)

Deployment

Using Container

  1. Install Docker CE based on the manual documentation

  2. Run the following command on your Terminal or PowerShell

docker run -d \
  -p 3000:3000 \
  --name go-whatsapp-multidevice \
  --rm dimaskiddo/go-whatsapp-multidevice-rest:latest
  1. Now it should be accessible in your machine by accessing localhost:3000/api/v1/whatsapp or 127.0.0.1:3000/api/v1/whatsapp

  2. Try to use integrated API docs that accesible in localhost:3000/api/v1/whatsapp/docs/ or 127.0.0.1:3000/api/v1/whatsapp/docs/

Using Pre-Build Binaries

  1. Download Pre-Build Binaries from the release page

  2. Extract the zipped file

  3. Copy the .env.default file as .env file

  4. Run the pre-build binary

# MacOS / Linux
chmod 755 go-whatsapp-multidevice-rest
./go-whatsapp-multidevice-rest

# Windows
# You can double click it or using PowerShell
.\go-whatsapp-multidevice-rest.exe
  1. Now it should be accessible in your machine by accessing localhost:3000/api/v1/whatsapp or 127.0.0.1:3000/api/v1/whatsapp

  2. Try to use integrated API docs that accesible in localhost:3000/api/v1/whatsapp/docs/ or 127.0.0.1:3000/api/v1/whatsapp/docs/

Build From Source

Below is the instructions to make this source code running:

  1. Create a Go Workspace directory and export it as the extended GOPATH directory
cd <your_go_workspace_directory>
export GOPATH=$GOPATH:"`pwd`"
  1. Under the Go Workspace directory create a source directory
mkdir -p src/github.com/dimaskiddo/go-whatsapp-multidevice-rest
  1. Move to the created directory and pull codebase
cd src/github.com/dimaskiddo/go-whatsapp-multidevice-rest
git clone -b master https://github.com/dimaskiddo/go-whatsapp-multidevice-rest.git .
  1. Run following command to pull vendor packages
make vendor
  1. Link or copy environment variables file
ln -sf .env.development .env
# - OR -
cp .env.development .env
  1. Until this step you already can run this code by using this command
make run
  1. (Optional) Use following command to build this code into binary spesific platform
make build
  1. (Optional) To make mass binaries distribution you can use following command
make release
  1. Now it should be accessible in your machine by accessing localhost:3000/api/v1/whatsapp or 127.0.0.1:3000/api/v1/whatsapp

  2. Try to use integrated API docs that accesible in localhost:3000/api/v1/whatsapp/docs/ or 127.0.0.1:3000/api/v1/whatsapp/docs/

API Access

You can access any endpoint under HTTP_BASE_URL environment variable which by default located at .env file.

Integrated API Documentation can be accessed in <HTTP_BASE_URL>/docs/ or by default it's in localhost:3000/api/v1/whatsapp/docs/ or 127.0.0.1:3000/api/v1/whatsapp/docs/

Running The Tests

Currently the test is not ready yet :)

Built With

  • Go - Go Programming Languange
  • Swag - Go Annotations Converter to Swagger Documentation
  • GoReleaser - Go Automated Binaries Build
  • Make - GNU Make Automated Execution
  • Docker - Application Containerization

Authors

  • Dimas Restu Hidayanto - Initial Work - DimasKiddo

See also the list of contributors who participated in this project

Annotation

You can seek more information for the make command parameters in the Makefile

License

Copyright (C) 2022 Dimas Restu Hidayanto

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

go-whatsapp-rest

Go WhatsApp Implementation in REST API
Go
130
star
2

codebase-go-rest

Codebase for REST API in Go
Go
13
star
3

go-whatsapp-multidevice-gpt

Go WhatsApp Multi-Device Implementation as ChatGPT Bot
Go
11
star
4

codebase-nodejs-rest

Codebase for REST API in NodeJS
JavaScript
10
star
5

go-whatsapp-cli

Go WhatsApp Implementation in Command-Line Interface (CLI)
Go
8
star
6

openshift-templates

OpenShift Custom Catalog Templates
6
star
7

codebase-go-rest-lite

Codebase for REST API in Go (Lite)
Go
6
star
8

docker-registry-stack

An Internal or Private Container Registry Stack using Docker-Compose
5
star
9

terraform-proxmox

Terraform Proxmox Template
HCL
5
star
10

ethereum-explorer

Ethereum Blockchain Explorer
HTML
4
star
11

go-cron

Go-Cron an Alternative Cron Binaries for Containers
Go
4
star
12

docker-php-template

Docker for PHP Deployment Template
Shell
2
star
13

simple-py

Simple Python Programming Example
Python
2
star
14

docker-planka-stack

An Internal or Private Planka for Kanban Board Stack using Docker-Compose
1
star
15

helm-chart

Helm Chart Collection
1
star
16

ansible-datadog-agent

Ansible Playbook to Deploy Datadog Agent
Jinja
1
star
17

example-springboot-rest

Example of using SpringBoot for REST API
Java
1
star
18

socket.io-nodejs-chat

Socket.IO NodeJS Chat
HTML
1
star
19

ansible-sanoid

Ansible Playbook to Deploy ZFS Sanoid/Syncoid for Auto-Snapshot
HTML
1
star
20

terraform-gitlab

Terraform GitLab Template
HCL
1
star
21

ansible-galera-percona

Ansible Playbook to Deploy Percona MySQL Galera Cluster
Shell
1
star
22

ansible-zfs

Ansible Playbook to Deploy ZFS Storage
Shell
1
star
23

codebase-go-cli

Codebase for Command-Line Interface (CLI) Application in Go
Go
1
star
24

openshift-node-shell

OpenShift 3 Node Shell
Shell
1
star
25

dimaskiddo

Hey it's about me @dimaskiddo!
1
star
26

angka-terbilang-nodejs

NodeJS package for Converting Decimal to an Indonesian Wording format
JavaScript
1
star
27

ansible-mongo-percona

Ansible Playbook to Deploy Percona MongoDB Cluster
HTML
1
star
28

terraform-vsphere

Terraform vSphere Template
HCL
1
star
29

simple-go

Simple Go Programming Example
Go
1
star
30

ansible-k3s

Ansible Playbook to Deploy K3S Cluster
Jinja
1
star
31

ansible-elasticsearch

Ansible Playbook to Deploy ElasticSearch Single-Node or Cluster
Jinja
1
star
32

ansible-swap-file

Ansible Playbook to Enable Swap File
1
star