Skip to content

Web application for GMU Local Hack Day. Takes logged geographic locations from IPs that access an HTTP file server, and displays the locations on a map.

Notifications You must be signed in to change notification settings

SaxyPandaBear/whereUat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

whereUat

Takes logged geographical coordinates from IPs that access an HTTP file server and places markers on a map to visualize where it's coming from.

Setup

  • Backend and Server-side code:

    1. Install Python 2.7.*
    2. Use pip to install flask and flask_cors for backend: pip install flask and pip install flask_cors
    3. Import pyipinfo for the server: pip install pyipinfo
      • This wrapper to the IPInfo API requires the use of curl so this code doesn't work on any system that doesn't have access to the curl command
    4. Run app.py and httpfileserver.py: python app.py, python httpfileserver.py
      • You can run either or both scripts in the background using nohup or &
      • python app.py & python httpfileserver.py & runs both scripts in the background
    5. The backend runs at localhost:5000 in your browser.
  • Frontend:

    1. Install Node.js which has NPM prepackaged with it - This project uses Node.js version 9.2.0
    2. Use npm to install Angular CLI
      • To install just in the project, in the webapp directory, do npm install @angular/cli
      • To install globally for your development environment, do npm install -g @angular/cli
    3. In the webapp directory of the project, /path/to/project/webapp/, run npm install to get all of the required dependencies, and run ng serve to start the frontend.
      • npm install
      • ng serve
    4. The frontend runs at localhost:4200 in your browser.
      • ng serve -o will automatically open your default browser to localhost:4200

Starting up the full application

This assumes that the working directory is /path/to/project/webapp

python ../server/httpfileserver.py & python ../backend/app.py & ng serve

This ignores all of the output to stdout except for the output of ng serve. A keyboard interrupt, CTRL-Cusually, will only terminate the Angular application. Python processes need to be manually terminated.

  • kill [script PID]

Equivalent nohup command

nohup python ../httpfileserver.py & python ../app.py & ng serve &

This writes output to stdout into a nohup.out file. nohup will let processes continue running even after the terminal isn't open. This is useful for when running the script remotely, i.e.: on AWS.

About

Web application for GMU Local Hack Day. Takes logged geographic locations from IPs that access an HTTP file server, and displays the locations on a map.

Resources

Stars

Watchers

Forks

Packages

No packages published