Git Product home page Git Product logo

spring-boot-websocket's Introduction

Spring Boot - Location based web socket application

spring-boot-websocket

In this appliction you will know how to create Location based web socket application with Spring Boot in simplest way.

Let’s Setup Environment

  1. Maven 3 or any latest version
  2. JDK 1.8 / JDK 1.9 or any latest version
  3. Eclipse Kepler / Eclipse Juno / Eclipse Neon or any latest version

Extract that project and import in eclipse.

File > Import > Existing Maven Projects > Click Next > Select project root directory > Click Finish

Project Description

Definition:

  • Create Web Socket Endpoint that is receiving location from users.
  • Web socket broadcast all user's location to all connected users.
  • Display Map on page.
  • User can select his location and press Live Button.
  • Upon clicking on live button, his location will be shared every 10 seconds to the server via WEB SOCKET.
  • Display all other user's location in the Map.

Solution:

Technology used:

Server Side = Spring Boot for web application Spring Web Socket for managing socket communication from server side

Client Side = Html5 Geolocation from browser for getting user’s live actual location from web page SockJS for web socket communication from web page Bootstrap for web page design Jquery for web page interaction

In this project I haven’t used any database for storing the data. I have stored data in memory.

Bellow I have described screenshot of the application,

1) Firstly, when user enter in the application then, He/She have to provide username.

2) If user has entered username as UserA. Then, web page shows that user’s current location. In that time no other user is online so, public user’s data is blank.

3) In that time if other username called UserB is enters.

4) UserB is show his/her current location on page

5) After clicking on Live button on page in both the user’s screen, All connected user’s latest location is getting feed from server via web socket and current user continuously sending their location to web server from web page.

6) At starting point, User have to allow access of location from browser to get their location

7) Project structure of the project

That's It...you are ready to Run

Right click to project > Run As > Spring Boot App

go to http://localhost:8080/

Meta

Rutvik Patel - [email protected]

Distributed under the GPL V3.0 license. See LICENSE for more information.

spring-boot-websocket's People

Contributors

rutvikrpatel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.