zygo

command module
v0.0.0-...-814efbb Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: MIT Imports: 13 Imported by: 0

README

Introduction

A multipurpose backend server api to send mail, text, slack, push, telegram etc. developed in Go

Design Goals

  • Should be Simple and Easy to build hence Go programming language is selected
  • Deployment shouod be xcopy and cross platform, Go meets this out of the box
  • Should be serverless lambdas function but should impose any AWS or Azure style coding. Apex Gateway solves this.
  • CI/CD should be out of the box without writing any code like Github actions, Lambda deployment etc. Netlify takes care of this
  • Log analysis and debug capabilities - suppoered using custom Go logger which Netlify exposes thru GUI.
  • Maintenance cost should be $0. Yes, everything should be Free
Pre-requisites
  • Should have Go installed in your local development environment
  • Optional netlify account to deploy the golang api's as serverless functions
  • Optional netlify CLI
  • Optional if you want to send HTML formatted email using mailgun template. I used Maizzle to build HTML emails with Tailwind CSS https://maizzle.com/
  • mailgun account as the notify (sendmail) api is built using mailgun
  • VSCode Editor or Gitpod online VSCode editor 50 hours per month free plan
Local Development

Clone repository.

git clone https://github.com/senthilsweb/zygo.git

Local build (Mac OS)

go build

Local Run

./zygo -p "3000"
Available REST API Endpoints

The following APIs implemented and readily available to use in your projects

https://zybes.netlify.app/api

Request Endpoints Functionality
POST https://zybes.netlify.app/api/notify/mailgun Send email
GET https://zybes.netlify.app/api/ping Health check

Payload for https://zybes.netlify.app/api/notify/mailgun

{
    "message": {
        "subject": "This is subject",
        "body": "This is body",
        "template": "welcome_email",
        "recipient": "name <your email@gmail.com>",
        "payload": {"name":"John Smith"}
    },
    "MAILGUN_DOMAIN": "your domain",
    "MAILGUN_KEY": "your key",
    "EMAIL_SENDER": "Mailgun Sandbox <your sender>"
}
Netlify Deployment

Refer the following documentaion and blog post to host the server (and optional Single Page Application) at Netlify

Key Frameworks and Libraries used
  • github.com/apex/gateway
  • github.com/gin-gonic/gin
  • github.com/mailgun/mailgun-go/v4
  • github.com/sirupsen/logrus
  • github.com/spf13/viper
  • github.com/tidwall/gjson

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
cetak
Package cetak helps you generate Word document (.docx) from a template.
Package cetak helps you generate Word document (.docx) from a template.

Jump to

Keyboard shortcuts

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