Introducing SAMA — Simple but Advanced Messaging Alternative chat server

Igor Khomenko
SAMA communications
3 min readMar 15, 2023

If you’re tired of using complicated chat servers with too many features that you don’t use, or if you’re looking for a more intuitive and comprehensive chat platform, then you might want to try a Simple but Advanced Messaging Alternative (SAMA) chat server.

But just because a chat server is simple doesn’t mean it’s not advanced. In fact, a simple chat server can be more advanced than its more feature-packed counterparts in several ways. For example, a simple chat server may offer end-to-end encryption by default, meaning that your messages are always protected from prying eyes. Moreover, it may also have advanced scalability features to serve growing user base.

Why we build SAMA

The intention of our messaging protocol and chat server, which are different from others, is to provide an alternative solution to the wide spread XMPP messaging protocol (and to be honest — the only wide spread ‘standard’ these days).

XMPP is huge. It covers pretty much every possible use cases that are possible to be used for one purpose/step. These two facts are the main advantage and disadvantage at the same time.

Things that we personally (as well as plenty of other people) dislike about XMPP:

  • Long connection & authentication flow, with a complex session resumption management.
  • Lots of noisy traffic when using Roster for contact list.
  • Group chats are not a part of core protocol, fro this reason there are many diffs in implementation while using private and group messaging.
  • Group chats require joining the room.
  • Complex and limited recent chats list implementation which is based on top of MAM XEP which always leads to implementing an additional separated HTTP service.
  • HTTP API is not a part of core protocol. HTTP API is very convenient for some operations like user signup, retrieve recent chats list, retrieve chat messages, block list, contact list etc.
  • Because of a great number of diff XEPs, the newcomers face difficulties in picking the right direction that should be used.

In fact, the authors behind SAMA have 10+ years experience in building messaging apps and services based on top of XMPP protocol.

Taking everything about XMPP into consideration, with SAMA our goals are the following:

  • to provide the minimal but enough features set for implementing standard chat app and cover 90% use cases
  • super simple and clean API. There should be one – and preferably the only one –obvious way to do something.
  • out of the box clustering support — spine as many servers as needed to support a big user base.

Therefore, we can summarise it with a Zen of SAMA and list its principles as follows:

  • Simple is better than complex.
  • There shouldn’t be a range of possible ways to choose from but the only one that is checked and the most convenient
  • If the implementation is hard to explain, it’s a bad idea.
  • Single chat platform should be enough to cover 90% of standard chat app use cases.
  • For a bigger user base you just need to spine one more server.

SAMA Features

SAMA server supports all modern chat app features as follows:

  • 1–1 chats
  • Group chats
  • Typing/Sent/Read statuses
  • File attachments
  • Messages history API
  • Users management
  • Block list
  • Multiple devices support
  • Online/Offline messages delivery
  • Manage user online/offline statuses
  • Last activity
  • Address Book / Contact list
  • APNS/FCM/Web push notifications supported
  • Clustering / support large user base

More features to come:

  • Administration HTTP API
  • System messages / PubSub
  • Organizations
  • XMPP interoperability

Deployment

SAMA server can be easily deployed locally or on any server.

Follow the GitHub repository guide https://github.com/SAMA-Communications/sama-server#development regarding how to spine a SAMA server.

Frontend

No server solution makes sense without a frontend app which can be used by users. For a demo purpose we have developed SAMA client — an open source React app which can be used to test/play with if not all but most of the available features https://github.com/SAMA-Communications/sama-client

What’s next

So, now is the particular and precise moment to try SAMA server and gather/provide feedback. Run SAMA server https://github.com/SAMA-Communications/sama-server locally — any thoughts, feedback is welcome.

We will be very thankful for every GitHub star, issue or comment!

👀 Check out more posts on our page

SAMA team

--

--

Igor Khomenko
SAMA communications

Software craftsman, RTC pro, love programming and clouds, XMPP, WebRTC, secure messaging, chat bots