gonotify

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2020 License: MIT

README

gonotify

A web service that lets you send yourself WhatsApp messages serving as notifications

Demo: https://gonotify.xyz

The basic idea is to provide the user with a service that he/she can use to send himself WhatsApp messages programmatically without much hassle. With GoNotify you can create groups of various numbers and send messages to the group with just a simple API call. I have explained the idea in detail in a dev.to post.

Installation

  • You would need go to build the binary.
  • The WebUI is built using ReactJS, and we use yarn as package manager. So you would need node and yarn too.
  • Run make build in project root. This will build a binary at build/gonotify

Configuration

  • gonotify requires a configuration file to start. You can use the -c flag to pass a path for the config file.
  • By default gonotify uses config/config.yml.
  • A sample config file is provided in config/config.example.yml. Edit the file according to your needs.

Features

  • Add and verify your Phone numbers once.
  • Create multiple groups with your phone numbers.
  • Send notification to all numbers in a group.
  • Use the API to do all of this programmatically.

Usage

Concepts
  • Number: You can add multiple Phone numbers to your account. You need to verify each phone number once.
  • Group: A group is a collection of phone numbers. The notifications are always targeted towards a Group.
Example API usage

The examples use HTTPie as client.

GoNotify server issues JWT token on successfull authentication. Authorization header is used to supply the token to the backend. The Authorization header's value must be in the form of Bearer <jwt token>.

Login
$ http :8080/api/v1/login phone="9912312345" password="password"

Response:

{
  "message": "login successful",
  "token": "eyJhbGciOiJIUjhggdgnR5cCI6IkpXVCJ9.eyJleHjkgJFgfhvj3ODcsImlkIjoyfQ.TsxdOsxf0cOt5cNNSgOx5CH4oxxtGogPKcA0XPPyhnTaKhc4xpmcsJV_GY56bkghfhgdh0jO1TtSolOw8GT3TGtQyA"
}
Send a message
$ http :8080/api/v1/send authorization:"Bearer eyJhbGciOiJIUjhggdgnR5cCI6IkpXVCJ9.eyJleHjkgJFgfhvj3OgggttmlkIjoyfQ.TsxdOsxf0cOt5cNNSgOx5CH4oxxtGogPKcA0XPPyhnTaKhc4xpmcsJV_GY56bkghfhgdh0jO1TtSolOw8GT3TjghyyA" body="test message" group="default"

Response:

{
  "message": "Message sent successfully"
}

Roadmap

  • A CLI to easiliy access the API. (In Progress)
  • Expand to services other than WhatsApp (SMS, Telegram, Slack, Email etc.).

Contributing

Any kind of contributions are welcome!

Directories

Path Synopsis
cmd
pkg
api
ui
Package ui generated by go-bindata.// sources: pkg/ui/react-app/build/asset-manifest.json pkg/ui/react-app/build/favicon.ico pkg/ui/react-app/build/index.html pkg/ui/react-app/build/logo192.png pkg/ui/react-app/build/logo512.png pkg/ui/react-app/build/manifest.json pkg/ui/react-app/build/precache-manifest.e60339b7d0bb5c9e4d92662fe145e16c.js pkg/ui/react-app/build/robots.txt pkg/ui/react-app/build/service-worker.js pkg/ui/react-app/build/static/css/main.0087f701.chunk.css pkg/ui/react-app/build/static/css/main.0087f701.chunk.css.map pkg/ui/react-app/build/static/js/2.8ca1028c.chunk.js pkg/ui/react-app/build/static/js/2.8ca1028c.chunk.js.LICENSE.txt pkg/ui/react-app/build/static/js/2.8ca1028c.chunk.js.map pkg/ui/react-app/build/static/js/main.7083e38d.chunk.js pkg/ui/react-app/build/static/js/main.7083e38d.chunk.js.map pkg/ui/react-app/build/static/js/runtime-main.d7a593f2.js pkg/ui/react-app/build/static/js/runtime-main.d7a593f2.js.map pkg/ui/react-app/build/static/media/acc.e3e71027.svg pkg/ui/react-app/build/static/media/arrow.81cc87b4.svg pkg/ui/react-app/build/static/media/group.f18a9b52.svg pkg/ui/react-app/build/static/media/help.4d334602.svg pkg/ui/react-app/build/static/media/hero.c2670c54.svg pkg/ui/react-app/build/static/media/logo.44a387c9.svg pkg/ui/react-app/build/static/media/member.b416abfb.svg pkg/ui/react-app/build/static/media/mono.33b177c1.svg pkg/ui/react-app/build/static/media/notif.d3655146.svg pkg/ui/react-app/build/static/media/picasso.cd7f8f07.svg pkg/ui/react-app/build/static/media/plus.cdd684f4.svg pkg/ui/react-app/build/static/media/send.5cf728ae.svg pkg/ui/react-app/build/static/media/settings.11849f3a.svg pkg/ui/react-app/build/static/media/trash.a9e23ca0.svg
Package ui generated by go-bindata.// sources: pkg/ui/react-app/build/asset-manifest.json pkg/ui/react-app/build/favicon.ico pkg/ui/react-app/build/index.html pkg/ui/react-app/build/logo192.png pkg/ui/react-app/build/logo512.png pkg/ui/react-app/build/manifest.json pkg/ui/react-app/build/precache-manifest.e60339b7d0bb5c9e4d92662fe145e16c.js pkg/ui/react-app/build/robots.txt pkg/ui/react-app/build/service-worker.js pkg/ui/react-app/build/static/css/main.0087f701.chunk.css pkg/ui/react-app/build/static/css/main.0087f701.chunk.css.map pkg/ui/react-app/build/static/js/2.8ca1028c.chunk.js pkg/ui/react-app/build/static/js/2.8ca1028c.chunk.js.LICENSE.txt pkg/ui/react-app/build/static/js/2.8ca1028c.chunk.js.map pkg/ui/react-app/build/static/js/main.7083e38d.chunk.js pkg/ui/react-app/build/static/js/main.7083e38d.chunk.js.map pkg/ui/react-app/build/static/js/runtime-main.d7a593f2.js pkg/ui/react-app/build/static/js/runtime-main.d7a593f2.js.map pkg/ui/react-app/build/static/media/acc.e3e71027.svg pkg/ui/react-app/build/static/media/arrow.81cc87b4.svg pkg/ui/react-app/build/static/media/group.f18a9b52.svg pkg/ui/react-app/build/static/media/help.4d334602.svg pkg/ui/react-app/build/static/media/hero.c2670c54.svg pkg/ui/react-app/build/static/media/logo.44a387c9.svg pkg/ui/react-app/build/static/media/member.b416abfb.svg pkg/ui/react-app/build/static/media/mono.33b177c1.svg pkg/ui/react-app/build/static/media/notif.d3655146.svg pkg/ui/react-app/build/static/media/picasso.cd7f8f07.svg pkg/ui/react-app/build/static/media/plus.cdd684f4.svg pkg/ui/react-app/build/static/media/send.5cf728ae.svg pkg/ui/react-app/build/static/media/settings.11849f3a.svg pkg/ui/react-app/build/static/media/trash.a9e23ca0.svg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL