Giter VIP home page Giter VIP logo

hermes's Introduction

Hermes

Hermes is a demo 12 factor app in Go that can be deployed on any cloud native compliant platform as a container. Hermes as the name obviously implies is a messenger that Sends SMS messages to any supported carrier in Rwanda.

Goals

  • Simple sms delivery.
  • Delivery notifications.
  • Implement a simple store(sqlite+litestream) to record access records.
  • Document authentication via pomerium.io.
  • Add application metrics.
  • Build and deploy container imag.
  • Add valid knative deployment manifests

Environment variables

To function Hermes requires a couple of environment variables:

cat .template.env
PORT=8080
PINDO_API_KEY="pindo.io api key"
HERMES_SENDER_IDENTITY="who is sending the message"

This uses https://pindo.io so you'll have to create an account and an API KEY.

Try hermes

To start Hermes on your laptop:

  1. git clone this repository

  2. source the environment variables

cp .template.env .env
# edit the file .env with variables and credentials the source the file
source .env
  1. build the hermes binary
CGO_ENABLED=0 go build -o bin/hermes ./cmd/hermes
# view the output binary
ls bin

For convinience, you could install task a make alternative then:

# it will build your binary and start the hermes server
task run
  1. check hermes version via /api/version
# source .env

curl localhost:$PORT/api/version
  1. send an sms messsage via /api/send
# source .env

# replace with your 078xxxxxxx with your number
export PHONE="your phone"
export MESSAGE="your message"

cat example.json | jq --arg PHONE $PHONE '.recipient=$PHONE' | tee hermes.json
cat hermes.json | jq --arg MESSAGE $MESSAGE '.payload=$MESSAGE' | tee hermes.json

Finally send the payload as defined in hermes.json

curl -d "@hermes.json" -H "Content-Type: application/json" -X POST localhost:$PORT/api/send

There is a notification endpoint api/events/$ID/status you could subscribe to receive sms delivery notications. There is a helping script you could use to run an example:

./scripts/send.sh
  1. You can build a docker image
task image

hermes's People

Contributors

iradukunda1 avatar mergify[bot] avatar nshutijean avatar rugwirobaker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

hermes's Issues

Feature:add unit tests

overview

The only way we currently have to make sure our code works it to task run.
And that may not be fast enough. We nee to add unit tests to all the packages where it's applicable.

approval conditions

  • packages:helmes, api
  • unit test github actiom
  • task to run tests locally
  • test coverage report
  • ci badges

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.