A modern real-time communication platform built with React, Express, MongoDB, and Socket.IO.
- React 18 with Vite for fast development
- Tailwind CSS for utility-first styling
- Material UI for component library
- Anime.js for smooth animations
- Three.js for 3D graphics
- Socket.IO Client for real-time communication
- Node.js with Express
- MongoDB with Mongoose ODM
- JWT for authentication
- Socket.IO for WebSocket connections
- bcryptjs for password hashing
Ping/
├── client/ # React Frontend
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── context/ # React Context providers
│ │ ├── pages/ # Page components
│ │ ├── services/ # API services
│ │ ├── socket/ # Socket.IO client
│ │ └── ...
│ └── ...
│
├── server/ # Express Backend
│ ├── config/ # Database config
│ ├── controllers/ # Route controllers
│ ├── middleware/ # Auth middleware
│ ├── models/ # Mongoose models
│ ├── routes/ # API routes
│ ├── socket/ # Socket.IO server
│ └── ...
│
└── README.md
- Node.js 18+
- MongoDB (local or Atlas)
- npm or yarn
-
Clone the repository
cd Ping -
Setup the Server
cd server cp .env.example .env # Edit .env with your MongoDB URI and JWT secret npm install
-
Setup the Client
cd ../client cp .env.example .env npm install -
Start MongoDB (if running locally)
mongod
-
Run the Development Servers
In one terminal (server):
cd server npm run devIn another terminal (client):
cd client npm run dev -
Open your browser Navigate to
http://localhost:3000
| Variable | Description | Default |
|---|---|---|
PORT |
Server port | 5000 |
MONGODB_URI |
MongoDB connection string | mongodb://localhost:27017/ping |
JWT_SECRET |
JWT signing secret | - |
CLIENT_URL |
Client URL for CORS | http://localhost:3000 |
| Variable | Description | Default |
|---|---|---|
VITE_API_URL |
Backend API URL | http://localhost:5000 |
VITE_SOCKET_URL |
Socket.IO server URL | http://localhost:5000 |
POST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/auth/me- Get current user (protected)POST /api/auth/logout- Logout user (protected)
GET /api/health- Server health check
message:private- Send private messagetyping:start- Start typing indicatortyping:stop- Stop typing indicator
user:online- User came onlineuser:offline- User went offlinemessage:receive- Receive messagetyping:indicator- Typing indicator
MIT License - feel free to use this project for your own purposes.
Built with ❤️ using modern web technologies