Giter VIP home page Giter VIP logo

lighthouse-api's Introduction

lighthouse-api

Screenshot

Landing page: lighthouse-api.org
Main source code: app.js

lighthouse-api is a queryable REST API, implemented using Node.js and MongoDB. It provides a number of endpoints which return all the data from the National Research Council's 2006 study (revised in 2011) of over 5000 PhD programs in the United States. The data is returned in JSON format.

You can either query the data directly, build a GUI (e.g. a iOS app or a search engine in the form of a website) that consumes these endpoints, or you can even mirror this service and modify it to fit your needs as you see fit. The search engine philphd.org, for example, uses a part of this dataset.

Technical note for the technically curious: In addition to Node.js, I used Express.js; but not express-generator.

Sample usage

In a web browser:

http://104.236.148.49:3000/nrc/diversity. (If you use chrome with a json formatter extension added, the returned JSON will look much more readable.)

Using curl:
$ curl http://104.236.148.49:3000/nrc/diversity

Available endpoints (case insensitive, so all lowercase is fine:)

GET /nrc/dataNotUsedInRankings
GET /nrc/diversity
GET /nrc/emergingFields
GET /nrc/generalInformation
GET /nrc/otherOverallRankingMeasures
GET /nrc/rankings
GET /nrc/researchActivity
GET /nrc/studentActivities
GET /nrc/studentSupportAndOutcomes
GET /nrc/timeToDegree  # this is a subset of `GET /nrc/studentSupportAndOutcomes`

If you clone this repo and run this api server yourself

If you want to clone this repo and run this api server yourself, then you might find HelpfulHowtos.md useful. You can then also run mocha acceptance tests like so:

$ npm test

This is, in fact, what I have TravisCI do on my behalf. If you run the acceptance tests yourself, then it might look like so:

image

Why no Redis?

See Issue #3.

lighthouse-api's People

Contributors

wbraynen avatar

Watchers

 avatar  avatar

lighthouse-api's Issues

The database needs cleaning: last two records in each collection are nonsensical

image

Each collection (except nrc.emergingFields) has 5006 records instead of 5004. The last two are just noise:

image

So, need to clean up the db, like so:

> use nrc
> show collections
dataNotUsedInRankings
diversity
emergingFields
generalInformation
otherOverallRankingMeasures
rankings
researchActivity
studentActivities
studentSupportAndOutcomes

And then, for each collection except emergingFields:

> db.dataNotUsedInRankings.remove( {Field: ""} )
> db.diversity.remove( {Field: ""} )
> db.generalInformation.remove( {Field: ""} )
> db.otherOverallRankingMeasures.remove( {Field: ""} )
> db.rankings.remove( {Field: ""} )
> db.researchActivity.remove( {Field: ""} )
> db.studentActivities.remove( {Field: ""} )
> db.studentSupportAndOutcomes.remove( {Field: ""} )

The result should be this:

> db.dataNotUsedInRankings.count()
5004
> db.diversity.count()
5004
> db.generalInformation.count()
5004
> db.otherOverallRankingMeasures.count()
5004
> db.rankings.count()
5004
> db.researchActivity.count()
5004
> db.studentActivities.count()
5004
> db.studentSupportAndOutcomes.count()
5004

Add caching

Kinda like this, but maybe not on a per-session basis. Maybe just pre-cache all the endpoints' json results and the serve them from the cache instead of from disk.

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.