covid19india / chat21-cloud-functions

Firebase cloud functions for Chat21. It's the server engine of Chat21 hosted on Google Firebase

Home Page:http://www.chat21.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm version

Chat21 is the core of the open source live chat platform Tiledesk.com.

Introduction

Chat21-cloud function is the backend module required for the operation of the other chat21 modules.

  • Send a direct message
  • Send a group message
  • Create a conversation for each message
  • Send the push notification for direct and group message
  • Send an info message to notify the creation of a group or a member joining

Pre requisites

You can find more info about Firebase Functions here https://firebase.google.com/docs/functions/get-started

Project setup

  • Clone or download this repo from github
  • Run from command line:
cd functions 
npm install
  • Login to Firebase CLI with firebase login. More info here https://firebase.google.com/docs/cli/
  • Set up your Firebase project by running firebase use --add, select your Project ID and follow the instructions.

Deploy

  • Deploy to Firebase using the following command: firebase deploy. You can see the deployed functions on the Firebase Console under Functions menu.

Tips

Test

Send your first message

  • Create a new user on the Firebase Console under Authentication Menu.
  • Select Email/Password for Authentication Provider
  • Click on "Add New User" and populate Email and Password field with for example : email = a@a.com, password = 123456
  • Get a JWT token calling JWT Authentication method as described here JWT Authentication
  • Send a new message using Send Message API with JWT Authentication as described here Send message

Advanced Setup Options

Read the Setup Options page

REST API

Read the REST API page

About

Firebase cloud functions for Chat21. It's the server engine of Chat21 hosted on Google Firebase

http://www.chat21.org

License:GNU Affero General Public License v3.0


Languages

Language:JavaScript 96.5%Language:HTML 2.1%Language:CSS 0.6%Language:Dockerfile 0.5%Language:Shell 0.3%