# Go WhatsApp Multi-Device Implementation in REST API
# Go WhatsApp Multi-Device Implementation in REST API
This repository contains example of implementation [go.mau.fi/whatsmeow](https://go.mau.fi/whatsmeow/) package. This example is using a [labstack/echo](https://github.com/labstack/echo) version 4.x.
This repository contains example of implementation [go.mau.fi/whatsmeow](https://go.mau.fi/whatsmeow/) package with Multi-Session/Account Support. This example is using a [labstack/echo](https://github.com/labstack/echo) version 4.x.
## Getting Started
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
See deployment for notes on how to deploy the project on a live system.
See deployment section for notes on how to deploy the project on a live system.
### Prerequisites
### Prerequisites
Prequisites package:
Prequisites packages:
* Go (Go Programming Language)
* Go (Go Programming Language)
* Swag (Go Annotations Converter to Swagger Documentation)
* GoReleaser (Go Automated Binaries Build)
* Make (Automated Execution using Makefile)
* Make (Automated Execution using Makefile)
Optional package:
* GoReleaser (Go Automated Binaries Build)
Optional packages:
* Docker (Application Containerization)
* Docker (Application Containerization)
### Installing
### Deployment
#### **Using Container**
1) Install Docker CE based on the [manual documentation](https://docs.docker.com/desktop/)
2) Run the following command on your Terminal or PowerShell
* Run following command to pull dependecies package
```
4) Run following command to pull vendor packages
```sh
make vendor
make vendor
```
```
* Until this step you already can run this code by using this command
```
5) Link or copy environment variables file
```sh
ln -sf .env.development .env
ln -sf .env.development .env
make run
# - OR -
cp .env.development .env
```
```
## Running The Tests
Currently the test is not ready yet :)
## Deployment
6) Until this step you already can run this code by using this command
```sh
make run
```
To build this code to binaries for distribution purposes you can run following command:
7) *(Optional)* Use following command to build this code into binary spesific platform
```sh
make build
```
```
8) *(Optional)* To make mass binaries distribution you can use following command
```sh
make release
make release
```
```
The build result will shown in build directory
9) Now it should be accessible in your machine by accessing `localhost:3000/api/v1/whatsapp` or `127.0.0.1:3000/api/v1/whatsapp`
10) 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
## API Access
You can access any endpoint under **BASE_URL** environment variable which by default located at *.env* file.
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/`
Integrated API Documentation can be accessed in **BASE_URL**/docs/index.html or by default it's in `127.0.0.1:3000/api/v1/whatsapp/docs/index.html`
## Running The Tests
Currently the test is not ready yet :)
## Built With
## Built With
* [Go](https://golang.org/) - Go Programming Languange
* [Go](https://golang.org/) - Go Programming Languange
* [Swag](https://github.com/swaggo/swag) - Go Annotations Converter to Swagger Documentation
* [GoReleaser](https://github.com/goreleaser/goreleaser) - Go Automated Binaries Build
* [GoReleaser](https://github.com/goreleaser/goreleaser) - Go Automated Binaries Build
* [Make](https://www.gnu.org/software/make/) - GNU Make Automated Execution
* [Make](https://www.gnu.org/software/make/) - GNU Make Automated Execution