Skip to content

Latest commit

 

History

History
112 lines (78 loc) · 3.1 KB

README.md

File metadata and controls

112 lines (78 loc) · 3.1 KB

LinkSight

This web app takes a list of barangay, municipality, city, and province names and looks up their closest matches in the Philippine Standard Geographic Code (PSGC). It's useful if you're trying to standardize location names for merging location datasets from diverse sources.

How it works

  1. Upload a single CSV file that contains separate barangay, province, and city or municipality columns.
  2. Identify the columns that correspond to the correct administrative levels in the PSG code.
  3. For places with exact matches in the PSGC, LinkSight returns the precise PSG code. For places with more than one possible matching PSG code, use the app's graphical user interface to select the correct match.
  4. Export the results as a CSV.

Feedback

This app is in active development! Your feedback will help us improve it. If you have any suggestions for features, enhancements, or find any bugs, or just want to contribute, please send us an email at [email protected].

Development

React App

  1. Install dependencies

    cd app
    npm install
  2. Run server

    npm start

Django API

  1. Install dependencies

    make install
  2. Set configuration values

    cp .env{.template,}
    
    Config name Description
    DEBUG Toggles running the server in debug mode
    DATABASE_URL See DJ-Database-URL
    SECRET_KEY String used to provide cryptographic signing of sessions, etc.
    EMAIL_PORT Port to use when sending email
    EMAIL_HOST_USER User for sending email
    EMAIL_HOST_PASSWORD Password for above
    SOCIAL_AUTH_GOOGLE_OAUTH2_KEY Key for Google OAuth2
    SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET Secret for Google OAuth2
    GOOGLE_APPLICATION_CREDENTIALS Path to the Google Cloud Service Account key file used to retrieve the list of approved emails
    APPROVED_EMAILS_SHEET_ID Google Sheets ID of th list of approved emails
    APPROVED_EMAILS_SHEET_RANGE The sheet range for approved emails
    APPROVED_EMAILS_ROW_KEY The row key for approved emails

    If you are a member of the official LinkSight development team, you can ask for access to the template with secrets filled in.

  3. Install postgresql and run the following in psql:

    CREATE DATABASE linksight;
    

    Make sure that you can connect using the DATABASE_URL you used in .env.

  4. Run the server

    source venv/bin/activate
    python manage.py migrate
    python manage.py runserver
  5. Go to http://localhost:3000/

Components Catalog

npm run catalog-start

Testing

gunzip -k data/clean-psgc.csv.gz
python manage.py test

You can run specific subsets of tests like so.

Deployment

Staging

cd deploy
make

Production

Instructions to follow.