Skip to content

Real-time Chat Application developed using Mern Stack

Notifications You must be signed in to change notification settings

akashsapra9/ChatGeek

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chat-app

.env Setup

MONGO_URI

  • Create a MongoDB account.
  • Create a new cluster.
  • Click Connect.
  • Create a database user and copy the password into a note temporarily.
  • Click Choose a connection method.
  • Click Drivers.
  • Select Node.js for the Driver.
  • Copy the URL given in step/part 3.
  • Paste the copied URL into the MONGO_URI variable.
  • Copy and paste the password you saved earlier into the URL as directed in step/part 3.

JWT_SECRET

  • Output of running node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

SERVER_ID

  • Output of running node -e "console.log(require('crypto').randomUUID())"

SERVER_PRIVATE_KEY_B64URL & SERVER_PUBLIC_KEY_B64URL

  • From the root of the project, run each of the following (WSL/Linux/macOS, not Windows):
    • openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:4096 -out temp/server_private.pem
    • openssl rsa -pubout -in temp/server_private.pem -out temp/server_public.pem
    • node -e "const fs=require('fs');const s=fs.readFileSync('temp/server_private.pem','utf8');const b=Buffer.from(s,'utf8').toString('base64').replace(/\+/g,'-').replace(/\//g,'_').replace(/=+$/,'');fs.writeFileSync('temp/SERVER_PRIVATE_KEY_B64URL.txt',b)"
    • node -e "const fs=require('fs');const s=fs.readFileSync('temp/server_public.pem','utf8');const b=Buffer.from(s,'utf8').toString('base64').replace(/\+/g,'-').replace(/\//g,'_').replace(/=+$/,'');fs.writeFileSync('temp/SERVER_PUBLIC_KEY_B64URL.txt',b)"
  • Paste the contents of SERVER_PRIVATE_KEY_B64URL.txt and SERVER_PUBLIC_KEY_B64URL.txt in the temp folder into their respective fields in the .env file.

Additional Backend Setup

  • From /ChatGeek (not in /backend), run ./backend/scripts/slc-certs/generate.sh

Starting The Backend/Server

  • Run cd backend
  • Run npm start
    • May need to install npm if not done so already.
    • May need to run sudo npm install -g nodemon if you receive the error: "nodemon: Permission denied".

About

Real-time Chat Application developed using Mern Stack

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages