Coder Social home page Coder Social logo

helaouichourouk / notification-service Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mohamed1refaie/notification-service

0.0 0.0 0.0 28 KB

A simple Notification service with Nodejs, MongoDB and Firebase-admin sdk

JavaScript 99.40% Dockerfile 0.60%

notification-service's Introduction

Notification Service

This is a Notification service build with nodejs, it uses express, mongoose and firebase-admin sdk to send notifications. It let you

  1. subscribe a user to the notifications, subscribe a user to a certain topic.
  2. send notification to all the subscribed users, to a specific user or users, to a group of users with a common topic.
  3. send sms to all the subscribed users, to a specific user or users. (you have to integrate with an sms provider)
  4. refresh a certain user's firebase token.

Instructions

To Run the Project:

  • clone the repo or download it
  • cd into the directory of the project from the terminal
  • head to the Firebase console
  • create a new project from the firebase console and give it a name, or select an existing project.
  • go to your project's settings, then to service accounts, then generate new private key and download it.
  • rename serviceAccountKey.json.example to serviceAccountKey.json
  • copy the content of the private key file you just downloaded into serviceAccountKey.json
  • configure your mongo database in mongoose.js in my case i use a free cluster at MongoDB Atlas, and it's password will be in nodemon.json.example then rename it to nodemon.json
  • install all project dependencies with npm install
  • run the project with npm start and it will be listening at localhost:3000
  • test the project with npm test

To Run the Service with Docker:

  • make sure that docker and docker-compose are installed.
  • run sudo docker-compose up it will be listening at localhost:3000

The API contains 8 endpoints You can see a full Documentation for the API and examples from here

  1. /subscribe
    • /
    • /:topic
  2. /notifications
    • /
    • /notifications/toAll
    • /notifications/toGroup
  3. /sms
    • /
    • /toAll
  4. /refreshToken

notification-service's People

Contributors

mohamed1refaie 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.