GithubHelp home page GithubHelp logo

felzan / simple-messenger Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lucasinocente/simple-messenger

0.0 1.0 0.0 334 KB

WIP! TIP! Trabalho em progresso!

HTML 6.37% CSS 13.61% JavaScript 80.02%

simple-messenger's Introduction

Simple Messenger

Simple Messenger is a self-hosted tool for communication with your friends :D


How to use

Install Client Application

  1. Install dependencies
npm install
  1. Create a Firebase Project (https://firebase.google.com)

  2. Create an Auth Method at Authentication > Sign-in method > Email/Password

  3. Enable first option and e-mail link too.

  4. Create a Realtime Database Project

  5. Setup environment variables

  • Copy and rename .env.example to .env.local
  • Replace .env.local content with your configuration
REACT_APP_API_KEY=your-web-api-key
REACT_APP_AUTH_DOMAIN=your-app.firebaseapp.com
REACT_APP_DATABASE_URL=https://your-app.firebaseio.com
REACT_APP_PROJECT_ID=your-app
REACT_APP_MESSEAGING_SENDER_ID=your-sender-id
REACT_APP_WEB_PUSH_CERTIFICATES=your-web-push-certificates
REACT_APP_APP_ID=-your-app-id

To discovery your key, at Firebase console go to Settings > Project Settings.

  1. Change your sender id in firebase-messaging-sw.js and manifest.json.

  2. Change your Database rule at Database > rules to:

{
  "rules": {
    ".read": true,
    ".write": true
  }
}

CAUTION! THIS WILL OPEN YOUR DATABASE! KEEP YOUR KEY SAFE!

Visit https://firebase.google.com/docs/database/security to learn more about security rules.

  1. Run the project
npm start

Install Admin Application

  1. In the client application (http://localhost:3000) create a user with your e-mail

  2. Go to admin and install dependencies

cd admin
npm install
  1. In /admin/set-user-admin.js line 11 set your e-mail.

  2. Download your credentials at Firebase console Settings > Service accounts - or click here.

  3. Change this file for simple-messenger-oss-firebase-adminsdk.json. NEVER COMMIT YOUR CREDENTIAL JSON!

  4. Run

node set-user-admin.js;

Okay, your user now is admin and can see a list of contacts.

Deploy firebase cloud functions

  1. Go to functions and install dependencies
cd functions
npm install
  1. Deploy functions by running npm run deploy

And you all set to go, notifications will be sent if browser is in background and messages exchange from user and admin.

Contributing

Help us to build this:

simple-messenger's People

Contributors

lucasinocente avatar dbofmmbt avatar smkamranqadri avatar gabriel-arauj avatar lucasalacerda avatar lucgauer avatar lnormanha avatar rbezerra avatar tclemos avatar godoi avatar anotherpopoua avatar

Watchers

James Cloos avatar

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.