Giter Club home page Giter Club logo

radiant-maxar / tasking-manager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hotosm/tasking-manager

0.0 3.0 0.0 4.97 MB

Tasking Manager 3 code, issues, documentation and fun. Please see the Tasking Manager 2 repository for any issues related to the previous version of the Tasking Manager.

License: BSD 2-Clause "Simplified" License

Dockerfile 0.06% HTML 26.66% JavaScript 30.71% CSS 6.14% Shell 0.19% Batchfile 0.03% Python 36.17% Mako 0.04%

tasking-manager's Introduction

HOT tasking-manager

Intro

The app is split into a Client (AngularJS) and Server (Python) structure. Each can be developed independently of each other. See below for instructions on how to set up your deve environment.

See our FAQ if you hit any problems getting setup

Client Development

Global Dependencies

Following must be available locally:

App Dependencies

You will now have to install all the app dependencies using NPM

cd client
npm install

Running Locally

If you plan to do client development you can run the app using gulp, without having to worry too much about the server. If you want to point the client at a non-local API (e.g. a staging environment), you'll have to change the environment config for development in client/taskingmanager.config.json.

cd client   [if not already in client]
gulp run

Running Unit Tests

The client has a suite of Jasmine Unit Tests, that you can run using Karma as follows

 cd client    [if not already in client]
 karma start ..\tests\client\karma.conf.js

Server Development

Dependencies

Following must be available locally:

Build the Server

  • Create a Python Virtual Environment, using Python 3.6:
    • python -m venv ./venv
  • Activate your virtual environment and install dependencies:
    • Linux/Mac:
      • . ./venv/bin/activate
      • pip install -r requirements.txt
    • Windows (use installer because of precompiled libs):
      • .\venv\scripts\activate
      • .\devops\win\install.bat

Environment vars:

As the project is open source we have to keep secrets out of the repo. You will need to setup the following env vars locally:

  • TM_DB - This is for the PostGIS connection string. If you can't access an existing DB refer to DevOps page to set up a local DB in Docker

  • TM_SECRET - This is secret key for the TM app used by itsdangerous and flask-oauthlib for entropy

  • TM_CONSUMER_KEY - This is the OAUTH Consumer Key used for authenticating the Tasking Manager App in OSM

  • TM_CONSUMER_SECRET - This is the OAUTH Consumer Secret used for authenticating the Tasking Manager App in OSM

  • TM_SMTP_HOST - The hostname for the SMTP server that is used to send email alerts

  • TM_SMTP_PORT - The port number for the SMTP server that is used to send email alerts

  • TM_SMTP_USER - The user for the SMTP server that is used to send email alerts

  • TM_SMTP_PASSWORD - The password for the SMTP server that is used to send email alerts

  • Linux/Mac

    • (It is strongly recommended to set these within your .bash_profile so they are available to all processes )
    • export TM_DB=postgresql://USER:PASSWORD@HOST/DATABASE
    • export TM_SECRET=secret-key-here
    • export TM_CONSUMER_KEY=oauth-consumer-key-goes-here
    • export TM_CONSUMER_SECRET=oauth-consumer-secret-key-goes-here
    • export TM_SMTP_HOST=smtp-server-host-here
    • export TM_SMTP_PORT=smtp-server-port-here
    • export TM_SMTP_USER=smtp-server-user-here
    • export TM_SMTP_PASSWORD=smtp-server-password-here
  • Windows:

    • setx TM_DB "postgresql://USER:PASSWORD@HOST/DATABASE"
    • setx TM_SECRET "secret-key-here"
    • setx TM_CONSUMER_KEY "oauth-consumer-key-goes-here"
    • setx TM_CONSUMER_SECRET "oauth-consumer-secret-key-goes-here"
    • setx TM_SMTP_HOST "smtp-server-host-here"
    • setx TM_SMTP_PORT "smtp-server-port-here"
    • setx TM_SMTP_USER "smtp-server-user-here"
    • setx TM_SMTP_PASSWORD "smtp-server-password-here"

Creating the DB

We use Flask-Migrate to create the database from the migrations directory. If you can't access an existing DB refer to DevOps page to set up a local DB in Docker Create the database as follows:

python manage.py db upgrade

Running Locally

API Development only

If you plan to only work on the API you don't need to build the client and can run as follows:

Seeing the client

If you want to see the client you will need to follow all the instruction in Client Development section then build the client as follows:

  • Build the client using gulp:
    • cd client
    • gulp build
  • You can now run the server as above from the root dir:
    • cd ..
    • python manage.py runserver -d -r
  • Point your browser to:

Running Unit Tests

The project includes a suite of Unit and Integration tests that you should run after any changes

python -m unittest discover tests/server

Dev Ops

Server Config

Environment Vars

On boot the Tasking Manager App will look for the following environment vars:

  • TM_ENV - Allows you to specify which config to load from ./server/config.py Acceptable values:
    • Dev - This is the default
    • Staging - Use this for your staging/test environment
    • Prod - Use this for your production environment

Localisation

Please see the Localisation Wiki for more details.

tasking-manager's People

Contributors

aaj013 avatar akshit312 avatar alekno avatar bgirardot avatar bgirardot-np avatar dakotabenjamin avatar david-hotosm avatar dkocich avatar drklrd avatar ernoma avatar ethan-nelson avatar feenster avatar felskia avatar fiennyangeln avatar hunt3ri avatar iandees avatar iknowjoseph avatar jonyeezs avatar lesserj avatar lindaalblas avatar mojodna avatar nick-tallguy avatar nrotstan avatar pgiraud avatar rightway1 avatar smit1678 avatar sunidhiraheja avatar thrazadin avatar twpol avatar willemarcel avatar

Watchers

 avatar  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.