Coder Social home page Coder Social logo

aravinth-balaganesan / tracking-location-socketio Goto Github PK

View Code? Open in Web Editor NEW

This project forked from viettranx/tracking-location-socketio

0.0 1.0 0.0 902 KB

Demo Broadcast/Tracking location with SocketIO (like Uber/Grab) for Web/Mobile Apps

JavaScript 17.14% HTML 9.20% Python 7.15% Java 5.84% Ruby 3.39% Objective-C 18.60% Swift 19.56% Kotlin 19.13%

tracking-location-socketio's Introduction

tracking-location-socketio

This project helps us show a demo app view all vehicles are moving on the maps. It's useful to make a prototype app like Uber/Grab.

It's not real tracking GPS. I use GPX files exported from Google Direction service to make a fake tracking engine and socketIO to emit data to the clients. Hope you enjoy it :D

On React Native: iOS & Android

Installation

You must have node installed: Install NodeJS.

Clone repository and change directory to it

git clone https://github.com/viettranx/tracking-location-socketio.git 
cd tracking-location-socketio/server

Install nodemon

npm install -g nodemon

Install all dependencies needed

npm install

Run the server

This project needs nodemon to run and watch file changes. The command is:

nodemon Server.js

In case we need to run it as background service. Install forever and run:

npm install -g forever
forever start -c nodemon Server.js

Open your favorite browser and go to:

http://localhost:4333/

Configruation

You can find default config in nodemon.json. That's just simple:

{
  "env" : {
    "RUN_MODE"    : "dev",
    "PORT"        : 4333
  }
}

Since the nodemon service could not watch itself config, you need to restart it.

Want to add more route

This project uses GPX format to emit location info to the clients. Just place any file GPX to gpx folder to add more. To create a GPX file, you can use Google Maps Direction service and export it with a shorten URL:

Then paste the URL to https://mapstogpx.com/pokemon.php to generate GPX file

Run React Native

You need react-native installed: React Native

Follow these steps to run the project:

cd client/react-native
npm install
react-native link
react-native run-android

As on iOS

cd client/react-native/ios
pod install
cd ..
react-native run-ios

Please note that socket.io in App.js points to localhost:4333. Modify it in case you need to change your server URL.

const socketURL = 'http://localhost:4333'

Run iOS Swift

cd client/native-ios-swift/DemoTrackingLocation
pod install

open DemoTrackingLocation.xcworkspace

Run Android Kotlin

Open client/native-android-kotlin with your Android Studio (>= v.3). Hit Run button and choose your simulator.

To Do

  • Parse XML content from GPX file.
  • Use SocketIO to emit to client
  • Client demo with website.
  • Client demo with React Native.
  • Client demo with iOS Native: Swift
  • Client demo with Android Native: Kotlin

License

Feel free to use and pull request to contribute it as you want.

tracking-location-socketio's People

Contributors

viettranx avatar

Watchers

James Cloos 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.