Skip to content

Latest commit

Β 

History

History
152 lines (118 loc) Β· 3.84 KB

File metadata and controls

152 lines (118 loc) Β· 3.84 KB

Convox - Real-Time Chat Application

A modern, real-time chat application built with Node.js, Express, Socket.io, MongoDB, and React.

πŸš€ Features

  • Real-time messaging with Socket.io
  • User authentication and registration
  • Live chat rooms with instant message delivery
  • Modern React UI with responsive design
  • Redux state management for efficient data handling
  • Real-time notifications for new messages
  • User online/offline status

πŸ› οΈ Tech Stack

Backend

  • Node.js - Runtime environment
  • Express.js - Web framework
  • Socket.io - Real-time communication
  • MongoDB - Database
  • JWT - Authentication

Frontend

  • React - UI library
  • Vite - Build tool
  • Redux Toolkit - State management
  • Socket.io Client - Real-time client
  • CSS3 - Styling

πŸ“ Project Structure

Convox/
β”œβ”€β”€ backend/                 # Backend server
β”‚   β”œβ”€β”€ config/             # Database configuration
β”‚   β”œβ”€β”€ controllers/        # Route controllers
β”‚   β”œβ”€β”€ middleware/         # Authentication middleware
β”‚   β”œβ”€β”€ models/             # Database models
β”‚   β”œβ”€β”€ routes/             # API routes
β”‚   β”œβ”€β”€ socket/             # Socket.io configuration
β”‚   └── index.js            # Server entry point
β”œβ”€β”€ frontend/               # React application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/     # React components
β”‚   β”‚   β”œβ”€β”€ hooks/          # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ redux/          # Redux store and slices
β”‚   β”‚   └── config.js       # Configuration
β”‚   └── package.json
└── README.md

πŸš€ Getting Started

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB
  • npm or yarn

Installation

  1. Clone the repository

    git clone https://github.com/PankajSingh34/Convox.git
    cd Convox
  2. Install backend dependencies

    cd backend
    npm install
  3. Install frontend dependencies

    cd ../frontend
    npm install
  4. Set up environment variables Create a .env file in the backend directory:

    MONGODB_URI=your_mongodb_connection_string
    JWT_SECRET=your_jwt_secret
    PORT=5000
  5. Start the backend server

    cd backend
    npm start
  6. Start the frontend development server

    cd frontend
    npm run dev
  7. Open your browser Navigate to http://localhost:5173 (or the port shown in your terminal)

πŸ“± Usage

  1. Register a new account or Login with existing credentials
  2. Start chatting with other users in real-time
  3. Send messages that appear instantly for all online users
  4. See who's online and their current status

πŸ”§ API Endpoints

Authentication

  • POST /api/users/register - User registration
  • POST /api/users/login - User login

Messages

  • GET /api/messages - Get all messages
  • POST /api/messages - Send a new message

Socket Events

  • connection - User connects
  • disconnect - User disconnects
  • sendMessage - Send a message
  • newMessage - Receive a new message

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘¨β€πŸ’» Author

Pankaj Singh

πŸ™ Acknowledgments

  • Socket.io for real-time communication
  • React team for the amazing UI library
  • MongoDB for the database solution
  • Express.js for the robust backend framework

⭐ Star this repository if you find it helpful!