Need a kickstart

50 views
Skip to first unread message

Al

unread,
Jul 8, 2015, 7:48:34 AM7/8/15
to ape-p...@googlegroups.com
Hello,

I was looking at APE as a possible solution for multi channel chatting solution.
I read through the documentation and I must say it is very poor :(
Nowhere I could find any walk-through regarding the implementation of server-side logic. Yes there are some API documentation but this is not much of an information if you never did anything with APE before.


What I'm looking to achieve is something like this:

Multi channel chat where a user can join a channel and chat with everyone else.
The user must be registered and logged in.
On joining the channel the user will get a subset of latest messages (from DB I guess) with the possibility to request even older ones.
Possibility for private messaging with options like block/ignore other user, add-as-friend, de-friend (again, all goes to DB).

When a user is online he also joins automatically another channel, his "friends-hub" where he get notified when friends are active on other channels.


Can all this be achieved with APE?


I will appreciate if someone could share some code to get me started.

Thanks!

Nicolas

unread,
Jul 8, 2015, 8:06:59 AM7/8/15
to ape-p...@googlegroups.com
Yes all this is possible (and more).

I have done most of what you need on my board gaming platform. Check out www.happymeeple.com/en/ and you will see main chat (=inn), one-on-one chats and friends list. I also added likes (as well as reward, ban, delete buttons for admin).

Hope this helps.

Al

unread,
Jul 8, 2015, 8:43:39 AM7/8/15
to ape-p...@googlegroups.com
Nice, but how do I get going on this with no documentation and zero examples to find. Care to share some source code?

Al

unread,
Jul 8, 2015, 8:56:18 AM7/8/15
to ape-p...@googlegroups.com
This guys got the same complains as me:


And that was in 2010.
I've seen many good projects before that nobody uses because lack of documentation. Pity :( 

Nicolas

unread,
Jul 8, 2015, 9:28:11 AM7/8/15
to ape-p...@googlegroups.com
My best advice is to look at the demo sources.

Also, you should check out Pablo Tejada's framework for simplifying APE on the client side.

On the server side, you should register your own commands like this:

Ape.registerCmd("ACK_RECEIPT", true, function(params, info){
    Ape.log("ACK_RCPT - r_ID :"+params.raw_id + ", pag_cntr :"+params.page_counter +", u_id :"+info.user.user_id);

});

Also, you will use Mysql support. Be aware that unlike PHP, calls to Mysql are asynchronous, which means that the reply is non-blocking. This raises issues when you want to give immediate answers to a command (you can't). It also complicates things as far as variables management is concerned because variable values may have changed between the moment you call Mysql and the moment the reply comes. This is similar to issues you have to deal when you make a loop of calls to setTimeout in Javascript.

Then if you know how to program Javascript cleanly you should make great things.

Hope this helps.

PS: I have learned too late that objects are better than arrays for APE. If you store things, store (and send) them as objects. They will take less memory but most importantly they will avoid issues with the 0 in arrays (if you send an array via APE, the indexes always start at 0 which messes up your array).

Al

unread,
Jul 8, 2015, 9:39:29 AM7/8/15
to ape-p...@googlegroups.com
Thanks for that.

To which framework do you refer ?
This:
or this:

?

Nicolas

unread,
Jul 8, 2015, 10:01:46 AM7/8/15
to ape-p...@googlegroups.com
There has been a discussion (here I think) about the advantages of the new framework.

The new one was recommended:

Wes Garland

unread,
Jul 8, 2015, 10:38:39 AM7/8/15
to ape-p...@googlegroups.com
This is all possible with APE.  Look at the sample apps and you should be able to figure it out relatively easily.

No need to store recent messages in a database IMO.  Just keep them in RAM.

Wes

--
--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to ape-p...@googlegroups.com
To unsubscribe from this group, send email to
ape-project...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/

---
You received this message because you are subscribed to the Google Groups "APE Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ape-project...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Wesley W. Garland
Director, Product Development
PageMail, Inc.
+1 613 542 2787 x 102

Louis Charette

unread,
Jul 8, 2015, 8:54:34 PM7/8/15
to ape-p...@googlegroups.com
Hi,

Have a look at this demo I wrote for both original framework and ApePubSub: https://github.com/lcharette/JSF-vs.-APS---Move-demo (It’s the demo from the website : http://ape-project.org/demos/move/). The readme explains the difference between the default javascript framework and Pablo’s ApePubSub. 

And honestly, go for ApePubSub. Much more simpler to use and learn. Pablo’s demos on the project Github page are well documented and the wiki is very useful.


  - Louis

P.S.: I created a chat system for a phpBB board very similar to what you want. Indeed, don’t store each message in the database, unless you REALLY want to have a log. Not only it's slow and will cause you headaches, but the size of the log will grow FAST. Several Mo (if not Go) of log will be stored in only a couple of days if the chat is really popular. Been there, done that lol. 

If you really need to create a log, store to ram and then send messages to the database in some sort of batch. As for the friend system, my best advise it to do it using normal AJAX and whatever server side code you’re using (php, etc.) then notify APE that the friend list changed by giving it the new friend list. APE could handle it, but writing it and maintaining your friend list logic in PHP or whatever is usually simpler.

Al

unread,
Jul 9, 2015, 12:53:25 PM7/9/15
to ape-p...@googlegroups.com
Thank you for all the replies.
ApePubSub is indeed more readable and has better documentation. I was playing with its demos and they all look easy enough.
I did however come across a problem with the PHPApp demo.
It looks like there is a synchronisation problem with the session id. At times you can't connect until you get a new session ID.

Did anyone came across this problem before?


On Wednesday, July 8, 2015 at 1:48:34 PM UTC+2, Al wrote:
Reply all
Reply to author
Forward
0 new messages