Skip to content

lowkeyd3v/chat-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’¬ FortiComm (MERN + Socket.io)

A full-stack real-time chat application built using the MERN stack β€” MongoDB, Express, React, Node.js β€” with Socket.io for instant messaging and TailwindCSS for a clean, modern UI.


πŸš€ Features

⚑ Real-time messaging (via Socket.io)

πŸ” JWT Authentication

πŸ’Ύ MongoDB database (Mongoose)

🎨 Beautiful UI with TailwindCSS

πŸ”„ Instant message updates without page reloads

🌐 REST APIs using Express

🧩 Modular & scalable folder structure


🧠 Tech Stack

Layer Technology

Frontend React + Vite + TailwindCSS Backend Node.js + Express Database MongoDB + Mongoose Real-Time Socket.io Authentication JWT Tools Axios, dotenv, nodemon


πŸ—‚ Folder Structure

chat-app/ β”‚ β”œβ”€β”€ client/ # Frontend β”‚ β”œβ”€β”€ src/ β”‚ β”‚ β”œβ”€β”€ components/ # Chat components β”‚ β”‚ β”œβ”€β”€ pages/ # App screens (Login, Chat) β”‚ β”‚ └── assets/ β”‚ └── package.json β”‚ β”œβ”€β”€ server/ # Backend β”‚ β”œβ”€β”€ controllers/ # Logic for requests β”‚ β”œβ”€β”€ models/ # Mongoose schemas β”‚ β”œβ”€β”€ routes/ # API routes β”‚ β”œβ”€β”€ socket.js # Socket.io setup β”‚ β”œβ”€β”€ server.js # Main entry point β”‚ └── package.json β”‚ └── .env # Environment variables


βš™ Installation & Setup

1️⃣ Clone the Repository

git clone https://github.com/shivansh-0826/chat-app.git cd chat-app

2️⃣ Install Dependencies

Backend

cd server npm install

Frontend

cd ../client npm install

3️⃣ Setup Environment Variables

Create a .env file inside the server/ folder and add:

PORT=5000 MONGO_URI=your_mongodb_connection_string JWT_SECRET=your_secret_key

4️⃣ Run the App

Backend:

npm run server

Frontend:

npm run dev

Then open http://localhost:5173 in your browser.


πŸ”„ How It Works

  1. Users log in and connect to the server via Socket.io.

  2. When a user sends a message, it’s emitted to the backend.

  3. The backend broadcasts it to the receiver in real time.

  4. Messages are stored in MongoDB for persistence.


🧰 Environment Variables

Variable Description

PORT Server running port MONGO_URI MongoDB connection string JWT_SECRET Secret key for JWT tokens


πŸ“¦ Deployment

This app can be deployed easily on Vercel (frontend) and Render / Railway (backend). You can configure environment variables directly on those platforms.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages