IN Lately Messaging apps are growing in popularity. Users prefer instant messengers because they allow them to interact in real time. In this article we will look at the creation process simple application for exchange instant messages. We won’t delve too deeply into the nuances of development: we will write a working messenger that can be improved in the future.

Technologies and tools used

  1. MEAN stack (Mongo, Express, Angular, Node).
  2. Sockets for direct messaging.
  3. AJAX for registration and login.

Preparation

The structure of the future application looks something like this:

The diagram should look something like this:

( "_id" : ObjectId("5809171b71e640556be904ef"), "name" : "Monkey proger", "handle" : "mkproger", "password" : "proger228", "phone" : "8888888888", "email" : " [email protected]", "friends" : [ ( "name" : "habrick", "status" : "Friend" ), ( "name" : "javaman", "status" : "Friend" ) ], "__v" : 0 )

Interlocutors can be assigned the following statuses:

  • Friend - the interlocutor is a friend.
  • Pending - the interlocutor has not yet accepted the request.
  • Blocked - the interlocutor is blocked.

Let's assume that the interlocutor declines the request for a private conversation. In this case, the sender should be able to resend the request.

It would be nice to implement the functionality for the user to save messages to additional collections. Let each of its objects contain a message, a sender, a recipient, and a time. Design your database to suit your specific message processing needs and methods.

You can also create a REST API to serve the client. For example, an endpoint sending home page, from which users can perform other queries.

Developing a messenger for smartphones or a website can become a successful startup. Messengers already occupy first place in terms of the number of downloads in the world.

Is it worth creating another messenger app?


Each user has two to five instant messengers installed on their phone. All of them are used to one degree or another.

Over time, some messenger applications lose their leadership positions, giving way to new ones. So, in one year, Skype moved from the first place, which it had occupied for several years, to fourth. Telegram is in fifth place. But it seems that this is also a temporary situation, since the same Telegram is quickly conquering the market. In 2017, a new trend emerged - public channels and chats. Their presence attracts new users, essentially turning instant messengers into social media. Perhaps this was the reason for the growth in popularity of Telegram.

Messenger popularity rating

Source vc.ru

Statistics on the growth in the number of messenger users show that messaging applications have potential. But when launching a startup, you need to be prepared for competition. The development of a messenger for iOS or Android begins with the correct formulation of the problem and selection of tools. This way we will get an application that will satisfy the needs of users.


How to create a messenger that is in demand among users

Initially, messengers were created either as chats, for example WhatsApp, or as an application for calls - Skype, Viber. Later, they began to add functions to messengers that were not originally there. So, WhatsApp added the functions of audio calls, then video. Then open APIs, bots, masks, statuses, payment acceptance, and public channels appeared. However, implement new functionality or changing the structure when the messenger has millions of users is difficult. For example, WhatsApp still does not have an API or bots.

The main difficulty when creating an application for sending messages on Android or iOS is developing the architecture. The application structure must be designed in such a way that new features can be added to it painlessly.

When developing a messenger, we base it not only on what is already in other applications, but also on what may be in demand in the future.

Our approach to developing messenger architecture

Most approaches to architecture design and development come down to modular system. But the modularity is different, and the modules themselves can be huge and monolithic.

We design and develop architecture according to the principles of Clean architecture.

Clean architecture, described by Robert Martin, allows you to design a system that is flexible and scalable.

In modern software This is a common practice, but not everyone can achieve Clean architecture. In our work, we adhere to a number of specific principles and obtain the expected result. The picture shows the new architecture that Google presented. Using this approach and our own improvements, we implement a clean architecture on Android.


Flexibility, scalability and testability

As we work, we make sure that the architecture is divided into autonomous layers. Then the business logic, presentation and data objects are separated and can change independently of each other. Regardless of the size of the system, this approach maintains its flexibility, scalability (scaling the number of functions) and testability.

We make not only the code scalable, but also the system infrastructure itself.

Application Performance

It often happens that teams are chasing a programming language that has become popular. They develop a client's product in it, but in the process they realize that they are using the language incorrectly. You need to understand all the pros and cons of any language and tool. You should use the language that is best suited for constructing effective system, and not the one that is now popular.

During the work process, we think about the client’s task and with this in mind we approach the selection of tools.

As a rule, we program in PHP. This programming language is used in Whatsapp, Facebook, Stackoverflow. PHP is not inferior to other languages ​​in terms of performance and can withstand high loads. The advantage of this language is that after completing a task, server resources are freed, and a properly constructed architecture and a good technology stack cover the shortcomings of the language.

The cost of developing a project in PHP is several times cheaper than in languages ​​like Java and Python. At the same time, the application is not inferior in performance.

When choosing tools, we focus on how effectively one or another of them can solve a problem. In essence, we adapt the tools to the architecture, and not vice versa.

Working with a large number of users and heavy loads

In our work we use the NodeJS platform. Our experience shows that this platform is suitable for creating chats and mobile applications. NodeJS is well designed and allows you to build highly loaded systems. Out of the box, chat on NodeJS can handle a load of 10,000 connections.

Developing a messenger for Android or iOS for this platform requires the use of Java Script. This language is popular, so finding developers is not a problem.

Rethink - we use this NoSQL DB because it is more productive than its competitors. In RethinkDB, the query language translator, the so-called ReQL, is not implemented at the server level, but is built in as a domain-specific language into the language in which the client application is written.

Database tables store JSON documents that allow any level of nesting. Each document has a unique primary key “id” for its parent table. Referring to the key, we get a document. Each ReQL query function operates on data obtained from the previous function in the chain. This allows you to build a more flexible architecture for high-load projects and not think about the complexity of data structures.

A competitor to NoSQL DBMS is MongoDB. This platform is popular in the market, but popularity is not always the key to success. MongoDB has a number of problems: deleting documents does not clear disk space, so the application must be built so that documents (object files) are not deleted frequently. MongoDB also does not work well with numerous bulk operations on documents, which is contrary to the rules for building a high-load system.

The main problem when building high-load projects is building an architecture and then adjusting the business logic of the system to it. Such a project does not always cope with heavy loads. Therefore, we do the opposite: we work out the business logic of the entire system, and then create an effective architecture for it. New functions can be added to such an application. It will not lose performance and is not afraid of high loads.


Messenger interface development

It should be clear to the user how to work, and it should be convenient to work. Therefore, we often recommend using native design, as it is convenient and predictable. The application behaves the same on different devices. The user sees familiar elements, knows how to use them, and has no questions about how to use the messenger.

When developing a design it is important:

    Work through empty states of chats, screens, sections where nothing has happened yet. This will make it clear to the user what action needs to be taken.

    Work through feedback. Sending messages and downloading files takes time. At this point, it is important to show the user that the process is in progress.

    All possible mistakes, for example, if the Internet is lost, the user must understand that something went wrong.

    To verify your phone number, set a time limit to repeat sending sms with a verification code, since the message may not yet arrive, and the user will have time to click to resend the code six times.

    Warn the user that he is using Mobile Internet at the time of sending a large file.




Convenience inside the chat and prevention of ridiculous mistakes

It is important to conveniently organize searches within a specific chat. Find quickly right moment in correspondence, a document, photo or video, without randomly scrolling through the feed.

Before sending voice messages, it is important that the user can listen to them. There should also be an option to correct the error or remove the unwanted message. Creating a Send Application iPhone messages or Android requires careful consideration of these and other nuances.

Privacy

On the Internet you can find programs that allow you to hack the messenger and receive personal correspondence. The first task of developers is to provide complete anonymity, even without being tied to a phone number and without the ability to somehow recognize a person. The second task is to eliminate the risk of hacking.

There are nuances here. For example, for a complete anonymous chat, the interlocutors, without reference to specific characteristics - phone number, name, location - must understand who is who. To do this, you need to use a one-time cipher that everyone can use, but it will not be repeated twice. Inviting people into such a conversation also occurs using a “key” that works only once and is set only by the person himself.

Screenshot protection. Encryption incoming notifications. The ability to quickly delete messages, without unnecessary confirmations.


How much does it cost to create your own messenger?

The price of developing a messenger depends on how long the work on the application will take. The more complex the functionality, the higher the development cost. We can name the final price for developing a messenger for iOS, Android or a website only after we understand what problems need to be solved.

Cost of promotion and support

Developing a messenger for Android or iOS is the first stage. If this is not a corporate chat, then the messenger needs to be promoted. To do this, you need to include a certain amount in your marketing budget. This includes:

    ASO promotion ( App Store Optimization) - a set of works for optimization mobile application. Namely, the correct composition of title (name), keywords ( keywords), descriptions, in order to maximize the visibility of your application in search

    Payment for placement in stores Google Play and App Store.

After launch, the application needs to be developed and updated:

    Eliminate errors and respond to user complaints

    Add new features.

Where to start creating an application for sending messages on Android or iPhone

The development of a custom messenger begins with setting the task.

Write or call us, we will arrange a meeting, discuss the problem and help you find optimal solution how to create a popular messenger for Android and iOS.

Our team, which is practically obsessed with information security, has implemented many interesting solutions in Eleet.

Below are eight product features that significantly affect your online security. Some of these ideas are completely unique: only Eleet Private Messenger offers this. Others, in one form or another, can be found among competitors, but we’ll tell you about them anyway: after all, what’s important is complex system, built by the Eleet development team.

So, let's begin.

1. No connection to the phone

The very first and most important. Today there are many messengers that claim to be high level security, but... almost always working with them begins with registration using a mobile phone number. Even FireChat, which operates over a distributed mesh network, has this drawback.

In our opinion, after this it no longer makes sense to talk about anonymity. One way or another, you told someone your phone number– and if it falls into the wrong hands, your identity and exact location will be very easy to establish.

Let's not forget about the banal method of bypassing authorization via SMS, which is so popular today: creating a duplicate SIM card. Mobile operators can easily do this in someone else's interests. Yes, the notorious “two-factor authentication” with code forwarding text message– is not nearly as reliable as many people think.

In any of these options, it will no longer matter how good the encryption is, whether the passwords are reliable... which is why there is no authorization by phone number in the Eleet messenger.

2. No connection to personality

This is not so much a specific function of the application as a general idea that we consistently implement - and it naturally follows from the previous point. So, your Eleet Private Messenger account has nothing to do with your real identity at all. By using our messenger, you leave no traces that will allow you to connect the real you with your real self. information space Eleet.

3. Private IDs

Still not sure if your account is untraceable? Good: create an additional private ID that has the full functionality of the “main” one. At the same time, all data associated with it (contacts, logs, content) will be stored separately and will disappear when the private ID is deleted - without leaving any traces in the main account.

4. Don’t “glow” online

One of the pleasant little things: users of our messenger have the opportunity to completely hide their online presence. No, we do not mean simply hiding the time of the last login - but full-fledged “invisibility”. Many people miss this in social networks, and messengers do not always offer such an opportunity.

5. You can really delete everything

This is not as small as it may seem. Most online communication tools allow you to delete logs and contacts on your side: but your interlocutors will still have both correspondence and your ID. It is difficult to call such conditions compliant with information security requirements.

Our application does not have this problem. You can easily remove yourself from the other person's contact list. Any other user will also not have logs of communication with you, if you want it. Therefore, no one will be able, for example, to blackmail you with compromising correspondence.

The fact is that this is just an additional layer of security, and not a key element of protecting the chat you created. The PIN is easy to remember and convenient to enter from any device: this, as a rule, cannot be said about a strong password.

The PIN code does not play a key role in information protection, but helps users feel even calmer.

7. Especially secret chats

Typically, when it comes to information security, the focus is on external surveillance: attackers, competitors, authorities. But what if you don't fully trust your own interlocutors?

It's simple: create an anonymous chat with them by entering any nickname. The people you communicate with in this chat will never know your real ID. At the same time, the chat can be made to “self-destruct” after a certain time.

8. And the most interesting thing!

Naturally, we saved our favorite feature for last. Eleet Private Messenger users can set a “delete pin code”. What it is?

From the outside it will seem as if you are entering a very ordinary PIN code (like the one described in the sixth paragraph). Regular authorization measure. In fact, with this command, Eleet will instantly delete all your data - correspondence, contacts, sent materials, and the like. And as you already know, by “deletion” our team means real, permanent deletion: nothing can be restored.

We will not list in what situations this function may turn out to be vital: we believe that readers themselves can imagine several options for this. As they say, “if you know what we mean.”

Finally, we repeat: Eleet Private Messenger was created by people for whom anonymity on the Internet reliable protection any personal data and virtual personal space are the most important values. All efforts of the development team serve to make Eleet as secure as possible at all levels.

As you can see, we have already done a lot in this direction. And even more will be implemented.

We constantly analyze customer requests for application development. Therefore, the fact that the demand for applications based on communication between users has increased has not escaped our attention.

We came up with our own, with a feature in the form of the ability to include additional logic in your messenger. For example, make a messenger a service ordering service, adding ads and filters, or an application for a consulting agency, in which clients will ask questions, and your specialists will advise them for a fee.

How did we come up with this idea?

At a certain period of time, we could not help but notice an increased interest in instant messengers, which are based on dialogue between people, and not chatbots, as, for example, in Telegram. It is necessary to understand the attractiveness of such projects.

Let's say you want to make an application a la Avito, where people post advertisements for the sale of used goods. The buyer scrolls through the feed or finds the product he needs, he does not need to wait for a response to the application, he immediately conducts a direct dialogue with the seller and makes an appointment. Fast, convenient, without a lot of calls and searching for a contact on WhatsApp or Telegram.

Having realized all the advantages of instant messengers based on communication between people, we decided to go further. We thought: “What will happen if the messenger is not forced into strict boundaries, but has the opportunity to include various functions? You will get a new boxed solution a la “install an analogue of WhatsApp on your server with the possibility of modifications.” A definite plus this decision the fact is that it will clearly cost less than in other studios when developed from scratch (for an analogue of WhatsApp, the average cost is from $45,000 to $55,000). This will allow you to test your idea at the right price and decide whether the project takes off or not.

What does the boxed solution already include?

  • Registration and authorization by phone number
  • User profile, he can fill in his full name and put his photo
  • List of users, contacts
  • List of dialogues
  • Chat Window
  • Message status

The main advantage of this boxed solution is its flexibility. You take the base from us and add whatever you want to it, depending on your goals and objectives. For example, viewing videos and photos, news feed, etc.

The application architecture looks like this:

  • Objective-C and Java for iOS and Android applications
  • Node.js - holding socket connections to receive messages in real time
  • Redis - we store a stack of messages to be sent
  • We use APN/FCM push server to send push notifications if the application is minimized
  • Bitrix.Framework for generating mobile application screens and flexible application development
  • MySQL - for storing users, access roles, message histories and custom application data
  • 1C-Bitrix - for administrative management of the messenger

Working with specific tasks

My friend, Pavel, not long ago turned to us for help. He owns a consulting agency specializing in increasing sales for wholesalers and manufacturers. His problem was that after completing the consulting, the client switched to consulting his assistants. This, ultimately, was reflected in the quality of the services provided, as well as in profits: due to the mistakes of his assistants, Pavel lost 50-100 thousand rubles a month.

He and I came up with a model that when implementing the messenger, he would be able to receive the following values:

  • Remotely provide consulting services in person, without loss of quality
  • Make video answers to the 40 most popular customer questions and, if another question from this stack arises, send a link to the video to the client without additional labor costs
  • Save on assistant salaries
  • Increase throughput services
  • Use in-app consultations as a wow effect for new sales of the main product

After talking, we came to the conclusion that several additional screens would be required in addition to the basic functionality:

  1. Group chat (so that clients “charge” each other)
  2. Screen with company service tariffs

A plus was the addition of a design branded to match the company’s corporate style. Taking into account our prices, the application came out to be a little more expensive than 100 thousand. Moreover, without being tied to us. Any PHP developer familiar with Bitrix.Framework could make these modifications for Pavel. On this moment The application is being finalized, but you can see linked mockups of the future application.

Development prospects

Due to the fact that our messenger project is primarily a startup, we are developing it in the Customer Development format. In the week and a half that has passed since the launch of the project, 9 licenses have already been sold. Clients who tried our packaged solution suggested development in the following directions:

  1. development of a function for adding various multimedia (photos, videos, files), active links to chat windows;
  2. working on improving the design;
  3. creating group chats.

What do you think about the development of this project? Is it worth actively adding functionality or is it better to leave the platform flexible, allowing any programmer to customize the application for the client?

If you are interested in our new boxed offer, then write to me by email. I'll be happy to answer any questions you may have.

Developing a messenger for smartphones or a website can become a successful startup. Messengers already occupy first place in terms of the number of downloads in the world.

Is it worth creating another messenger app?


Each user has two to five instant messengers installed on their phone. All of them are used to one degree or another.

Over time, some messenger applications lose their leadership positions, giving way to new ones. So, in one year, Skype moved from the first place, which it had occupied for several years, to fourth. Telegram is in fifth place. But it seems that this is also a temporary situation, since the same Telegram is quickly conquering the market. In 2017, a new trend emerged - public channels and chats. Their presence attracts new users, essentially turning instant messengers into social media. Perhaps this was the reason for the growth in popularity of Telegram.

Messenger popularity rating

Source vc.ru

Statistics on the growth in the number of messenger users show that messaging applications have potential. But when launching a startup, you need to be prepared for competition. The development of a messenger for iOS or Android begins with the correct formulation of the problem and selection of tools. This way we will get an application that will satisfy the needs of users.


How to create a messenger that is in demand among users

Initially, messengers were created either as chats, for example WhatsApp, or as an application for calls - Skype, Viber. Later, they began to add functions to messengers that were not originally there. So, WhatsApp added the functions of audio calls, then video. Then open APIs, bots, masks, statuses, payment acceptance, and public channels appeared. However, it is difficult to introduce new functionality or change the structure when the messenger has millions of users. For example, WhatsApp still does not have an API or bots.

The main difficulty when creating an application for sending messages on Android or iOS is developing the architecture. The application structure must be designed in such a way that new features can be added to it painlessly.

When developing a messenger, we base it not only on what is already in other applications, but also on what may be in demand in the future.

Our approach to developing messenger architecture

Most approaches to architecture design and development tend to be modular. But the modularity is different, and the modules themselves can be huge and monolithic.

We design and develop architecture according to the principles of Clean architecture.

Clean architecture, described by Robert Martin, allows you to design a system that is flexible and scalable.

This is a common practice in modern software, but not everyone can achieve Clean architecture. In our work, we adhere to a number of specific principles and obtain the expected result. The picture shows the new architecture that Google presented. Using this approach and our own improvements, we implement a clean architecture on Android.


Flexibility, scalability and testability

As we work, we make sure that the architecture is divided into autonomous layers. Then the business logic, presentation and data objects are separated and can change independently of each other. Regardless of the size of the system, this approach maintains its flexibility, scalability (scaling the number of functions) and testability.

We make not only the code scalable, but also the system infrastructure itself.

Application Performance

It often happens that teams are chasing a programming language that has become popular. They develop a client's product in it, but in the process they realize that they are using the language incorrectly. You need to understand all the pros and cons of any language and tool. You need to use the language that is best suited for building an effective system, and not the one that is currently popular.

During the work process, we think about the client’s task and with this in mind we approach the selection of tools.

As a rule, we program in PHP. This programming language is used in Whatsapp, Facebook, Stackoverflow. PHP is not inferior to other languages ​​in terms of performance and can withstand high loads. The advantage of this language is that after completing a task, server resources are freed, and a properly constructed architecture and a good technology stack cover the shortcomings of the language.

The cost of developing a project in PHP is several times cheaper than in languages ​​like Java and Python. At the same time, the application is not inferior in performance.

When choosing tools, we focus on how effectively one or another of them can solve a problem. In essence, we adapt the tools to the architecture, and not vice versa.

Working with a large number of users and heavy loads

In our work we use the NodeJS platform. Our experience shows that this platform is suitable for creating chats and mobile applications. NodeJS is well designed and allows you to build highly loaded systems. Out of the box, chat on NodeJS can handle a load of 10,000 connections.

Developing a messenger for Android or iOS for this platform requires the use of Java Script. This language is popular, so finding developers is not a problem.

Rethink - we use this NoSQL DB because it is more productive than its competitors. In RethinkDB, the query language translator, the so-called ReQL, is not implemented at the server level, but is built in as a domain-specific language into the language in which the client application is written.

Database tables store JSON documents that allow any level of nesting. Each document has a unique primary key “id” for its parent table. Referring to the key, we get a document. Each ReQL query function operates on data obtained from the previous function in the chain. This allows you to build a more flexible architecture for high-load projects and not think about the complexity of data structures.

A competitor to NoSQL DBMS is MongoDB. This platform is popular in the market, but popularity is not always the key to success. MongoDB has a number of problems: deleting documents does not clear disk space, so the application must be built so that documents (object files) are not deleted frequently. MongoDB also does not work well with numerous bulk operations on documents, which is contrary to the rules for building a high-load system.

The main problem when building high-load projects is building an architecture and then adjusting the business logic of the system to it. Such a project does not always cope with heavy loads. Therefore, we do the opposite: we work out the business logic of the entire system, and then create an effective architecture for it. New functions can be added to such an application. It will not lose performance and is not afraid of high loads.


Messenger interface development

It should be clear to the user how to work, and it should be convenient to work. Therefore, we often recommend using native design, as it is convenient and predictable. The application behaves the same on different devices. The user sees familiar elements, knows how to use them, and has no questions about how to use the messenger.

When developing a design it is important:

    Work through empty states of chats, screens, sections where nothing has happened yet. This will make it clear to the user what action needs to be taken.

    Process feedback. Sending messages and downloading files takes time. At this point, it is important to show the user that the process is in progress.

    All possible errors, for example, if the Internet is lost, the user must understand that something went wrong.

    To verify a phone number, set a time limit on resending an SMS with a verification code, since the message may not yet arrive, and the user will have time to click to resend the code six times.

    Warn the user that he is using mobile Internet at the time of sending a large file.




Convenience inside the chat and prevention of ridiculous mistakes

It is important to conveniently organize searches within a specific chat. Quickly find the right moment in correspondence, a document, photo or video, without randomly scrolling through the feed.

Before sending voice messages, it is important that the user can listen to them. There should also be an option to correct the error or remove the unwanted message. Creating an iPhone or Android messaging application requires careful consideration of these and other nuances.

Privacy

On the Internet you can find programs that allow you to hack the messenger and receive personal correspondence. The first task of the developers is to ensure complete anonymity, even without reference to a phone number and the ability to somehow recognize a person. The second task is to eliminate the risk of hacking.

There are nuances here. For example, for a complete anonymous chat, the interlocutors, without reference to specific characteristics - phone number, name, location - must understand who is who. To do this, you need to use a one-time cipher that everyone can use, but it will not be repeated twice. Inviting people into such a conversation also occurs using a “key” that works only once and is set only by the person himself.

Screenshot protection. Encryption of incoming notifications. The ability to quickly delete messages, without unnecessary confirmations.


How much does it cost to create your own messenger?

The price of developing a messenger depends on how long the work on the application will take. The more complex the functionality, the higher the development cost. We can name the final price for developing a messenger for iOS, Android or a website only after we understand what problems need to be solved.

Cost of promotion and support

Developing a messenger for Android or iOS is the first stage. If this is not a corporate chat, then the messenger needs to be promoted. To do this, you need to include a certain amount in your marketing budget. This includes:

    ASO promotion (App Store Optimization) is a set of works to optimize a mobile application. Namely, the correct composition of title (name), keywords (keywords), descriptions (description), in order to maximize the visibility of your application in search

    Payment for placement in the Google Play and App Store stores.

After launch, the application needs to be developed and updated:

    Eliminate errors and respond to user complaints

    Add new features.

Where to start creating an application for sending messages on Android or iPhone

The development of a custom messenger begins with setting the task.

Write or call us, we will arrange a meeting, discuss the problem and help you find the optimal solution on how to create a popular messenger for Android and iOS.