Naptime

Making REST APIs so easy, you can build them in your sleep!

Build Status

Project Status: Alpha. Although Coursera has been using Naptime in production since 2013, and is responsible for nearly 100% of our traffic, expect a number of API and binary incompatibilities until we reach beta.

Coursera leverages interactive clients to provide a high quality learning experience. In practice, this means Javascript clients for the web, and native apps for iOS and Android. In order to avoid duplicated work, we re-use the same APIs across web and mobile clients. This has forced us to build generic, re-usable APIs. Naptime is the result of these efforts. Naptime helps server-side developers build canonical, RESTful, re-usable APIs.

Why Naptime?

We adopted Play! and Scala as part of our migration away from PHP & Python. We initially built APIs using the stock Play! APIs. Play!'s APIs are powerful and general, but we found we could trade off some of that power for a big gain in productivity and REST standardization. We believed that an opinionated, optimized framework could DRY out our code, and increase developer productivity. After a number of false starts, we built Naptime. Today, over 95% of new APIs at Coursera are built using Naptime. Developers like using Naptime because it helps them get their job done more quickly.

Naptime Principles

We've attempted to follow a few principles to help guide development. They are roughly:

Using Naptime

To learn more about how to use naptime, check out our getting started guide!