hitup messenger
a fully functioning chat messenger (like whatsapp) built using flutter.
about the project
- flutter for building the android & ios app.
- firestore database for storing user data.
- firebase storage for storing images.
- mqtt as messaging protocol hosted in aws ec2.
- sqlite for storing contacts & chats in local database.
- onesignal for push notifications.
features
super fast messaging using mqtt protocol (mqtt is used by facebook messenger)
architecture:
when you send a message from the app, the message first goes to the mqtt server. then the mqtt server sends the message directly to the device of the client who is supposed to receive it. when received, the client stores the message in the local sqlite database first then shows it to the chat screen. (firestore is in no way used to store or send text messages. firestore is used only to store user & contacts data). to learn more about mqtt please refer here.
phone number authentication sign-in
authentication is done using firebase.
sending images
send & receive images (snapchat style ui).
the images are not stored in gallery. instead they are stored in the local sqlite database in bytes format.
super fast loading of messages (using sqlite as local db to store messages)
even when the client is offline, he/she can view the messages on opening the chat screen, because the messages are loaded directly from the local sqlite db. and that is the only place where the messages are stored. the mqtt server doesn’t store old messages. the mqtt server only stores the last message sent and then replaces it when a new message is sent.
sending texts to phone contacts
on the contacts screen, you will get a list of all your phone contacts who are also using the messenger and can chat with them. (just like sending messages to your contacts in whatsapp)
adding contacts using username. sending & receiving friend requests
you can also send friend request to someone using their username. on sending friend request, the other user will get a push notification & and a friend request. if he/she accepts the request then you will get an notification & will be able to chat with the user. (same as the feature in snapchat)
block contact
realtime push notifications
using onesignal. user will get realtime push notifications (even when the app is closed) when
- he/she receives a new message
- he/she receives a friend request
- someone accepts their friend request
change profile photo
image compression before sending
emoji support
neumorphic ui
invite friends feature
other important information
installation & setup (optional)
- firebase
to change the firestore database, just replace the google-services.json in android/app to your own google-services.json file from your firebase account.
- mqtt server
to transfer messages i am using an mqtt server which i have setup in a ec2 instance on aws. for details on how to setup your own mqtt server please refer here : setup mqtt server on aws ec2. then change the serveraddress parameter in lib/functions/mqttfunction.dart file, (connect() function) to the public address of your ec2 instance.
- onesignal
first create an account in onesignal. then replace the app_id parameter in lib/functions/userdatafunction.dart sendnotification() function with your own onesignal app_id.
motivation & contribution
i want to build this messenger into the biggest open source messenger on the web with all functionalities from the top messengers like whatsapp, telegram, signal, snapchat, etc. there a lot of features still to be added like end-to-end encryption, audio messages, audio/video calling, stories, etc. so, we are open to pull requests. please contribute in any way you can, adding new features, finding or fixing bugs, adding to the documenation, better code commenting, etc.
contributing
if you want to contribute to this project other than by coding, please contact me here [email protected]
Comments are closed.