Skip to content

AviBueno/best-link-station-finder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Best Link Station Calculator

Description and Usage

Finds the best link station (nearest / with strongest signal) for a given mobile device location in 2D space.

The project may run in two modes:

Web server mode

To run as a web server the project may be executed using npm start.

The server support the following API, which is usually REST that returns a JSON object:

  • /demo
    Output the results of a predefined set of device coordinates.
  • /ls
    Output the list of link stations that the app is familiar with
  • /device/x/y
    Find the best link station for a given device's location
    For example: /device/5/7
  • / (the website's root)
    A demo page, containing examples for the various API calls.

CLI mode

This CLI app is executed using node app.js and may be operated in several modes:

  1. Demo mode
    Output the results of a predefined set of device coordinates.
    Syntax: node app.js demo

  2. Device location mode
    Find the best link station for a given device's location
    Syntax: node app.js --x=<number> --y=<number>

  3. List link stations
    Output the list of link stations that the app is familiar with
    Syntax: node app.js ls

Note

You may run node app.js --help for details about the app's various commands and flags.

Technical Info

Data

See data/README.md for details

Command line parsing

The project utilizes the yargs package in order to parse command line arguments.
In case of an error, an error message will be printed.
The -d / --debug flag may be used in order to get extended debug info.

Error handling

Error handling will take care of invalid input, such as non-numeric values where a float is expected, for example.
Any unexpected error will be trapped by a global 'uncaught exception' handler.

Unit tests

The project utilizes the jest library for unit testing all major source code files.
The tests suite may be run using: npm test

Deployment

Follow these steps to deploy the project:

  1. Clone this git repository
  2. Change dir into the project's root directory
  3. Run npm install
  4. Run npm test

You may now run the application according to the Description and Usage section above.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published