A modern, real-time chat application built with Next.js, TypeScript, and Socket.io. Features user authentication, real-time messaging, online status indicators, typing indicators, and a beautiful UI.
- 🔐 User Authentication - Secure login and registration system
- 💬 Real-time Messaging - Instant message delivery using Socket.io
- 👥 User Management - View all users with online/offline status
- 🔍 Search Functionality - Search users by name or email
- ⌨️ Typing Indicators - See when someone is typing
- 🎨 Modern UI - Beautiful, responsive design with Tailwind CSS
- 🔒 Protected Routes - Secure access to chat features
- 📱 Responsive Design - Works seamlessly on desktop and mobile devices
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS 4
- Real-time Communication: Socket.io Client
- Authentication: Cookie-based authentication
- State Management: React Context API
Before you begin, ensure you have the following installed:
- Node.js 18+
- npm, yarn, pnpm, or bun
- A backend API server running (see Backend Configuration)
- Clone the repository:
git clone <repository-url>
cd chatApp- Install dependencies:
npm install
# or
yarn install
# or
pnpm install- Set up environment variables:
Create a
.env.localfile in the root directory:
NEXT_PUBLIC_BACKEND_API_URL=http://localhost:5000Replace http://localhost:5000 with your backend API URL.
Start the development server:
npm run dev
# or
yarn dev
# or
pnpm devOpen http://localhost:3000 in your browser.
Build the application:
npm run build
# or
yarn build
# or
pnpm buildStart the production server:
npm start
# or
yarn start
# or
pnpm startThis application requires a backend API server. The frontend communicates with the backend through:
- API Proxy Route (
/api/proxy) - Proxies requests to the backend API - Socket.io Connection - Direct WebSocket connection for real-time features
| Variable | Description | Default |
|---|---|---|
NEXT_PUBLIC_BACKEND_API_URL |
Backend API server URL | http://localhost:5000 |
If you're experiencing socket connection problems:
- Verify
NEXT_PUBLIC_BACKEND_API_URLis correctly set in.env.local - Ensure the backend server is running
- Check browser console for connection errors
- Verify CORS settings on the backend
If authentication isn't working:
- Check that cookies are enabled in your browser
- Verify the backend API is responding correctly
- Check the browser's Network tab for API errors
- Ensure the proxy route is correctly forwarding requests
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is private and proprietary.
For issues and questions, please open an issue in the repository.