MessengerMesh is a scalable, real-time messaging platform built with a microservices architecture. It provides secure authentication, encrypted messaging, channel-based communication, file sharing, and presence notifications. The platform consists of a robust backend API, a modern React-based frontend, and supporting services for real-time features.
- Features
- Architecture
- Services
- Technologies
- Prerequisites
- Setup and Installation
- Usage
- API Documentation
- Testing
- Deployment
- Contributing
- License
- Secure Authentication: JWT-based authentication with refresh tokens
- Real-time Messaging: WebSocket support for instant messaging
- Channel-based Communication: Create and manage channels for group conversations
- End-to-End Encryption: Client-side encryption for message security
- File Sharing: Upload and share files via MinIO integration
- Presence Indicators: Real-time online/offline status updates
- Rate Limiting: Protection against abuse with configurable rate limits
- Scalable Architecture: Microservices design for horizontal scaling
- Modern UI: Responsive React frontend with Tailwind CSS
MessengerMesh follows a microservices architecture with the following components:
- Core Auth Messaging Service: Main backend service handling authentication, messaging, and data persistence
- Frontend: React-based user interface
- Notification Presence Service: Handles real-time notifications and presence updates
- Databases: MongoDB for main data, Redis for caching and pub/sub, MinIO for file storage
Services communicate via REST APIs and WebSockets, with Redis providing pub/sub functionality for real-time features.
The core backend is built with Spring Boot and provides:
- User authentication and authorization
- Message and channel management
- File upload/download
- WebSocket endpoints for real-time communication
- RESTful API endpoints
- Security features including JWT tokens and rate limiting
Key Technologies:
- Java 17
- Spring Boot 3.2.0
- Spring Security
- Spring Data MongoDB
- Spring WebSocket
- JWT (JJWT)
- MinIO for file storage
- Redis for caching
A modern, responsive web application built with React and TypeScript.
Key Features:
- User registration and login
- Real-time chat interface
- Channel management
- File sharing
- Presence indicators
- Responsive design
Key Technologies:
- React 18
- TypeScript
- Vite for build tooling
- Tailwind CSS for styling
- Axios for API calls
- SockJS + STOMP for WebSocket communication
- Zustand for state management
- React Hook Form + Zod for form validation
A Node.js service handling real-time notifications and user presence.
Key Features:
- Real-time presence updates
- Notification broadcasting
- Socket.IO integration
Key Technologies:
- Node.js
- Socket.IO
- Redis for pub/sub
- Express.js
- Backend: Java, Spring Boot, MongoDB, Redis, MinIO
- Frontend: React, TypeScript, Vite, Tailwind CSS
- Real-time: WebSocket, Socket.IO, STOMP
- Infrastructure: Docker, Docker Compose
- Testing: JUnit, Testcontainers, Vitest, React Testing Library
- CI/CD: GitHub Actions
- Docker and Docker Compose
- Node.js 20+ (for frontend development)
- Java 17+ (for backend development)
- Maven 3.8+ (for backend builds)
-
Clone the repository:
git clone https://github.com/your-username/messengermesh.git cd messengermesh -
Set up environment variables: Create a
.envfile in the root directory:APP_JWT_SECRET=your-super-secret-jwt-key-here -
Start the development environment:
docker-compose -f docker-compose.dev.yml up -d
This will start all services including databases, backend, frontend, and notification service.
-
For frontend development (optional): If you want to run the frontend in development mode with hot reloading:
cd services/frontend npm install npm run dev -
Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8080
- Notification Service: http://localhost:4000
- MinIO Console: http://localhost:9000 (admin/admin)
- Register a new account or login with existing credentials
- Create or join channels for group conversations
- Send messages in real-time
- Share files by uploading them to channels
- View presence indicators to see who's online
The backend provides a RESTful API. Here are some key endpoints:
POST /api/v1/auth/login- User loginPOST /api/v1/auth/register- User registrationGET /api/v1/channels- Get user's channelsPOST /api/v1/channels- Create a new channelGET /api/v1/messages/{channelId}- Get messages for a channelPOST /api/v1/messages- Send a message
For WebSocket communication, connect to /ws endpoint using STOMP protocol.
API documentation is available via Swagger UI at http://localhost:8080/swagger-ui.html when the backend is running.
An OpenAPI specification is also generated at openapi.yaml in the project root.
cd services/core-auth-messaging-service
mvn testcd services/frontend
npm testEnd-to-end tests are available in the backend service using Testcontainers.
-
Build the services:
docker-compose build
-
Deploy:
docker-compose up -d
For production, configure the following environment variables:
- Database URIs
- JWT secrets
- MinIO credentials
- Redis connection details
- 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
Please ensure all tests pass and code follows the project's style guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
Built with ❤️ using microservices architecture for scalability and maintainability.