Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chatify

A real-time chat application built with the MERN(MongoDB,Express.js,React and NodeJS) stack.

🔗 Live Demo: https://chatify-zbcq.onrender.com/

Features

  • Real-time messaging
  • User authentication
  • Rate limiting
  • Image uploads
  • Modern and responsive UI

Tech Stack

Frontend: React , Zustand, Tailwind CSS , DaisyUI
Backend: Node.js, Express, MongoDB, Socket.IO

API Documentation

Authentication Endpoints

Register a new user

Creates a new user account with email and password.

POST /api/auth/signup
Content-Type: application/json

{
    "fullName": "John Doe",
    "email": "johndoe@gmail.com",
    "password": "1234567"
}

Login

Authenticates a user and returns a JWT token.

POST /api/auth/login
Content-Type: application/json

{
    "email": "johndoe@gmail.com",
    "password": "1234567"
}

Logout

Logs out the current user and invalidates the session.

POST /api/auth/logout

Check authentication status

Verifies if the current user is authenticated.

GET /api/auth/check

Message Endpoints

Get all contacts

Retrieves a list of all users available for chatting.

GET /api/messages/contacts

Get user's chats

Fetches all active chat conversations for the authenticated user.

GET /api/messages/chats

Get messages with a specific user

Retrieves the message history between the authenticated user and another user.

GET /api/messages/:id

Send a message

Sends a text message to a specific user.

POST /api/messages/send/:id
Content-Type: application/json

{
    "text": "Your message here"
}

Setup

  1. Clone the repository
git clone https://github.com/iurig21/chatify.git
cd chatify
  1. Install dependencies
npm run build
  1. Configure environment variables

Create .env in the backend folder:

MONGODB_URI=your_mongodb_uri
JWT_SECRET=your_jwt_secret
CLOUDINARY_CLOUD_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_cloudinary_key
CLOUDINARY_API_SECRET=your_cloudinary_secret
RESEND_API_KEY=your_resend_key
ARCJET_KEY=your_arcjet_key
PORT=5000
  1. Run the app

Development:

cd backend && npm run dev
cd frontend && npm run dev

Requirements

  • Node.js >= 18.17.0
  • MongoDB database

Made by @iurig21

About

Chat Full-Stack App

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages