A high-performance, real-time 1-to-1 chat application built with Flutter 3.x and a Node.js backend powered by Redis for ephemeral message storage and Socket.io for instant bidirectional communication.
- Real-time Messaging: Instant message delivery using Socket.io (WebSocket).
- Ephemeral Chat: Messages are stored in Redis with TTL (Time-To-Live), ensuring privacy and automatic cleanup.
- Cross-Platform: Flutter app runs on Android, iOS, and Web.
- Scalable Backend: Designed with Redis for high-speed read/write operations.
- Modern UI: Dark-themed, premium interface using Google Fonts (Outfit).
- Status Updates: Real-time "Chat Started" and "Chat Ended" notifications.
- Framework: Flutter
- Networking:
socket_io_client - Typography:
google_fonts - State Management:
setState/StreamController
- Runtime: Node.js
- Framework: Express.js
- Real-time Engine: Socket.io
- Database: Redis (used for session management and message buffer)
├── flutter_chat_app/ # Flutter application source code
│ ├── lib/
│ │ ├── models/ # Data models (Message)
│ │ ├── screens/ # UI Screens (Login, Home, Chat)
│ │ └── services/ # SocketService singleton
│ └── pubspec.yaml
│
└── redis-chat-backend/ # Node.js Server source code
├── src/
│ ├── config/ # Redis configuration
│ ├── services/ # Chat business logic
│ ├── socket/ # Socket.io event handlers
│ └── server.js # Entry point
└── package.json- Flutter SDK installed.
- Node.js (v16+) installed.
- Redis server running locally or via Docker.
Navigate to the backend directory, install dependencies, and start the server.
cd redis-chat-backend
# Install dependencies
npm install
# Start Redis (if using Docker)
# docker run --name redis-chat -p 6379:6379 -d redis
# Start the server
npm startThe server works on port 3000 by default.
Navigate to the app directory, install dependencies, and run.
cd flutter_chat_app
# Get packages
flutter pub get
# Run on Android Emulator or Real Device
flutter runNote for Real Devices: The app is configured to connect to
XXX.XXX.XX.XX:3000. Ensure your phone and computer are on the same Wi-Fi network and your firewall allows connections on port 3000.
Contributions are welcome! Please fork the repository and submit a pull request for any enhancements or bug fixes.
This project is licensed under the MIT License - see the LICENSE file for details.
flutter redis chat-application real-time-chat one-to-one-chat session-based in-memory-database backend frontend mobile-app