LeChat is a web-based instant messaging app that allows you to quickly send and receive text messages, emojis, photos, or files with other LeChat users. LeChat uses its own socket server and works independently, professionally built using MongoDB, Express, React, Node, and Socket IO. Suitable for those of you who are interested in learning the workflow of messaging apps.
Step 1: Fork and clone this repository.
git clone https://github.com/{username}/lechat.git
Step 2: Rename .env.example
file to .env
and complete the required environment variables.
Step 3: Install dependencies.
npm install
Step 4: Run the app in development mode.
npm run dev
Environment variables provide information about the environment in which the process is running. We use Node environment variables to handle sensitive data like API keys, or configuration details that might change between runs.
NODE_ENV = development
By default, LeChat will use your local MongoDB server and the lechat
database will be created automatically when the app is run in development mode. In production mode, you should use a cloud database like MongoDB Atlas.
MONGO_URI = mongodb+srv://{username}:{password}@node.deu00vc.mongodb.net/{dbname}?retryWrites=true&w=majority
We rely on Cloudinary service to store all media uploaded by users, follow the instructions below to getting started with Cloudinary:
avatars
and chat
folders.CLOUDINARY_API_KEY =
CLOUDINARY_API_SECRET =
CLOUDINARY_CLOUD_NAME =
We use Nodemailer to send OTP code via email, use your email address and App Password to run Nodemailer, follow the instructions below to generate your App Password:
EMAIL_USER = [email protected]
EMAIL_PASS =
There are many fake SMTP server services to test your email but I recommend using Mailtrap, this variable will only be executed in development mode.
TEST_EMAIL_USER =
TEST_EMAIL_PASS =
TEST_EMAIL_HOST = smtp.mailtrap.io
TEST_EMAIL_PORT = 2525
Distributed under the GPL-3.0 License.