Udadisi was developed by Tirami, a software development company, in collaboration with Practical Action and the University of Edinburgh Global Development Academy, as part of the Technology and the Future of Work project, funded by the Rockefeller Foundation.
For more information refer to the wiki: https://github.com/tirami/udadisi-engine/wiki
The other components that build up the suite can be found at:
- https://github.com/tirami/udadisi-frontend
- https://github.com/tirami/udadisi-twitter
- https://github.com/tirami/udadisi-rss
The Udadisi Engine is developed using Go and requires the Go environment to run.
go get github.com/tirami/udadisi-engine
or if you already have an older version installed
go get -u github.com/tirami/udadisi-engine
- Go to localhost:8080/admin
- Select Build Database (this will delete all existing data and setup the new database schema)
- Select Miners to view the list of current Miners and to register a new Miner
POST JSON to localhost:8080/v1/minerpost
{
"posts": [{
"terms": {
"foo": 2,
"bar": 1
},
"url": "http://www.twitter.com/post/123456",
"datetime": 201508211014,
"mined_at": 201508211530
}],
"miner_id": "1"
}
Sample using curl
curl -H "Content-Type: application/json" -X POST -d '{ "posts": [{ "terms": { "foo": 2, "bar": 1 }, "url": "http://www.twitter.com/post/123456", "datetime": 201508211014, "mined_at": 201508211530 }], "miner_id": "1" }' http://localhost:8080/v1/minerpost
- Go to localhost:8080
- Select various data queries for each of the locations
A trival server that responds to the following:
- localhost:8080 - returns HTML
- localhost:8080/v1/locations/{location}/trends?limit={limit} - returns top {limit} trends as JSON
- localhost:8080/v1/locations/{location}/trends/{term} - returns JSON
- localhost:8080/web/trends/{location} - returns HTML list of terms, source URI, word counts
- localhost:8080/web/trends/{location}/{term} - returns HTML list of for term, source URIs and word counts
- localhost:8080 - returns simple home page
API spec in Swagger:
- localhost:8080/v1/swagger.json
The server uses the following environment variables:
- POSTGRES_DB - database host address (defaults to localhost if not set)
- DB_PASSWORD - db user password (defaults to udadisi if not set)
- ADMIN_USERNAME - username for logging into admin suite
- ADMIN_PASSWORD - password for logging into admin suite
createuser --createdb --login -P udadisi
Set password to udadisi
createdb udadisi
docker build -t udadis_postgresql .
docker run --rm -p 8080:8080 -e POSTGRES_DB='<database host address>' -e DB_PASSWORD='<password>' -P --name pg_test udadis_postgresql