Skip to content

huxson-gh/Talksy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’¬ Talksy - Real-Time Chat Application

Node React MongoDB Socket.io Vercel

Talksy is a seamless, real-time messaging platform designed to connect people instantly. It offers secure user authentication, real-time communication, and an elegant, responsive user interface.


🌐 Live Demo

πŸ”— Live Website: Talksy β†—
(Deployed on Vercel)


πŸ“‘ Table of Contents


✨ Features

  • ⚑ Real-time Messaging: Instant message delivery and reception powered by Socket.io.
  • πŸ” Secure Authentication: JWT-based user authentication and bcrypt password hashing.
  • 🟒 Online Status: See which users are currently online in real-time.
  • πŸ–ΌοΈ Profile Customization: Users can upload and update their profile pictures using Cloudinary.
  • πŸ“± Responsive Design: A beautiful, fully responsive UI built with Tailwind CSS.
  • πŸ‘€ Message Read Status: Know when your messages have been seen.
  • πŸ›‘οΈ Protected Routes: Ensure only authenticated users can access the chat and profile settings.

πŸ› οΈ Tech Stack

Frontend

  • React.js (v19)
  • Vite (Next Generation Frontend Tooling)
  • Tailwind CSS (v4)
  • React Router DOM (Routing)
  • Socket.io-client (Real-time communication)
  • Axios (HTTP requests)
  • React Hot Toast (Notifications)

Backend

  • Node.js & Express.js
  • MongoDB & Mongoose (Database & ODM)
  • Socket.io (WebSocket server)
  • JSON Web Tokens (JWT) (Authentication)
  • Bcrypt.js (Password hashing)
  • Cloudinary (Image hosting)

Deployment

  • Vercel (Frontend)
  • Render (Backend)

πŸ”§ Prerequisite

Before you begin, ensure you have the following installed:


βš™οΈ Installation and Setup

Clone the repository

git clone https://github.com/your-username/talksy.git
cd Talksy

Backend Setup

  1. Navigate to the backend directory and install dependencies:
cd backend
npm install
  1. Start the backend server:
npm run server

(The server will run on http://localhost:5000)

Frontend Setup

  1. Open a new terminal and navigate to the frontend directory and Install dependencies:
cd frontend
npm install
  1. Start the Vite development server:
npm run dev

(The frontend will be accessible at http://localhost:5173)


πŸ” Environmental Variables

  1. Create a .env file in the backend directory and add the following keys:
PORT=5000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key

# Cloudinary Configuration
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
  1. Create a .env file in the frontend directory:
VITE_BACKEND_URL=http://localhost:5000

πŸ“‘ API Endpoints

Auth Routes (/api/auth)

Method Endpoint Description Access
POST /signup Register a new user Public
POST /login Authenticate & get token Public
PUT /update-profile Update user profile image Private
GET /check Verify authentication status Private

Message Routes (/api/messages)

Method Endpoint Description Access
GET /users Get all users for sidebar Private
GET /:id Get message history with user Private
POST /send/:id Send a message to a user Private
PUT /mark/:id Mark messages as seen Private

Status Routes (/api/status)

Method Endpoint Description Access
GET / Verify server status Public

πŸ“‚ Folder Structure

Talksy - Chat App/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ controllers/       # Route controller functions
β”‚   β”œβ”€β”€ lib/               # Database and Cloudinary configuration
β”‚   β”œβ”€β”€ middleware/        # Authentication middlewares
β”‚   β”œβ”€β”€ models/            # Mongoose database schemas
β”‚   β”œβ”€β”€ routes/            # Express route definitions
β”‚   β”œβ”€β”€ server.js          # Entry point for backend & Socket.io setup
β”‚   └── package.json       # Backend dependencies
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ public/            # Static public assets
β”‚   β”œβ”€β”€ context/           # React Context providers for global state
β”‚   β”œβ”€β”€ src/               
β”‚   β”‚   β”œβ”€β”€ assets/        # Images, icons, and static assets
β”‚   β”‚   β”œβ”€β”€ components/    # Reusable UI components (Sidebar, ChatContainer, etc.)
β”‚   β”‚   β”œβ”€β”€ lib/           # Utility functions and helpers
β”‚   β”‚   β”œβ”€β”€ pages/         # Full page views (HomePage, LoginPage, ProfilePage)
β”‚   β”‚   β”œβ”€β”€ App.jsx        # Main application component & routing setup
β”‚   β”‚   β”œβ”€β”€ index.css      # Global styles and Tailwind directives
β”‚   β”‚   └── main.jsx       # React DOM rendering entry point
β”‚   β”œβ”€β”€ index.html         # Main HTML entry point
β”‚   β”œβ”€β”€ vite.config.js     # Vite bundler configuration
β”‚   └── package.json       # Frontend dependencies and scripts
β”‚
└── Readme.md              # Project Documentation

🀝 Contributing

Contributions are always welcome!

If you find this project useful, please consider giving it a ⭐ β€” it really helps and is greatly appreciated.

Feel free to fork the repository and submit a pull request for any enhancements or bug fixes.

About

Talksy is a lightweight, real-time chat application designed for seamless communication. It features instant messaging, user-friendly interfaces, and scalable architecture. Built with modern technologies, Talksy focuses on speed, reliability, and a smooth user experience.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages