Shubham Aggarwal
Shubham Aggarwal

Reputation: 121

erlang ejabberd chat app

Hey I am developing a private chat app on iOS in erlang using ejabberd. But I am not much aware of how to get started. I have installed erlang and ejabberd both on Macbook Pro and I will be deploying everything on Heroku. Here are few requirements:

  1. I want to minimize the use of erlang as I will be more comfortable to program backend in python, php, java. (but this is not a big issue. I will need tutorials).

  2. I wish to store messages in case if receiver is offline, I don't want any message to be missed. Also, I want a good authentication system.

    Please give me suggestions and i need some tutorials so that I can do what I wish to.

Upvotes: 1

Views: 1008

Answers (2)

Mickaël Rémond
Mickaël Rémond

Reputation: 9055

If your load is moderate, you can custom ejabberd external authentication mechanism.

Protocol and example script is provided in ejabberd documentation: https://www.ejabberd.im/files/doc/dev.html#htoc9

Upvotes: 1

Jason
Jason

Reputation: 43

I can answer your first question/requirement better than the second. I worked on a game -- a live fantasy draft app actually -- that was built using ejabberd. I think the key to minimizing erlang is to use ejabberd entirely as a transport layer. Instead of extending it, write a special administrative client to broker interactions in the "room". We called this the bot. In a given draft there was one bot and however many live participants. Then it was a simple matter of defining a message protocol that the bot and the clients understood. Some messages were game moves, some plain chat messages. The bot managed rules of play and data persistence, writing to a database.

Your next two questions (availability and authentication) are very broad. ejabberd does have some security built in but I don't know your needs. I'd address the availability via some sort of failover. Alternatively, you could use a queueing service such as Amazon SNS in front of your chat server but this would add both cost and complexity.

Upvotes: 2

Related Questions