Skip to content

Latest commit

Β 

History

52 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌟 Nexus

A real-time messaging platform with WebSocket communication, JWT authentication, image uploads, and multilingual support.

Live Demo


πŸ“– About The Project

Nexus is a robust, full-stack real-time messaging application designed to provide seamless and secure communication. Built with modern web technologies, it features instant messaging capabilities, secure user authentication, and rich media sharing. Whether it's one-on-one chats or handling multilingual users, Nexus is architected to deliver a fast, responsive, and engaging user experience.

✨ Features

  • πŸ’¬ Real-time Messaging: Lightning-fast communication powered by WebSocket (Socket.io).
  • πŸ” Secure Authentication: Robust user login and registration using JWT (JSON Web Tokens).
  • πŸ–ΌοΈ Media Sharing: Seamless image uploads and management integrated with Cloudinary.
  • 🌍 Multilingual Support: Chat in your preferred language with built-in language support.
  • πŸ“± Responsive Design: A beautiful UI that works perfectly across desktop and mobile devices.
  • ⚑ [Feature 1 Placeholder] E.g., Read receipts and typing indicators.
  • πŸ‘₯ [Feature 2 Placeholder] E.g., Group chats and channel creation.
  • πŸ”’ [Feature 3 Placeholder] E.g., End-to-end encryption for maximum privacy.

πŸ› οΈ Tech Stack

Frontend

React

Backend

NodeJS Express.js Socket.io

Database & Cloud

MongoDB Cloudinary

πŸ“Έ Screenshots

Login/Signup Chat Interface Profile Settings
Login Screenshot Chat Screenshot Profile Screenshot
Secure user authentication Real-time messaging UI User profile and uploads

(Replace URL_TO_IMAGE_X with your actual screenshot URLs)

πŸš€ Getting Started

Follow these steps to set up the project locally on your machine.

Prerequisites

Ensure you have the following installed:

Installation

  1. Clone the repository:

    git clone https://github.com/YOUR_GITHUB_USERNAME/nexus.git
    cd nexus
  2. Install Backend Dependencies:

    cd backend
    npm install
  3. Install Frontend Dependencies:

    cd frontend
    npm install

Environment Variables

Create a .env file in the backend directory and add the following variables:

# Server
PORT=5000
NODE_ENV=development

# Database
MONGODB_URI=your_mongodb_connection_string

# Authentication
JWT_SECRET=your_jwt_secret_key
JWT_EXPIRES_IN=7d

# Cloudinary (Image Uploads)
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret

Run the Application

Run the backend server:

cd backend
npm run dev

Run the frontend application:

cd frontend
npm start

πŸ”Œ API Endpoints

Here are the primary backend API routes:

Authentication

  • POST /api/auth/register - Register a new user
  • POST /api/auth/login - Authenticate user & get token
  • POST /api/auth/logout - Logout user

Users

  • GET /api/users/profile - Get current user profile
  • PUT /api/users/profile - Update user profile & avatar
  • GET /api/users - Get list of users for chat

Messages

  • GET /api/messages/:userId - Get conversation history with a user
  • POST /api/messages/:userId - Send a message to a user

πŸ“‚ Folder Structure

nexus/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ controllers/      # Route logic
β”‚   β”œβ”€β”€ middleware/       # Custom middleware (auth, error handling)
β”‚   β”œβ”€β”€ models/           # Mongoose schemas
β”‚   β”œβ”€β”€ routes/           # API endpoints
β”‚   β”œβ”€β”€ utils/            # Helper functions (JWT, Cloudinary)
β”‚   β”œβ”€β”€ server.js         # Entry point
β”‚   └── socket.js         # Socket.io configuration
β”‚
└── frontend/
    β”œβ”€β”€ public/
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ assets/       # Static files (images, icons)
    β”‚   β”œβ”€β”€ components/   # Reusable UI components
    β”‚   β”œβ”€β”€ context/      # React context (Auth, Socket)
    β”‚   β”œβ”€β”€ hooks/        # Custom React hooks
    β”‚   β”œβ”€β”€ pages/        # Application views (Login, Chat)
    β”‚   β”œβ”€β”€ App.js        # Main React component
    β”‚   └── index.js      # React DOM render
    └── package.json

🧠 What I Learned

Building Nexus was an incredible learning experience that significantly leveled up my full-stack development skills:

  1. Real-Time Architecture: Mastered implementing stateful, bi-directional communication using Socket.io, ensuring messages are delivered instantly without polling.
  2. Advanced State Management: Learned how to effectively manage complex global state (like active users, online status, and typing indicators) across the React application.
  3. Secure Media Handling: Gained hands-on experience integrating third-party APIs by securely uploading and serving user-generated content (images) via Cloudinary.
  4. JWT Authentication Flow: Deepened my understanding of stateless authentication, securely storing tokens, and protecting private API routes using custom Express middleware.

πŸ“¬ Contact

[Your Name]


If you found this project helpful, please consider giving it a ⭐!

About

Mern Stack Chat Application

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages