Skip to main content

project Settings

  • this steps for production and local installation

  • after download, you will have source.zip unzip this file you will get v_chat_sdk_backend folder
  • which contain typescript files

.env file

  • IS_USER_ONE_SIGNAL_AND_NO_FIREBASE I have made this chose because firebase forbidden from some country I recommend to user firebase current onesignal not supported
  • if = true then you must create account on one signal and provide ONESIGNAL_AUTHORIZATION value to start use intestinal instead of firebase if true then the app will user firebase to push notifications
  • ACCESS_TOKEN_SECRETE update this value with strong password and don't change it ever will course all users logout if you change it in production
  • MONGODB_URL mongo db url if you will run it locally then doesn't change it
  • ENABLE_MIGRATE_OLD_USERS if your app already in production then update this value to true to enable migrate api to works
  • ENABLE_MIGRATE_OLD_USERS after finish with migrate old users you must update this value too false to disable the add users api
  • MAX_CHAT_FILES_SIZE set limit to chat share files and videos
  • PASSWORD_HASH_KEY set storage password has key make sure it same key with flutter side other users can register only and cant login it will say invalid credentials
  • MAX_GROUP_USERS_COUNT set limit to max group count
  • MACHIN_PUBLIC_URL your server public key (required only for show big image notification in android)

don't update the .env ACCESS_TOKEN_SECRETE or PASSWORD_HASH_KEY ever PASSWORD_HASH_KEY must be same with flutter side other login will fail !!!

update default users image

  • open v_chat_sdk_backend/public/profile/default_user_image.png
  • update default_user_image.png make sure this image smaller than 300KB and with the same name as default_user_image.png

Firebase Admin sdk

  • the firebase project must be the same as flutter side
  • if you set IS_USER_ONE_SIGNAL_AND_NO_FIREBASE = false then you must provide your firebase-adminsdk.json file
  • first open firebase console create or open existing firebase account
  • and navigate to project setting then service accounts then generate new private key select Node.js
  • after download firebase-adminsdk.json update this file by your firebase generated file but rename it to firebase-adminsdk.json

One Single setup (coming soon)

  • if you set IS_USER_ONE_SIGNAL_AND_NO_FIREBASE = true then you must provide your ONESIGNAL_AUTHORIZATION
  • create or open new account on onesignal app
  • add new android and ios apps add your firebase sender id and token
  • then open dashboard/settings/Keys&IDs copy Rest API Key
  • paste it in ONESIGNAL_AUTHORIZATION don't delete Basic just update "Basic M2Ey--------------------BlNWY5" M2Ey--------------------BlNWY5 and leave the space between the Basic and your rest api key

other

  • don't update any package on package.json let me update and test then push to you