Next.js Chat App is a secure, real-time messaging platform built with Next.js 15, Socket.IO, and end-to-end encryption (E2EE) to ensure privacy-first communication. Designed for seamless group chats, reactions, file sharing, and OAuth login, this app is the perfect solution for secure online conversations.
- End-to-End Encryption (E2EE) β Secure messages with advanced encryption.
- Private Key Recovery β Retrieve your encryption key with MFA-protected email verification.
- Real-time Messaging β Instantly send and receive messages.
- Message Editing β Edit messages after sending (with an edit indicator).
- Message Reactions β React to messages with emojis (double-tap to like/unlike).
- Message Deletion β Delete messages after sending.
- Typing Indicators β See when someone is typing.
- Message Seen Status β Know when your message is read.
- Push Notifications β Stay updated with real-time alerts.
- User Presence β See whoβs online in real time.
- Friends System β Add friends and chat with them.
- Group Chats β Create and participate in group conversations.
- Polling β Create polls with single/multiple voting options.
- GIF Support β Send animated GIFs (powered by Tenor).
- File Sharing β Send and receive files securely.
- OAuth Integration β Sign in with Google & GitHub.
- PWA Support β Install next-js-chat-app as a Progressive Web App for a native-like experience.
βοΈ Startups & Teams β Secure & private team collaboration π
βοΈ Developers β Learn how to build a real-time chat app π¨βπ»
βοΈ Open-Source Enthusiasts β Contribute & improve the project π
βοΈ Personal Use β Chat privately with friends & family π¬
- βοΈ Next.js 15 + React 19 β Modern full-stack React framework.
- π οΈ Redux Toolkit + React-Redux β Efficient global state management.
- π React Hook Form + Zod β Form handling & schema validation.
- π Socket.IO Client β Real-time communication.
- π Date-fns β Date & time utilities.
- π₯ Framer Motion + Lottie-React β Animations & dynamic UI effects.
- π₯ Firebase β Push notifications & backend integration.
- π Tailwind CSS β Responsive & scalable UI.
- π Nodemailer β Email handling.
- π bcryptjs + jose β Authentication & encryption.
- π¬ Emoji-Picker-React + Gif-Picker-React β Interactive media in chat.
- π οΈ Prisma ORM β Database management.
- π’ Node.js + Express β Scalable backend API.
- π Socket.IO β Real-time bidirectional communication.
- ποΈ Prisma ORM β Type-safe database management.
- π JWT Authentication (jsonwebtoken) β Secure authentication.
- βοΈ Cloudinary β Cloud storage for images & files.
- π§ Nodemailer β Email notifications & MFA verification.
- π Passport.js + Google OAuth β OAuth-based authentication.
- π₯ Firebase Admin SDK β Push notifications.
- π‘οΈ Helmet β Security headers for protection.
- π Morgan β HTTP request logging.
- πͺ Cookie-Parser β Secure cookie handling.
- π οΈ Multer β File uploads.
- π CORS β Cross-origin requests.
- π οΈ UUID β Unique ID generation.
- βοΈ dotenv β Environment variable management.
git clone https://github.com/RishiBakshii/nextjs-chat-app
cd nextjs-chat-app
- Navigate to the backend folder.
- Copy
.env.example
and rename it to.env
. - Replace the placeholder values with actual credentials.
- Make sure
backend/src/firebase-admin-cred.json
is correctly set up for Firebase authentication.
π Example (backend/.env
):
NODE_ENV=DEVELOPMENT
PORT=8000
JWT_SECRET=your-secure-jwt-secret
DATABASE_URL=your-database-url
FIREBASE_CREDENTIALS_PATH=./src/firebase-admin-cred.json
- Navigate to the frontend folder.
- Copy
.env.development.example
and rename it to.env.development
. - Copy
.env.production.example
and rename it to.env.production
. - Fill in your API keys and URLs.
π Example (frontend/.env.development
):
NEXT_PUBLIC_TENOR_API_KEY=your-tenor-api-key
NEXT_PUBLIC_FIREBASE_API_KEY=your-firebase-api-key
NEXT_PUBLIC_BASE_URL=http://localhost:8000/api/v1
NEXT_PUBLIC_CLIENT_URL=http://localhost:3000
π¨ Important Notes:
- Never expose sensitive credentials in
NEXT_PUBLIC_
variables. - Ensure the correct Firebase and API URLs are set.
cd backend
npm install
npm run dev
The backend will start at http://localhost:8000.
cd frontend
npm install
npm run dev
Visit http://localhost:3000 in your browser.
Contributions are welcome! To contribute:
- Fork the repository.
- Create a branch:
git checkout -b feature-branch
- Commit your changes:
git commit -m "Add new feature"
- Push to GitHub:
git push origin feature-branch
- Open a Pull Request π
For feedback or queries, reach out:
π© [email protected]