All Projects → glific → glific

glific / glific

Licence: AGPL-3.0 license
The Main application that provides the core interface via the glific APIs

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to glific

docker-compose-moodle
This project quickly builds a local workspace for Moodle (Apache2, PHP-FPM with XDEBUG y Postgres) using containers for each of its main components. The local workspace is built and managed by Docker Compose
Stars: ✭ 33 (-70%)
Mutual labels:  postgres
libpq.framework
An XCode project to compile your own libpq.framework for iOS 11.x
Stars: ✭ 27 (-75.45%)
Mutual labels:  postgres
postgres
A PostgreSQL database used by Deis Workflow.
Stars: ✭ 37 (-66.36%)
Mutual labels:  postgres
terraform-aws-druid
Terraform module to deploy Apache Druid in Kubernetes
Stars: ✭ 16 (-85.45%)
Mutual labels:  postgres
agent
Job tracker & performance platform
Stars: ✭ 26 (-76.36%)
Mutual labels:  postgres
Commando
[DEPRECATED] ⚫ Commando Discord bot built on discord.js-commando.
Stars: ✭ 78 (-29.09%)
Mutual labels:  postgres
api.pokedextracker.com
API for pokedextracker.com
Stars: ✭ 38 (-65.45%)
Mutual labels:  postgres
typescript-graphql-postgres-boilerplate
Simple boilerplate integrated typescript, graphql, postgres and apollo server
Stars: ✭ 18 (-83.64%)
Mutual labels:  postgres
pg-error-enum
TypeScript Enum for Postgres Errors with no runtime dependencies. Also compatible with plain JavaScript.
Stars: ✭ 18 (-83.64%)
Mutual labels:  postgres
gobarber-api-gostack11
API GoBarber / NodeJS / Express / Typescript / SOLID
Stars: ✭ 39 (-64.55%)
Mutual labels:  postgres
docker-postgresql-pro-1c
Dockerfile для сборки PostgreSQL под 1С:Предприятие 8
Stars: ✭ 27 (-75.45%)
Mutual labels:  postgres
wait-for-pg
Check if PostgreSQL database is ready
Stars: ✭ 22 (-80%)
Mutual labels:  postgres
Database-Web-API
Dynamically generate RESTful APIs from the contents of a database table. Provides JSON, XML, and HTML. Supports most popular databases
Stars: ✭ 37 (-66.36%)
Mutual labels:  postgres
dlock
Interval Lock
Stars: ✭ 19 (-82.73%)
Mutual labels:  postgres
event-machine-skeleton
Dockerized skeleton for prooph software Event Machine
Stars: ✭ 34 (-69.09%)
Mutual labels:  postgres
general-angular
Realtime Angular Admin/CRUD Front End App
Stars: ✭ 24 (-78.18%)
Mutual labels:  postgres
postgres-nest-react-typescript-boilerplate
No description or website provided.
Stars: ✭ 93 (-15.45%)
Mutual labels:  postgres
www-react-postgres
A complete template for 2022 focused on around React, Postgres and various web3 integrations. You can use the template to make a website, a web application, a hybrid decentralized web application, or even a DAO.
Stars: ✭ 36 (-67.27%)
Mutual labels:  postgres
Parallel.GAMIT
Python wrapper to parallelize GAMIT executions
Stars: ✭ 22 (-80%)
Mutual labels:  postgres
Data-Engineering-Projects
Personal Data Engineering Projects
Stars: ✭ 167 (+51.82%)
Mutual labels:  postgres

Glific - Two Way Open Source Communication Platform

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

Pre-requisites

There is level of understanding middle to advanced level. It is assumed that you know how to use a terminal, install things and have git; for the backend, and for the frontend use install npm / yarn and react.

  1. Software dependency - Postgres server
  2. Software dependency - Erlang / Elixir
  3. Backend - Download
  4. External service - Gupshup. <-- Get a Free trial to get API-key
  5. External service - Oban. <-- Needs 100 Euro per month
  6. Backend - Install certificate
  7. Backend - Config
  8. Frontend

1. Software dependency - Postgres server

For Postgres, for the development server, we default to using postgres/postgres as the username/password. This is configurable

We tested and developed against the following version:

    - postgres : v13.x

2. Software dependency - Erlang / Elixir

For Ubuntu users you also need to install the inotify-tools package

We tested and developed against the following versions:

    - erlang : 24.2.2
    - elixir : 1.13.3-otp-24

3. Backend - Download

git clone https://github.com/glific/glific_backend

DO NOT run mix deps.get until the next steps are completed.

4. External service - Gupshup Create and link your Gupshup Account

Gupshup is an external service that connects to WhatsApp

You will need to do the following:

  • a. Create a Gupshup Account
  • b. Create an app and select Access API
  • c. You can name it NewNameHere "GlificTest <-- Bot Name is already in use, then use anotherone"
  • d. Edit glific_backend/config/dev.secret.exs
  • e. Find your API Key, check top left corner or inside the curl sample message
  • f. Enter your APP name

5. External service - Oban Pro

Oban is a cron-like library. Glific depends 100% on job processing. Oban is required before running mix for Glific to operate. You must purchase license. When purchashing you must buy WEB+PRO . After you purchased Go to account and get this information and run this in glific_backend

mix hex.repo add oban https://getoban.pro/repo --fetch-public-key SHA256:4/abc/edf/gef+aIWPc --auth-key abdedcqweasdj__KEY_AUTH__asdafasdf

Copy the --auth KEY and run this other command

mix hex.organization auth oban --key abdedcqweasdj__KEY_AUTH__asdafasdf

Make sure your key is in the list

mix hex.repo list
Name        URL                             Public key                                          Auth key
oban        https://getoban.pro/repo        SHA256:4/abc/edf/gef+aIWPc   abdedcqweasdj__KEY_AUTH__asdafasdf

If you see it twice, it will not work and fail, since Oban moved from public repository to private this is how an example of failing looks like

Name        URL                             Public key                                          Auth key
hexpm:oban  https://repo.hex.pm/repos/oban  SHA256:abc/edf/gef+aIWPc     abdedcqweasdj__KEY_AUTH__asdafasdf
oban        https://getoban.pro/repo        SHA256:4/abc/edf/gef+aIWPc   abdedcqweasdj__KEY_AUTH__asdafasdf

this is wrong, and you run mix deps.get it will try to fetch from public and ignore private and fail simply remove the public one

mix hex.repo remove hexpm:oban

Now check again

mix hex.repo list
Name        URL                             Public key                                          Auth key
oban        https://getoban.pro/repo        SHA256:4/abc/edf/gef+aIWPc   abdedcqweasdj__KEY_AUTH__asdafasdf

6. Install certificate - Use SSL for frontend and backend

Before install also you need to create this SSL cert simila to this Go to glific_backend folder in the terminal console.

  • a. Install mkcert (https://github.com/FiloSottile/mkcert)

  • b. mkcert --install

  • c. mkcert glific.test api.glific.test

  • d. mkdir priv/cert

  • e. mv glific.test* priv/cert

  • f. cd priv/cert

  • g. ls -1 Check that glific.test+1-key.pem and glific.test+1.pem exists

    if not then copy any certificate found in there to the correct names
    for example if I see:
    
      ❯ ls -1
      glific.test+6-key.pem
      glific.test+6.pem
      glific.test+7-key.pem
      glific.test+7.pem
      ❯ cp glific.test+6-key.pem glific.test+1-key.pem
      ❯ cp glific.test+6.pem glific.test+1.pem
  And check again
      ❯ ls -1
      glific.test+1-key.pem
      glific.test+1.pem
      glific.test+6-key.pem
      glific.test+6.pem
      glific.test+7-key.pem
      glific.test+7.pem
  • h. Check port 4001 sudo lsof -n -i:4001 | grep LISTEN should return nothing.

  • i. Check hosts file grep glific /etc/hosts

    if returns nothing 
    then make sure hosts file has those names added 
    `sudo bash -c 'echo "127.0.0.1 glific.test api.glific.test" >> /etc/hosts'`
    

7. Backend - Config

  • a. Copy the file: cp config/dev.secret.exs.txt config/dev.secret.exs and edit

  • b. Copy the file: cp config/.env.dev.txt config/.env.dev and edit

  • c. Run source config/.env.dev

  • d. Run mix deps.get if this fails try first mix local.hex --force then mix deps.get

    if you see this error, then Oban key is wrong or failing. Check step 5. Or contact Oban.

    ❯ mix deps.get Failed to fetch record for 'hexpm:oban/oban_pro' from registry (using cache instead) This could be because the package does not exist, it was spelled incorrectly or you don't have permissions to it Failed to fetch record for 'hexpm:oban/oban_web' from registry (using cache instead) This could be because the package does not exist, it was spelled incorrectly or you don't have permissions to it ** (Mix) Unknown package oban_pro in lockfile

  • e. Run mix setup

  • f. Run mix phx.server

  • g. Another tab of terminal - Start the backend server in iex session: iex -S mix

  • h. Inside the iex - Update HSM templates: Glific.Templates.sync_hsms_from_bsp(1)

Now you can visit localhost:4000 from your browser.

8. Frontend - 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

git clone https://github.com/glific/glific_frontend
cd glific_frontend

open package.json and update start script

nano package.json

from

"start": "HTTPS=true SSL_CRT_FILE=../glific/priv/cert/glific.test+1.pem SSL_KEY_FILE=../glific/priv/cert/glific.test+1-key.pem react-scripts start"

to

"start": "HTTPS=true SSL_CRT_FILE=../glific_backend/priv/cert/glific.test+1.pem SSL_KEY_FILE=../glific_backend/priv/cert/glific.test+1-key.pem react-scripts start"

Copy config file

cp .env.example .env

Make sure the .env config file looks like this

REACT_APP_API_PREFIX="api"
# localhost
REACT_APP_GLIFIC_API_PORT=4001
REACT_APP_GLIFIC_BACKEND_URL=""
REACT_APP_APPSIGNAL_API_KEY=""
REACT_APP_APPLICATION_NAME="Glific: Two way communication platform"
REACT_APP_LOGFLARE_API_KEY=""
REACT_APP_LOGFLARE_SOURCE_TOKEN=""
REACT_APP_STRIPE_PUBLISH_KEY=""
REACT_APP_RECAPTCHA_CLIENT_KEY="Your recaptch key"

USE Double quotes " " , not single ' ' quotes. And do not leave spaces before or after.

Do not use '' for after the = or leave spaces Broken For example 1

REACT_APP_GLIFIC_BACKEND_URL='gitflic.test'

this will be read like this by react https://%27gitflic.test%27 . notice the %27 which will fail the connection

Broken For example 2

REACT_APP_GLIFIC_BACKEND_URL= gitflic.test'

this will be read like this by react https://%32gitflic.test%27 . notice the %32 which will fail the connection

Broken For example 3

REACT_APP_GLIFIC_BACKEND_URL="gitflic.test "

this will be read like this by react https://gitflic.test%32 . notice the %32 which will fail the connection

Broken For example 4

REACT_APP_GLIFIC_BACKEND_URL="https://gitflic.test"

this will be read like this by react https://https://gitflic.test . notice the extra https:// which will fail the connection

Correct For examples

REACT_APP_GLIFIC_BACKEND_URL="gitflic.test"
REACT_APP_GLIFIC_BACKEND_URL=gitflic.test

Now run install

yarn setup

If there were no failures

yarn start

Go to localhost:3000 from your browser.

Front end credentials

  • Phone 917834811114
  • Password secret1234

Optional - Using NGROK

  • 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

Documentation

Learn more

Glific

Chat with us

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].