Table of Contents
As part of my NodeJS learning journey , I've built a realtime chat with ExpressJS, Socket.IO and MongoDB.
Here are the main features of the app:
- Google Token Authentication: users can login with their Google Account.
- Multi-user: Different users can login and chat with each other. To try it out in a single machine, just login with different Google Accounts on different browsers.
- Chatroom creation: users can either select a chatroom from a list of create their own chatrooms from scratch.
This is the tech stack I've worked with:
To get a local copy up and running follow these simple steps.
- Clone the repo
git clone https://github.com/jempico/realtime_chat_socketio
- Install NPM packages
npm install
- Add environment variables: edit or create and
.env
file in the root directory with the following data:PORT= 3000 DB_USER = tester DB_PASSWORD = AWnHq3IDZaeDL8DP
- Authenticate users with Google Token (google-auth-library).
- Using Socket.io to create web sockets.
- Using MongoDB and Mongoose for schema validation.
- Set up a MongoDB Atlas cluster.
- Server Side Rendering with EJS template engine to inject dynamic content into the html.
Jemimah Pico - Portfolio - Linkedin - [email protected]
Project Link: https://github.com/jempico/realtime_chat_socketio