Giter VIP home page Giter VIP logo

cuaca's Introduction

Cuaca

MIT license

Aims to be a simple API for weather prediction in Indonesia. Data taken from Badan Meteorologi Klimatologi dan Geofisika publicly available XML datasets here.

JSON Datasets

Converted and cleaned up JSON datasets is available as a standalone HTTP server. As with BMKG's original data, the datasets are predictions for the next 3 days. Or after seeding, you can just go to the weatherdata folder.

Running Locally

$ git clone [email protected]:tistaharahap/cuaca.git
$ cd cuaca
$ npm i
$ npm run weather-repo

Open up a browser and go to http://localhost:5000 to see the data. This will only run the static file hosting, to update the data, do the following.

$ npm run seeder

Seeding

To seed MongoDB, do the following sequence.

$ npm run seeder # Will download new feed from BMKG
$ npm run seeds-to-db # Insert the updates into MongoDB

Make sure your have a MongoDB instance running and its connection string set properly in the environment.

Updating Data

To update the data, simply run:

$ npm run update-db

Cron this script to run it periodically.

Environment Variables

Name Description Default Value
HOST Serving host 0.0.0.0
PORT Serving port 3000
MONGO_DB_CONN_STRING MongoDB connection string Empty

Endpoints

This sections lists all available endpoints.

Nearby Weather

[GET] /v1/nearby

Query Parameters:
* latitude: float [required]
* longitude: float [required]
* minDistance: integer [optional, defaults to 0]
* maxDistance: integer [optional, defaults to 100000]

All Areas Weather

[GET] /v1/areas

cuaca's People

Contributors

dependabot[bot] avatar tistaharahap avatar

Watchers

 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.