How to implement a chat system in my web application with Vue and Java EE? - rest

I have a Web Application based on Vue.js, REST(JSON) and Java EE with Payara Server.
Now i want to add a chat. There should be different fixed chat rooms (global, groups) and there should also be the possibility for private user-to-user chats.
I've been looking for a while now and have come across various Vue Chat projects that use 3rd party services e.g. socket.io, PubNub, CometChat. I don't want to outsource any functions in this way. In addition, it probably does not make sense to use finished components, since I have so far not found anything that can meet the above specifications and I would have to modify the component accordingly.
So I think I can't avoid building something new for myself, which is not a problem. However, I don't want to reinvent the wheel and I'm unfortunately not familiar with the best practices of building chat applications.
Roughly off the hook, I would create a database table that is used to store the messages. The messages are delivered and picked up via my REST interface, in whatever way.
Is this direction correct? Can i make it like this? It kind of feels ... dull. I have seen a lot of finished chat servers, do i really need something like this, or can I implement this with my Payara server without major complications?
Unfortunately I could not find any suitable examples. I would be very grateful for a short advice or suggestions.

the best advice I can give you is to use a communication protocol which grants real time data. I mean, something like websockets or socket.io, which is a pretty good option.
Besides, if you want to develop a chat app, the data will be bidirectional, this means that it will travel from server to client and viceversa. I hope this could help you. Here
you have an example of a pretty basic chat app using socket.io.
I hope this could help you, regards

Related

Developing a VoIP/Chat Server-Client platform, where to start

I am interested in developing a Client and a Server for VoIP and IM communication like mumble/teamspeak/skype/raidcall etc.
I would like to stay away from hardcore stuff, while my main goals regarding the client are:
Basic VoIP and Chat functionality
Custom emoticons in chat
A completely flat designed UI
Project lasts one month
So is this in your opinion a realistic and doable concept? If so which language do you think that would fit my above goals the most? And can you also point me to a certain direction? (Like should I use xmpp, should I find a completed Server and develop only the client etc).
I can code in C, C++ and Java at a university level.
Thanks in advance.
Maybe you should have a look at: www.freeradionetwork.eu
It's a prehistoric, but nevertheless interesting project. They published their protocol in hope for someone to write an API.
Do you want to stream through your server, or make it P2P?

Advices on server implementation for server/client structure iOS App development?

There are must be a lot of apps that are designed to communicate with server. My question is only about App installed on iOS device + Server side service interaction. Web app is not what I am talking about, and there should be no webpage involved in this discussion at all. Typical examples are Apps like Instagram and Twitter, in which most of the information exchanged between the App and the server is just data like String, Image and Integers(wrapped in JSON or XML), no webpage presentation needed.
My question will be: if you are an independent app developer, and you are designing such an app from scratch without any existing website API, database structure or application(so you are not limited by any existing API or database structure or application protocol), What will be the most efficient approach?
What the sever side need to do are:
receive data send by the App;
process the data with designed logic;
interact with database(like MySQL);
do necessary data mining and analysis---this could be a constantly running service or one time task requested by the App client;
send the data back to the App upon request or spontaneously;
exchange or broadcast the data between/among different App clients (i.e.: group chatroom and peer to peer message);
As far I as know there are 3 obvious options to implement the server side:
PHP
Python
Ruby on Rails
(please feel free to add more options)
My questions are:
which one is the most appropriate choice to implement the server side?
If the App is focusing intensively on natural human language/text searching, analyzing and data mining, which one is the best choice? I heard Python is doing pretty good in this area.
Any advice on the database choices? I am using MySQL for now, and I found it's quite powerful for my purposes, I heard Twitter is switching to Cassandra. Will that be too difficult to start with?
For the server end, if you need to build a Server management interface, for you as an admin to manage and monitor the community, membership, data and such, is there any existing solution, or framework or tool for that? what will be the most efficient approach?
If a new programmer has no experience in non of them, which one you suggest he/she to start with?
Is there any good reference material or sample code on the server side in such context we can learn from?
I know there are a lot of very experienced experts on these areas on Stackoverflow, but I saw more newbies who just entered the iOS developing area without much knowledge in server/database programming experience. And I hope this thread can help these who are thinking to design an App with server/client structure but have no idea where to start with.
ps: I will keep updating this question thread and adding my findings on this topic, to help all other users at stackoverflow. :-) Please try to make your answer informative, easy to understand, and constructive. I guess most of readers for this thread will be new members of this great community.
Are you sure you want to spend time & money to develop your own Server & develop your own API?
There are lots of mBaaS (mobile Backend as a Service) providers today such QuickBlox, Parse,StackMob, which are ready to use and they have great Custom Objects API and some of predefined modules. They have great free plans with big quota. Some of them such QuickBlox has Enterprise plan - so you can buy license and they server team update server for you purpose.
So, i recommend not develop your server and think about mBaaS market.
Just about your issue - I can recommend look at QuickBlox Custom Objects code sample and also Custom Objects API. Custom Objects module provides flexibility to define any data structure(schema) you need. Schema is defined in Administration Panel. The schema is called Class and contains field names and their type. I think it's what you need.
which one is the most appropriate choice to implement the server
side?
Well that depends on what you know, there is reason to choice one of the other
If the App is focusing intensively on natural human language/text
searching, analyzing and data mining, which one is the best choice? I
heard Python is doing pretty good in this area.
This would reflect on your first question, you pick the language on you needs. Thus if python makes it easier then pick that one.
Any advice on the database choices? I am using MySQL for now, and I
found it's quite powerful for my purposes, I heard Twitter is
switching to Cassandra. Will that be too difficult to start with?
Again not one that is easy to answer, since it all has to do with requirements. But any SQL server will do. Cassandra is meant for "scalability and high availability without compromising performance" accourding to there website. Do you think you webservice will get many request then it might be a choice to consider.
For the server end, if you need to build a Server management
interface, for you as an admin to manage and monitor the community,
membership, data and such, is there any existing solution, or
framework or tool for that? what will be the most efficient approach?
This again is only going to be answered when you pick the a SQL server and server language.
If a new programmer has no experience in non of them, which one you
suggest he/she to start with?
Start with something simpler, you are really going out on a limb here.
Is there any good reference material or sample code on the server
side in such context we can learn from?
Propably there is some, but you should really start small and work from there.
Twitter started out as a Rub on Rails app and is working on scalability and availability which ruby is not really good ar (that is my person opinion). or Look at facebook they have written a php to c compiler to make php run faster.
The only thing I can say to start code, when you app does take off then tackle the some of the performance issues.
And since you state that you are new to programming do not bite of more then you can chew.
This is a huge question and I don't think there is a best answer. It most depends on what you care about, such as how quickly the development process, how easily the implementation, etc.
And which one is popular, which one is cool, I don't think it make really sense.
In my personal opinion, I'm good at ASP.NET and I can get Windows server easily, so I'll start with an ASP.NET service to provides data.
And, to be continued.

How to implement group chatting/message-board mobile app?

I am trying to write a iPhone group chatting/message-board app which will have a backend component. I expect users to register with our system and start posting messages on chatrooms/message-boards. These message-boards can have more than 2 individuals, must support real time notifications and should be accessible from any other clients (like web) as well.
I stumbled upon http://code.google.com/p/xmppframework/ . I realize that XMPP is a very attractive proposition for our needs but I am seriously worried about the infrastructure complexities and scale issues. Besides, XMPP has way too much to offer for my needs. Looks like, XMPP might be the only choice for my pleasure in pain, but I wanted to see what you experts have to say on this.
Any thoughts?
Thanks,
My advice is: whichever protocol you're choosing, do not try to invent your own protocol. Go for XMPP or if you can find an alternative which you find more compelling, use that. Especially if there's already a nice framework for you to use. Why ? Because a single developer new to a field is seldom smarter than a bunch of people with experience ;-) Make use of other peoples' experience by using an established protocol, and make use of existing frameworks to avoid coding mistakes and investing a lot of time to solve a problem yet again that was already solved.
That being said, XMPP is widely deployed and thus would make for a good choice if you later plan to write additional clients for other platforms or want to have third-party clients connect to your server.

AJAX or a server side framework?

I am working with a friend on building a web site, in general this web site will be a custom web app along with a very custom social network type of thing..
Currently I have a mock-up site that uses simple PHP with AJAX and JSON and JQUERY and I love how it works, I love the way it all fits together.
But for a mock-up I did not implement any of the Social Network design patterns such as a login, rating, groups etc..
This brought me to a higher level of decision making requirement, I need to decide if I want to develop all this functionality by hand or use some kind of a framework.
I spent this entire day researching, and it would seem that using Drupal and such frameworks will make the Social Network part easy (overlooking the customization requirement for now..) but will make client side Web App development less so.
I found some other frameworks that are more developer friendly (customizable) such as Zend and Symfony etc.. but these seem to take allot of the power from the client and implement it in the server side, to me this seems a waste (and an unjustified performance bottleneck) ..
Finally I found Aptana Jaxer framework that seems to think the same way I feel.
That said it seems a bit under-developed, I didn't find modules for a social network and the community around it seems thin.. (searching Jaxer in StackOverflow returns few results)
So other then making server side DB comm a bit simpler it does not help me greatly..
My requirements are a good facility to develop web apps on while containing all the user centric logic usually used for social networks in advance.
What would you recommend?
EDIT:
OK, lats fine tune this question, after considering this abit further, is there a good down loadable source of a social network site in PHP that I can work around in building my web app? (I really like using JQUERY AJAX JSON etc..)
if you want to develop a social networking site from scratch, i recommend using zend-framework as a server side framework and jquery as a client side framework.
they have a lot of library which you can use such as zend_auth,zend_acl for user authentication system and Zend_Search_Lucene for search facilities and zend_gdata for youtube videos and so on.
but you can also use one of the several social networking engines available out there.
here is a link:
http://www.best-php-scripts.com/social_networking.htm
I think it depends on the goal your trying to achieve.
Personally, I tend to like to keep things simple and to decouple complex
things in smaller components, so it's easy to stay in control when you'll
incrementally add new features.
Ajax or a server-side framework ? I'd say that they're not necessary overlapping
each others. However some (server-side) frameworks tends to wrap everything in a
single zipped package to make things easier for beginners. I personally don't
like this avenue because it will make your web app dependable on this framework.
Thus, nothing prevents you to use one client-side framework for the presentation
logic and another one for server-side/business logic.
Hth,
Etienne

Which XMPP server to experiment developing a server component

I want to try developing an XMPP server component using XEP-0114: Jabber Component Protocol.
Which server do you recommend and why? I'm talking about ease of development, community support, documentation, examples, etc.
That's a hard question to answer, because I doubt there are many developers involved in developing across multiple XMPP projects and languages.
I can throw out a few personal perceptions but... I could be off-base!
What you're really looking for is which libraries would be recommended for component development. All the servers support the component protocol, so all you really need is a socket connection to the server and some helper routines to make the repetitive stuff like message parsing easier.
Where the server might matter is if you need tighter integration.
For example if you want your component to scale the same way as Ejabberd then you'll probably want to use exmpp.
If you need to deploy your component alongside Openfire into Java only enterprises, then you'll probably want to use smack.
If you are familiar with Python and want to prototype quickly use Wokkel.
I don't think documentation is going to be great for any of the libraries (haven't looked at them all though!) but that shouldn't be a huge burden. All you really need a good book on how the XMPP protocol works and then some sample code from the library and it's fairly easy to move on from there.
For an easy-to-use testing server I like openfire. Good instructions, easy to hook in components, and a good web interface for administration. Debugging is more of a "tail -f" on the logfiles, slightly java-ish.
I've used XCP professionally, but that's really for commercial use. It works well but if that's not your target deployment it's not worth the effort. I'm not sure if you can buy it separately any more.
I tried using ejabberd and I gave up quickly. I found the documentation for setup and administration awful. The config files are not self describing and there's no good walk through on the ejabberd site. It may be able to even fry my eggs in the morning for breakfast, but I couldn't get past install with the time I'd allotted to it.
For Openfire, there is something called Whack, which is a Java library for creating server components (XEP-0114).
Since the communication is over sockets, I presume the same code should work for any well designed XMPP server (such as ejabberd). However, I have only tested it with Openfire and it works quite well.