Giter Club home page Giter Club logo

bulls-eye's Introduction

Bulls-Eye

Build Status

Bull's Eye is a Dart-IO Web-Server (like Node JS / Express). It should bring the speed of Dart to the server-side. To have an single language to program server and client.

Install

You can get Bulls-Eye from the Dart Pub Manager.
Get the Package

  • Add the dependancy 'bulls_eye' to your pubspec.yaml
  • Via the DartEditor dialog
  • By adding the following to the file:
    dependencies:
        bulls_eye: any
    
  • Update your depandancies by running pub install

Use the Package

import 'package:bulls_eye/BullsEyeCommon/bulls_eye_common.dart'; // For route defenition
import 'package:bulls_eye/BullsEyeServer/bulls_eye_server.dart'; // For using the web server

Note: I will change this in future to 'bulls_eye/common.dart' and 'bulls_eye/server.dart'

Example

// Route defenition
var jsPath = new RouteDef("js/*"); // Add a wildcard '*' to match all routes they start with the defined route
var cssPath = new RouteDef("css/*");
var home = new RouteDef("");
var toDoListItemRoute = new RouteDef("ToDo/:ListID/(:ItemID)"); // Define route variables 'ListID' and optional route variables 'ItemID'
var searchRoute = new RouteDef("search?q&(ResultCount)"); // Define query variables 'q' and optional query variables 'ResultCount'

// Create Server
var server = new Server();

// Define Routes
server..RegisterRoute(new FileRoute.fromUri(cssPath, methods: ["GET"], contentTypes: ["text/css"])) // Only CSS allowed
      ..RegisterRoute(new FileRoute.fromUri(jsPath, methods: ["GET"]))
      ..RegisterRoute(new FileRoute.fromPath(home, "html/home.html", methods: ["GET"]))
      ..RegisterRoute(new LogicRoute(toDoListItemRoute, (context) {
        //Logic to execute here
      }, methods: ["GET"]));
	 ..RegisterRoute(new LogicRoute(searchRoute, (context) {
        // Search logic to execute here
      }, methods: ["GET"]));
// Start Server
server.start();

Lib Doc

The Lib is devided into 3 parts:

  • Common: Here are functions which are required on client and server side (e.g. route defenitions, ...)
  • RouteDefenition
  • Server: Here are the server side specific implementations
  • WebServer
  • Client: Here are the client side specific impelmentations

To get an idea of the state, take a look at the example, doc and/or the tests.

Changelog / Roadmap

See here

Targets

  • be extendable (e.g. via plugins)
  • be easy
  • be fast

FAQ

Why not using an available implementation?

I know there are some projects out there which doing the same. But I want to build a server which fits more my needs and implements some features I missed on other implementations.
Another reason is to learn and study DART. It's like an case study to prove if it fits my requirements better than other languages (PHP, JS, Phython, Ruby, ...).

bulls-eye's People

Contributors

softhai avatar

Watchers

 avatar  avatar  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.