DotChat is a full-stack, real-time chat application designed to provide seamless and interactive communication. Built with a modern tech stack including React, Node.js, Express, MongoDB, and Socket.io, it offers real-time messaging, user authentication, and profile customization.
- Real-Time Messaging: Instant message delivery and reception using WebSockets (Socket.io).
- User Authentication: Secure signup and login processes using JWT (JSON Web Tokens) and bcrypt for password hashing.
- Online Status Indicators: See which users are currently online in real-time.
- Profile Management: Customize user profiles, including uploading profile pictures (integrated with Cloudinary).
- Responsive Design: A beautiful, responsive user interface styled with Tailwind CSS, ensuring a great experience on both desktop and mobile devices.
- Framework: React 19 with Vite
- Routing: React Router DOM
- State Management: React Context API
- Styling: Tailwind CSS v4
- Real-time Communication: Socket.io-client
- HTTP Client: Axios
- Notifications: React Hot Toast
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB (via Mongoose)
- Real-time Communication: Socket.io
- Authentication: JWT (JSON Web Tokens) & bcryptjs
- Media Storage: Cloudinary (for profile pictures and media)
- Environment Management: dotenv
Before you begin, ensure you have the following installed:
- Node.js (v16 or higher)
- MongoDB (Local or Atlas)
- Cloudinary Account (For image uploads)
-
Clone the repository (if applicable) or navigate to the project directory:
cd "DotChat App"
-
Setup the Backend (Server):
- Navigate to the server directory:
cd server - Install dependencies:
npm install
- Create a
.envfile in theserverdirectory and add the following variables:PORT=5000 MONGO_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret_key FRONTEND_URL=http://localhost:5173 CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret
- Start the development server:
npm run server
- Navigate to the server directory:
-
Setup the Frontend (Client):
- Open a new terminal and navigate to the client directory:
cd client - Install dependencies:
npm install
- Create a
.envfile in theclientdirectory and add the following variables:VITE_BACKEND_URL=http://localhost:5000
- Start the Vite development server:
npm run dev
- Open a new terminal and navigate to the client directory:
-
Access the Application: Open your browser and navigate to
http://localhost:5173.
DotChat App/
βββ client/ # React frontend application
β βββ public/ # Static assets
β βββ src/
β β βββ components/ # Reusable React components
β β βββ pages/ # Application pages (Home, Login, Profile)
β β βββ App.jsx # Main application component
β β βββ main.jsx # Entry point
β βββ context/ # React Context for global state (Auth, etc.)
β βββ package.json # Frontend dependencies
β βββ vite.config.js # Vite configuration
β
βββ server/ # Node.js/Express backend
βββ controllers/ # Route controllers (Auth, Messages)
βββ lib/ # Utilities and database connection
βββ middleware/ # Express middleware (Auth protection)
βββ models/ # Mongoose database schemas (User, Message)
βββ routes/ # API routes
βββ server.js # Main server entry point & Socket.io setup
βββ package.json # Backend dependencies