Skip to content

yooniqx/ChatApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chat App

Real-time chat with Socket.io. Add friends, see who's online, chat instantly.

What it does

  • Register/login
  • Search & add friends
  • Real-time messaging
  • Online/offline status
  • Typing indicators
  • Read receipts

Stack

Frontend: React, Socket.io-client
Backend: Node.js, Express, Socket.io
DB: MongoDB
Auth: JWT

Running it

Backend:

cd server
npm install
npm start

Port: 5002

Frontend:

cd client
npm install
npm start

Port: 3000

Env vars

server/.env:

PORT=5002
MONGODB_URI=mongodb://localhost:27017/chatapp
JWT_SECRET=your_secret_key

How to use

  1. Make an account
  2. Click "Add Friend" and search for users
  3. Click on a friend to chat
  4. Type and send messages

Socket events

Client sends:

  • join - go online
  • sendMessage - send msg
  • typing - typing status

Server sends:

  • receiveMessage - new message
  • userOnline / userOffline - status updates

API endpoints

Route What it does
POST /api/auth/register Sign up
POST /api/auth/login Log in
GET /api/users/search Find users
GET /api/users/friends My friends
POST /api/users/friends/:id Add friend
GET /api/messages/:userId Chat history

Built to learn Socket.io and real-time features.

About

Chatting app for everybody

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors