Giter Club home page Giter Club logo

aqueduct's Introduction

Aqueduct

Build Status codecov

Gitter

Aqueduct is a server-side framework for building and deploying REST applications. It is written in Dart. Its goal is to provide an integrated, consistently styled API.

The framework contains behavior for routing and authorizing HTTP requests, persisting data in PostgreSQL, testing, and more.

The aqueduct command-line tool serves applications, manages database schemas and OAuth 2.0 clients, and generates OpenAPI specifications.

Aqueduct is well-tested, documented and adheres to semantic versioning.

Getting Started

  1. Install Dart.

  2. Activate Aqueduct

     pub global activate aqueduct
    
  3. Create a new project.

     aqueduct create my_project
    

Open the project directory in an IntelliJ IDE, Atom or Visual Studio Code. All three IDEs have a Dart plugin.

Tutorials and Documentation

Step-by-step tutorials for beginners are available here.

You can find the API reference here or you can install it in Dash.

You can find in-depth and conceptual guides here.

An Example

The only requirement of an Aqueduct application is that it contains a single RequestSink subclass. The example application below exposes POST /notes, GET /notes, GET /notes/:id, PUT /notes/:id and DELETE /notes/:id and stores data in a PostgreSQL database.

import 'package:aqueduct/aqueduct.dart';

class AppRequestSink extends RequestSink {
  AppRequestSink(ApplicationConfiguration config) : super(config) {
    logger.onRecord.listen((p) => print("$p"));

    var dataModel = new ManagedDataModel.fromCurrentMirrorSystem();
    var psc = new PostgreSQLPersistentStore.fromConnectionInfo(
        "dart", "dart", "localhost", 5432, "dart_test");

    ManagedContext.defaultContext = new ManagedContext(dataModel, psc);
  }

  @override
  void setupRouter(Router router) {
    router
      .route("/notes[/:id]")
      .generate(() => new ManagedObjectController<Note>());
  }
}

class Note extends ManagedObject<_Note> implements _Note {}
class _Note {
  @managedPrimaryKey
  int id;

  String contents;
}

aqueduct's People

Contributors

joeconwaystk avatar stablekernel-admin avatar anachlas avatar jesseblack82 avatar marcussmith avatar caffeineflo avatar kevmoo avatar robertblackhart avatar erikist avatar

Watchers

Rahat Ray avatar

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.