Skip to content
/ glific Public
forked from glific/glific

The Main application that provides the core interface via the glific APIs

License

Notifications You must be signed in to change notification settings

architv/glific

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Glific - Two Way Open Source Communication Platform

License: AGPL v3 Code coverage badge Glific on hex.pm GitHub issues Discord codebeat badge Commits Glific

Packages Needed

Install the following packages using your favorite package manager. Links are provided for some

  • Install Elixir (check package versions below)
    1. For Ubuntu users you also need to install the inotify-tools package
  • Install Postgres
    1. For Postgres, for the development server, we default to using postgres/postgres as the username/password. This is configurable

Package Versions

Glific is currently developed and hosted on the following platforms. Our goal is to always try and use the latest versions of each platform as soon as feasible (i.e. once the ecosystem of packages we used have upgraded). We do not have the bandwidth to support earlier versions of the packages.

  • erlang : 23.2.5
  • elixir : 1.11.3-otp-23
  • nodejs : 14.16.0
  • postgres : v12.x or v13.x

Download code

Setup

  • Copy the file: config/dev.secret.exs.txt to config/dev.secret.exs and edit it with your credentials
  • Copy the file: config/.env.dev.txt to config/.env.dev and edit it with your credentials
  • Run source config/.env.dev
  • Start the postgres server
  • Run mix setup
  • This will setup Glific with default credentials as:
    • Phone 917834811114
    • Password secret1234
  • Run mix phx.server

Here we go

Now you can visit localhost:4000 from your browser.

Install glific-frontend

You cannot do much from the glific-backend unless you are an API developer. To see Glific in its glory, please install Glific Frontend

Create and link your Gupshup Account

The frontend and backend are great, but you will need an account with a WhatsApp Business Provider to explore the application. The currently supported backend is Gupshup. You will need to do the following:

  • Create a Gupshup Account
  • Create a WhatsApp Messaging App on Gupshup
  • You can name it GlificTest and ensure the App Type is Access API
  • Edit config/dev.secret.exs in the backend directory
  • Enter your API Key, which can be found by clicking on your profile in the top left corner of your gupshup dashboard
  • Enter your APP name
  • Start the backend server in iex session: iex -S mix
  • Update HSM templates: Glific.Templates.update_hsms(1)
  • Install ngrok
  • Start ngrok to proxy port 4000:
    • Start the backend server: mix phx.server
    • $ ngrok http 4000 --host-header=localhost:4000 (do this in a new window))
    • Remember the URL it assigns you, something like: https://9f6a7c7822d2.ngrok.io
  • Goto the Settings Page
  • On that page, Search for Manage your Template messaging settings and enable it
  • On same page, Search for Callback URL / Link your Bot
  • Enter your callback URL that ngrok gave you, add: /gupshup to the end. Something like: https://9f6a7c7822d2.ngrok.io/gupshup/
  • Click Set. It should give you a Callback set successfully message. If not, check the above steps.

Updating your instance

For v0.x releases, we will be resetting the DB and not saving existing state. Run the following commands to update your codebase from the glific repository.

  • Ensure you are in the top level directory of the glific api code.
  • Get the latest code from master: git switch master; git pull
  • Ensure you have not modified any files in this directory, by running: git status
  • Run the setup command: mix setup

Use SSL for frontend and backend

(we'll be making the switch to using SSL for both frontend and backend in development post 1.5). These are the preliminary steps involved

  • Install mkcert (https://github.com/FiloSottile/mkcert)
  • mkcert --install
  • mkcert glific.test api.glific.test
  • mkdir priv/cert
  • mv glific.test+1* priv/cert
  • The backend config files for development will assume that the port is 4001 with the above hostnames
  • Switch the frontend to use https port 4001 for the backend

Documentation

Learn more

Glific

Chat with us

About

The Main application that provides the core interface via the glific APIs

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Elixir 98.7%
  • CSS 0.6%
  • JavaScript 0.3%
  • HTML 0.2%
  • Shell 0.1%
  • SCSS 0.1%