AQUEDUCT

An object-oriented, multi-threaded HTTP framework mobile developers will love.

One framework. Everything you need.

Aqueduct is an extensible HTTP framework with integrated ORM, OAuth 2.0, and test libraries.

It runs on the Dart VM, a lightweight, ultra-fast C/C++ executable.

Up and running in just a moment.

λ brew install dart
λ pub global activate aqueduct
λ aqueduct create my_app
λ cd my_app
λ aqueduct serve

Incredible documentation and a Slack channel for when you get stuck. For more detailed setup instructions, see this guide.

Multi-threaded out of the box

Aqueduct's memory-isolated threads leverage every CPU without writing any code. No race conditions or complicated synchronization logic to worry about.

Fluid Routing

A familiar, higher-order functional syntax makes application flow easy to construct and read.

router
  .route("/teams/[:id]")
  .pipe(new Authorizer(validator))
  .generate(() => new TeamController(databaseContext));

Statically-typed ORM and Database Migration

Powerful, statically typed queries enable code-completion and refactoring tools while minimizing error. Tested command-line tooling for database migrations makes data management a breeze.

var query = new Query<Team>()
  ..where.skills = whereContainsString("aqueduct")
  ..join(object: (t) => t.manager)
  ..join(set: (t) => t.developers);

var teams = await query.fetch();

OAuth 2.0 Server

A rigorously tested OAuth 2.0 server in just a few lines of code. A layered implementation allows you to store tokens and client identifiers anywhere without rewriting the logic.

var storage = new ManagedAuthStorage<User>(dbCtx);
var auth = new AuthServer(storage);

router
  .route("/auth/token")
  .generate(() => new AuthController(auth));

router
  .route("/auth/code")
  .generate(() => new AuthCodeController(auth));

Productive Request Bindings

Boilerplate-avoiding meta-programming increases productivity, avoids simple errors and makes sure your API handles errors correctly and consistently.

@httpPost
Future<Response> updateTeam(
    @HTTPPath("id") int teamID,
    @HTTPBody() Team team,
    @HTTPHeader("x-required-header") String requiredHeader,
    {@HTTPQuery("optional_timestamp") DateTime timestamp}) {
  return new Response.ok(team);
}

Integrated Test Library

Aqueduct was built to be tested. Know that your code works from end-to-end without fragile mocking. Use continuous integration tools like TravisCI with ease.

test("GET /teams returns 200 and list of teams", () async {
  var request = app.client.request("/teams");
  expectResponse(
    await request.get(),
    200,
    body: everyElement({
      "id": greaterThan(0),
      "name": isNotNull
    }));
});

Releases you can count on.

Guaranteed by over 1000 automated tests and counting.