Skip to content
Dropbox as a Database - Demo
Opa
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
Makefile
README.md Update README.md Nov 1, 2012
main.opa

README.md

Server Monitoring using Dropbox as a Database

Overview

Monitor the health of your servers and receive alerts when something goes wrong. This web application is built with the Opa technology and runs on top of a Dropbox-based database.

Demo

Main website and live demo at http://server-monitor.herokuapp.com/

Dropbox Storage

  • All your configured jobs and logs are saved on your personal Dropbox account. Nothing is stored on the application server.
  • If one of your severs goes down, a Dropbox popup will appear on your desktop.

The following code is a Dropbox database in Opa. Change the @dropbox annotation with @mongo and the app will run on top of MongoDB instead. It's that simple.

database monitor @dropbox {
    stringmap(log) /logs
    stringmap(job) /jobs
    /logs[_]/status = { ok } // Define the default "status" value
}

function add(name, url, freq){
    /monitor/jobs[name] <- (~{ url, freq })
}

Note: This application is a proof of concept, aim to learn the Opa Framework and to present a Dropbox-based database use case. The demo will stop monitoring your servers as soon as you close the page: fork the project and make you own production-ready version!

Compile

Download and install Opa, then compile the single file:

opa main.opa

Run

Create an app on Dropbox website and use the app keys to start the application:

./main.js --db-remote:monitor app-key:app-secret

Tutorial

Something went wrong with that request. Please try again.