aminmalekzadeh / chat-app-backend

A chat app massenger with expressjs and reactjs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Logo

Chat App Messenger

A chat app messenger with expressjs and reactjs
Contact with developer »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Contact
  4. Acknowledgments

About The Project

This chat app is like Telegram, whatsapp and other messengers, you can send text,photo, file and other things and this part is backend project.

You can see frontend project Click here.

Here's why:

  • You can learn about how to create a chat app with nodejs and reactjs
  • You can use of this chat app in your Business or you can use some part chat app
  • This chat app is full open source and you can find and send bug from this chat app for me

(back to top)

Built With

This chat app created by many technology and used of sql and nosql for store data users and conversations

(back to top)

Getting Started

You can run this chat app in localhost or your server.

Prerequisites

For use of chat app, you should download npm and nodemon or pm2

  • npm
    npm install npm@latest -g
  • nodemon
    npm install -g nodemon

Installation

So to run the chat app properly, please go step by step.

  1. Clone the repo
    git clone https://github.com/aminmalekzadeh/chat-app-backend.git
  2. Install NPM packages
    npm install
  3. copy and past .env.example and then change name to .env
      cp .env.example .env
  4. open .env file and enter the your information about server and database
APP_NAME= required, You must enter the app name
APP_PORT= required, You must enter the app port
APP_URL=required, You must enter the app url with http://
APP_SECRET=required, You must enter the app secret
PEER_PORT=required, You must enter the app peer port
SOCK_PORT=required, You must enter the socket port
NEAR_BY_DISTANCE_MAX=20000
#database
DB_NAME=
DB_HOST=
DB_USER=
DB_PASSWORD=
#ETC
JWT_SECRET=required, You must enter the jwt secret
#MONGO_DB
MONGO_PORT=27017
MONGO_HOST=localhost
MONGO_USER=
MONGO_PASSWORD=
MONGO_DATABASE=massenger
#REDIS DATABASE
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=
REDIS_DB=0
  1. Then you should enter mysql information app/db/sequelize/config/config.json
{
  "development": {
    "username": "USER_NAME_MYSQL",
    "password": "PASSWORD_MYSQL",
    "database": "DATABASE_NAME_VERSION_DEV",
    "host": "127.0.0.1",
    "dialect": "mysql"
  },
  "test": {
    "username": "USER_NAME_MYSQL",
    "password": "PASSWORD_MYSQL",
    "database": "DATABASE_NAME_VERSION_TEST",
    "host": "127.0.0.1",
    "dialect": "mysql"
  },
  "production": {
    "username": "USER_NAME_MYSQL",
    "password": "PASSWORD_MYSQL",
    "database": "DATABASE_NAME_VERSION_PRODUCTION",
    "host": "127.0.0.1",
    "dialect": "mysql"
  }
}
  1. you should migrate sequelize in directory app/db/sequelize with sequelize-cli
cd app/db/sequelize

then

npx sequelize-cli db:migrate
  1. You have to make 5 collections with the following names.
1. blockedusers
2. conversations
3. messages
4. report
5. participants
  1. Now you can start backend project.
nodemon server.js

(back to top)

Contact

Amin Malekzadeh - Linkedin - aminmalekzadeh004@gmail.com

Project Link: https://github.com/aminmalekzadeh/chat-app-backend

(back to top)

Acknowledgments

During the development of this route I have used the following resources!

(back to top)

About

A chat app massenger with expressjs and reactjs


Languages

Language:JavaScript 99.2%Language:Shell 0.8%