You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Dimas Restu H 3c74f4793d update README.md for proper reading 4 years ago
.vscode base skeleton using echo v4 4 years ago
cmd/main wip integrated swagger docs 4 years ago
dbs construct base function for whatsapp multidevice 4 years ago
docs added view once parameter to send image or video 4 years ago
internal add capabilites to convert, compress, and set thumbnail when sending image 4 years ago
pkg update README.md for proper reading 4 years ago
.dockerignore construct base function for whatsapp multidevice 4 years ago
.env.default add capabilites to convert, compress, and set thumbnail when sending image 4 years ago
.env.development add capabilites to convert, compress, and set thumbnail when sending image 4 years ago
.env.production add capabilites to convert, compress, and set thumbnail when sending image 4 years ago
.gitignore construct base function for whatsapp multidevice 4 years ago
.goreleaser.yml update build configuration for goreleaser and docker 4 years ago
Dockerfile update Dockerfile final image to use alpine base 4 years ago
Makefile update make gen-docs individually executed 4 years ago
README.md update README.md for proper reading 4 years ago
go.mod add capabilites to convert, compress, and set thumbnail when sending image 4 years ago
go.sum add capabilites to convert, compress, and set thumbnail when sending image 4 years ago

README.md

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.

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