Real-Time Chat App
Zync
A Firebase chat app with statuses, voice notes, and media and location sharing.

- Built with
- Flutter
- Firebase Auth
- Cloud Firestore
- FCM
- Cloudinary
- flutter_map
- record
- just_audio
- Platforms
- Android, iOS
- Year
- 2026
- Source code
- View Zync on GitHub (opens in a new tab)
What it does
Phone sign-in with a one-time code through Firebase Auth, with a country code picker.
Text, image, video, audio, document, location and voice messages, with replies, read receipts and typing indicators.
Statuses that disappear after 24 hours, plus online and last-seen presence.
Images and videos uploaded to Cloudinary; shared locations shown on an OpenStreetMap map.
Push notifications while the app is open, and tapping one opens the right chat.
How it’s built
Zync runs on Firebase: Auth for phone sign-in, Cloud Firestore for users, chats, messages and statuses, and Cloud Messaging for notifications. Screens listen to Firestore query snapshots through StreamBuilder. New messages, typing states and read receipts appear without a manual refresh. Riverpod’s ProviderScope wraps the app, but the live data comes straight from these streams.
Every one-to-one chat has a predictable ID: the two user IDs, sorted and joined. Either phone can open the same chat document without a lookup. A chat document holds the participants, the last message, an unread count per user and a typing flag per user; its messages sit in a subcollection ordered by send time. Opening a chat resets your unread count and marks the other person’s messages as read in one batch write.
Images and videos upload to Cloudinary with the cloudinary_public package, and a video's thumbnail comes from a change to its Cloudinary URL. Voice notes are recorded with the record package and played with just_audio. Locations come from geolocator and render inside the message bubble on an OpenStreetMap map through flutter_map.
Hardest part
Statuses were the trickiest query. They should only show for your contacts and only for 24 hours. The app asks Firestore for statuses from up to ten contact IDs that were updated within the last day, then drops individual items older than 24 hours on the phone. It currently covers the first ten contacts. Your own expired statuses are deleted by the app itself, since there is no server job to clean them up.
While Zync is open, incoming messages show as local notifications. When a notification is tapped, whether the app was in the background or closed (checked with getInitialMessage), the chat ID in its data opens the right conversation through a global navigator key. Presence works on the same principle: the app writes isOnline and a server-timestamped lastSeen when its lifecycle state changes.
