A full-stack real-time chat application with authentication, image sharing, rate limiting, and transactional email — built with the MERN stack and Socket.io.
- 💬 Real-time one-on-one messaging via Socket.io (WebSockets)
- 🔐 User authentication (signup/login) with JWT
- 🖼️ Image sharing in chat, stored via Cloudinary
- 🛡️ API rate limiting & bot protection with Arcjet
- 📧 Transactional emails (e.g. welcome/notification emails) via Resend
- 🟢 Online/offline user presence
- 📱 Responsive UI
Frontend: React, (state management/styling as used in the project) Backend: Node.js, Express Database: MongoDB Atlas Real-time: Socket.io Image storage: Cloudinary Security/rate limiting: Arcjet Email: Resend Deployment: Render
Text-Me/
├── Backend/ # Express server, REST API, Socket.io server
└── Frontend/ # React client
The frontend communicates with the backend via REST for auth/data operations and maintains a persistent WebSocket connection (Socket.io) for real-time message delivery and presence updates.
Building and deploying this project surfaced several real production issues, each of which shaped the final architecture:
- Silent request stalls from Arcjet middleware — a missing
next()call in the Arcjet middleware caused requests to hang indefinitely with no error thrown, since Express never proceeded past the middleware. Root-caused by tracing the middleware chain and confirming the request never reached the route handler. - Linux case-sensitivity bug — a folder named
Hooksbroke imports when deployed on a case-sensitive Linux filesystem (it worked locally on Windows/Mac, which are case-insensitive). Fixed via a two-stepgit mv(renaming through an intermediate name) so git would properly register the case change. - CORS errors in production — caused by a misconfigured
CLIENT_URLenvironment variable not matching the deployed frontend origin. express.staticpath resolution issues — incorrect relative paths caused static assets not to be served correctly after deployment.- Resend email delivery blocked — emails failed to send in production due to Resend's test-domain sending restrictions; resolved by verifying a proper sending domain.
- MongoDB Atlas DNS resolution failure — Node.js couldn't resolve the MongoDB Atlas SRV DNS record on certain networks; fixed by forcing Google's public DNS via
dns.setServers()in the connection setup.
- Node.js (v18+)
- MongoDB Atlas account
- Cloudinary account
- Arcjet account
- Resend account
# Clone the repo
git clone https://github.com/Vader-codes/Text-Me.git
cd Text-Me
# Install backend dependencies
cd Backend
npm install
# Install frontend dependencies
cd ../Frontend
npm installCreate a .env file in Backend/ with:
MONGODB_URI=your-mongodb-atlas-connection-string
JWT_SECRET=your-jwt-secret
CLOUDINARY_CLOUD_NAME=your-cloudinary-name
CLOUDINARY_API_KEY=your-cloudinary-key
CLOUDINARY_API_SECRET=your-cloudinary-secret
ARCJET_KEY=your-arcjet-key
RESEND_API_KEY=your-resend-key
CLIENT_URL=http://localhost:5173
# Start backend (from Backend/)
npm run dev
# Start frontend (from Frontend/)
npm run devBipin — @Vader-codes