This is a full-stack chat application built with a microservices architecture for the backend and Next.js for the frontend. It features real-time chat, user authentication, email verification, and file sharing capabilities. [I have attached screenshots in the public folder, not able to deploy on AWS because credit card declined ;) ......]
- User Authentication: Secure user registration, login, and session management. 🔐
- Email Verification: Account verification via email. 📧
- Real-time Chat: Instant messaging with WebSocket support. ⚡
- Private and Group Chats: Create and manage one-on-one and group conversations. 👥
- File Sharing: Upload and share images and other files within chats (powered by Cloudinary). 📤
- User Profiles: View and manage user profiles. 👤
- Responsive UI: Modern and responsive user interface built with Next.js and custom UI components. 📱
- Next.js: React framework for building server-side rendered and static web applications. ⚛️
- React: JavaScript library for building user interfaces.
- TypeScript: Superset of JavaScript that adds static typing.
- Tailwind CSS (Implied): Utility-first CSS framework for rapid UI development. 🎨
- Socket.IO Client: For real-time communication with the chat service. 🌐
- Node.js: JavaScript runtime environment. 🟢
- TypeScript: Superset of JavaScript that adds static typing.
- Express.js (Implied): Web application framework for Node.js.
- MongoDB: NoSQL database for data storage (via Mongoose ORM, likely). 🍃
- Socket.IO: Library for real-time web applications. 🌐
- RabbitMQ: Message broker for inter-service communication (e.g., email queue). 🐇
- Cloudinary: Cloud-based image and video management service for file uploads. ☁️
- JWT (JSON Web Tokens): For secure authentication. 🔑
The project is organized into backend and frontend directories.
.
├── backend/
│ ├── chat/ # Chat microservice (real-time messaging, file sharing)
│ ├── mail/ # Email microservice (consumer for email queue)
│ ├── user/ # User authentication microservice (registration, login, profiles)
│ └── ... # Other backend configurations and shared files
├── frontend/
│ ├── public/ # Static assets
│ ├── src/ # Frontend source code
│ │ ├── app/ # Next.js pages and routes
│ │ ├── components/ # Reusable React components
│ │ ├── context/ # React context providers
│ │ ├── lib/ # Utility functions
│ │ └── ui/ # Custom UI components
│ └── ... # Other frontend configurations
└── README.md # This file
To get a local copy up and running, follow these simple steps.
- Node.js (v18 or higher)
- npm or yarn
- MongoDB instance (local or cloud-hosted)
- RabbitMQ instance (local or cloud-hosted)
- Cloudinary account
- Email service (e.g., Gmail, SendGrid) for sending verification emails
-
Clone the repository:
git clone https://github.com/Arjun8242/microservices-chat-app.git cd microservices-chatt-app -
Backend Setup: Navigate to each microservice directory (
backend/chat,backend/mail,backend/user) and install dependencies:cd backend/chat npm install cd ../mail npm install cd ../user npm install
Create
.envfiles in each microservice directory based on the provided examples (if any) and configure your environment variables (MongoDB URI, RabbitMQ URL, Cloudinary credentials, JWT secret, email service credentials, etc.). -
Frontend Setup:
cd frontend npm installCreate a
.env.localfile in thefrontenddirectory and configure your environment variables (e.g., API endpoint URLs, WebSocket URL).
-
Start Backend Services: In separate terminal windows, navigate to each backend microservice directory and start the development server:
# Terminal 1 for User Service cd backend/user npm run dev # Terminal 2 for Chat Service cd backend/chat npm run dev # Terminal 3 for Mail Service cd backend/mail npm run dev
-
Start Frontend Application: In another terminal window, navigate to the
frontenddirectory and start the Next.js development server:cd frontend npm run dev
The frontend application should now be running at http://localhost:3000 (or another port if configured).
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Your Name - [email protected] Project Link: https://github.com/Arjun8242/microservices-chat-app