Glific - Two Way Open Source Communication Platform
Packages Needed
Install the following packages using your favorite package manager. Links are provided for some
- Install Elixir
- For Ubuntu users you also need to install the
inotify-tools
package
- For Ubuntu users you also need to install the
- Install Postgres
- For Postgres, for the development server, we default to using postgres/postgres as the username/password. This is configurable
Download code
Setup
- Copy the file:
config/dev.secret.exs.txt
toconfig/dev.secret.exs
and edit it with your credentials - Run
mix setup
- 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
- Install ngrok
- Start ngrok to proxy port 4000:
$ ngrok http 4000
(do this in a new window))- Remember the URL it assigns you, something like:
https://9f6a7c7822d2.ngrok.io
- Also start the backend server:
mix phx.server
(do this in a new window)
- Remember the URL it assigns you, something like:
- Create a WhatsApp Messaging App on Gupshup
- You can name it
GlificTest
and ensure theApp Type
isAccess API
- Goto the Settings Page
- On that 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 aCallback set successfully
message. If not, check the above steps. - Edit
config/dev.secret.exs
in the backend directory - You will need to enter your API Key, which can be found by clicking on your profile in the top left corner of your gupshup dashboard
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 glicic 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
Deploying release on ECS with CD
- If you are using AWS codebuild for CD, use buildspec.yml.sample file content for creating and pushing docker image.
- For using and alternative repository like docker hub, you just need to make some changes in the pre_build phase (REPOSITORY_URI and authentications), the rest of the phases will remains same.