Search code examples
jakarta-eenetwork-programmingweb-applicationsserverclient

How does a server work and different clients?


I'm trying to code a small app with these features:

  • Users registration and login.
  • User profiles (basic data and some stats, i.e. nickname, age).
  • Chat (one to one, group chats).
  • A real-time multiplayer game session (something simple, imagine tic-tac-toe).

I would like to code the server-side in Java because is the language I know the most but, I have many questions about the architecture to use for my development process. I want to have clients from Android, iOS and web browsers connected to my server, so basically what I'm looking for is for a basic guide/advice about how to tackle this situation due to is my first app working with server-client.

What I have in mind for this is create a server using Java EE but it isn't clear for me if I should use sockets or which kind of connection and communication system.

Thanks for any help,

Cheers.


Solution

  • I'try giving you my advices, aware that they are not fully exhaustive.

    Server

    • use a REST approach because it's a modern and lightweight way to design a client-server interaction. Designing a rest api let you also be fully indipendent from the frontend or client implementations
    • use a token based authentication avoiding session management in order to scale onto more instances with less problems
    • be prepared to use real time frameworks for chat and push notifications

    Client

    • Use a javascript framework like AngularJS and a responsive css framework like Boostrap
    • Consider to adopt an hybrid mobile app framework lke Ionic in order to abstract the frontend development from the specific platform artifact generation

    Hope this could help you