Thanks to visit codestin.com
Credit goes to github.com

Skip to content

SjxSubham/Sjx_Chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Sjx_ChatApp Sjx_Chat

Welcome to Sjx_ChatApp, a powerful and intuitive real-time chat application that connects people seamlessly. Built with modern technologies, Sjx_ChatApp ensures a secure, fast, and user-friendly chatting experience.


Sjx_Chat

Live Demo: Sjx_ChatApp


πŸ”₯ Features

  • Real-Time Messaging – Powered by Socket.IO for instant chat communication.
  • Secure Authentication – JWT-based authentication ensures user data security.
  • User-Friendly UI – Styled with Tailwind CSS & DaisyUI for a sleek and responsive design.
  • Scalable Backend – Built with Express.js & Node.js for efficient performance.
  • MongoDB Database – A robust NoSQL database for storing messages and user data.
  • Fast & Lightweight – Optimized for speed and smooth user experience.
  • Online Status – See who's online in real-time.
  • Message Notifications – Audio notifications for new messages.
  • Responsive Design – Works perfectly on desktop and mobile devices.

πŸ›  Tech Stack

  • Frontend: React.js, Tailwind CSS, DaisyUI, Vite

  • Backend: Node.js, Express.js

  • Database: MongoDB

  • Authentication: JSON Web Token (JWT)

  • Real-Time Communication: Socket.IO

  • State Management: Zustand


πŸš€ Quick Start

Prerequisites

  • Node.js (v16 or higher)
  • MongoDB (local or cloud)
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/SjxSubham/Sjx_Chat.git
    cd Sjx_Chat
  2. Install dependencies

    npm install
    cd frontend/Sjx_chat
    npm install
    cd ../..
    
    cd backend
    npm install
    cd ..
    
    npm list
    npm i
  3. Environment Setup

    # Copy example environment files
    cp .env.example .env
    cp frontend/Sjx_chat/.env.example frontend/Sjx_chat/.env
  4. Configure Environment Variables

    Edit .env file:

    MONGO_DB_URI=mongodb://localhost:27017/chat_app
    JWT_SECRET=your_jwt_secret_key_here
    PORT=5000
    NODE_ENV=development
    CLIENT_URL=http://localhost:3000

    Edit frontend/Sjx_chat/.env file:

    VITE_API_URL=http://localhost:5000
    VITE_SOCKET_URL=http://localhost:5000
  5. Start the application

    # Development mode (backend)
    npm run server
    
    # In a new terminal, start frontend
    cd frontend/Sjx_chat
    npm run dev
  6. Access the application

Production Build

# Build the application
npm run build

# Start in production mode
npm start

πŸ“ Project Structure

Sjx_Chat/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ controllers/          # API controllers
β”‚   β”œβ”€β”€ db/                  # Database connection
β”‚   β”œβ”€β”€ middleware/          # Auth middleware
β”‚   β”œβ”€β”€ models/              # MongoDB schemas
β”‚   β”œβ”€β”€ routes/              # API routes
β”‚   β”œβ”€β”€ socket/              # Socket.IO configuration
β”‚   └── utils/               # Utility functions
β”œβ”€β”€ frontend/Sjx_chat/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/      # React components
β”‚   β”‚   β”œβ”€β”€ context/         # React context
β”‚   β”‚   β”œβ”€β”€ hooks/           # Custom hooks
β”‚   β”‚   β”œβ”€β”€ pages/           # Page components
β”‚   β”‚   └── utils/           # Frontend utilities
β”‚   └── public/              # Static assets
└── package.json             # Root dependencies

πŸ”§ Available Scripts

Command Description
npm run server Start backend in development mode
npm start Start backend in production mode
npm run build Build frontend for production
npm run dev Start frontend in development mode (from frontend/Sjx_chat)

πŸ› Troubleshooting

Common Issues

  1. Port already in use

    • Change PORT in .env file
    • Kill process using: netstat -ano | findstr :5000
  2. MongoDB connection error

    • Ensure MongoDB is running
    • Check MONGO_DB_URI in .env
  3. Socket connection issues

    • Verify VITE_SOCKET_URL in frontend .env
    • Check CORS settings in backend

An engaging real-time chat experience with a sleek UI.


License

This project is licensed under the GNU GENERAL PUBLIC LICENSE v3.0 - see the LICENSE file for details.


Contributing

Contributions are welcome! Feel free to fork the repo and submit a pull request.


πŸ“¬ Contact

For any issues or suggestions, please reach out via GitHub Issues.

Happy chatting! πŸš€

About

This was my 2 years ago project btw... after 2 years i fixed that major Bug & redeployed ;-)

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •