This is a fun project to practice real-time chatting functionalities.
By using this web-application, one can chat with a user, search a user. This is role base access control system, only admin user can access the user management page. There are 3 endpoints for this project. All the endpoints are protected by using JWT authorization cookies.
- User Handler
- Login Handler
- Inbox handler
You should have NodeJs, ExpressJs and MongoDB installed in your local machine.
- Clone this repository
git clone https://github.com/SakibAlEmran/Real-Time-Chat-Application.git
- Go to working directory
cd Real-Time-Chat-Application
- Create directory: public/uploads and public/uploads/avatars
- create a .env file and assign the value. Here is the list of the .env file variables:
APP_NAME,
APP_URL,
PORT,
MONGO_CONNECTION_STRING,
COOKIE_SECRET,
JWT_SECRET,
JWT_EXPIRY,
COOKIE_NAME,
- See package.json file and install all dependencies using npm or yarn
- Start the MongoDb database server
sudo systemctl start mongod
- start the server
yarn start || npm start
- You can make request using browser to gel Html response(ejs view engine rendering) or Postman for json response.
I have followed a youtube tutorial playlist by Sumit Saha to do this project. Playlist link: https://www.youtube.com/watch?v=xihtoTIy-ms&list=PLHiZ4m8vCp9PHnOIT7gd30PCBoYCpGoQM&index=30&ab_channel=LearnwithSumitBangladesh. Some of the files(public(images, js, stylesheet), views) are taken from the project file.
Email: sakib.imran0909@gmail.com