1.2.1 • Published 2 years ago

ga-npm v1.2.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Site Server Chat-box-app

Built with

  • Nodejs
    • Express: For building web applications on top of Node.js
    • Gulp: Refreshing your browser when you save a file.
  • Firebase/admin
    • create access token & claim.
  • Mongoose
    • is a database, use to save data user & group chat.
  • Docker
    • create nodejs development environment.

Getting Started

  1. Install docker For Ubuntu: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04(link here) For Window: https://docs.docker.com/docker-for-windows/install/#where-to-go-next(link here)
  2. Config environment in file src/config/env.json
{
  "env": "stagging",
  "stagging": {
    "mongoPath": "mongodb://localhost/chatbox"
  },
  "local": {
    "mongoPath": "mongodb://localhost:27017/chatbox"
  }
}

local The environment runs on local stagging For deployed backend environment

  1. Config service account key in file src/config/serviceAccountKey.json
{
  "type": "service_account",
    "project_id": "test-ac***",
    "private_key_id": "2e4ac43ebadda636b6874e5f81d1419246f44***",
    "private_key": "-----BEGIN PRIVATE KEY-----\***\n-----END PRIVATE KEY-----\n",
    "client_email": "firebase-adminsdk-tlgeo@test-ac***.iam.gserviceaccount.com",
    "client_id": "100014058101656065***",
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://oauth2.googleapis.com/token",
    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
    "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-tlgeo%40test-acf65.iam.gserviceaccount.com"
}

Information: https://firebase.google.com/docs/auth/admin/create-custom-tokens

  1. Install package use npm install
  2. Run project chatbox/backend Run terminal in this folder & run command docker-compose up --build * Check api is running http://localhost:3000/ result