Coder Social home page Coder Social logo

opendata-api's Introduction

Let's Do It World Open Data API

Prerequisites

  1. Node.js.
  2. Create .env file in project root directory with parameters explained in .env configuration or, you can check out example file .env.example
  3. PostgreSQL database.
    • Create database named Trash
    • Run following .sql files
      • api/db/brute.sql
      • api/db/country_population.sql
      • api/db/country_resource.sql
      • api/db/location_cache.sql
      • api/db/report_sources.sql
      • api/db/reports.sql
      • api/db/resource.sql
      • api/db/users.sql
    • To import demo data from csv, follow api/db/import_data_from_csv.sql.

.env configuration

DB_HOST=change_this_host (DNS or IP of the database server)
DB_PASSWORD=change_this_password (password for the database user)
JWT_SECRET=change_this_secret (secret for JWT authentication)

Optionally you can set following parameters

DB_USER=change_this_username (name of the database user, default: ldiw)
DB_NAME=change_this_db_name (name of the database to connect, default: trash)
DB_PORT=change_this_port (port of the database, default: 5432)

PORT=change_port (port where to run the API, default: 3000)
INTERFACE=change_interface (interface to serve the api on: default 0.0.0.0)

For Trashout import to work, set for one instance following parameter

TRASHOUT_REQ_DELAY= Cron expression when to run import.

How to run

  1. npm install
  2. npm run start-dev

how to deploy to azure virtual machine

To manually deploy to Azure look at manual_deploy_to_live.txt

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.