GithubHelp home page GithubHelp logo

zippy / anansi Goto Github PK

View Code? Open in Web Editor NEW
9.0 6.0 3.0 737 KB

a reference implementation of a scaped receptor network

Home Page: metacurrency.org

Clojure 90.53% Gherkin 0.05% HTML 1.33% CSS 8.08%

anansi's Introduction

anansi

A reference server for the ceptr platform. This project was replaced by Ceptr. Please view progress there.

Installation

Anansi is written in Clojure so you will need to have some version of Java running on your machine.

Install Leiningen if you haven't already. Assuming you have a bin directory for your user and its already in your shell path you can do it like this:

$ curl -O ~/bin/lein http://github.com/technomancy/leiningen/raw/stable/bin/lein
$ chmod 755 bin/lein
$ lein self-install

Clone this repo and let lein install the dependencies:

$ git clone git://github.com/zippy/anansi.git
$ cd anansi
$ lein deps

Javascript/UI install

Install clojurescript as describe here: https://github.com/clojure/clojurescript/wiki/Quick-Start Compile clojurscript to js with $ cd $ANANSI_HOME/public/ss; rm -rf out; cljsc src > ss.js

Usage

Anansi provides both direct telnet access to issue commands, and also an HTTP API.

To run the server:

$ lein run
Starting web interface on port 8080

You can run the server with options to specify ports and verbose logging too, like this:

$ lein run true             ; for verbose logging & default ports
$ lein run true 3141        ; for verbose logging and custom web port

To access streamscapes UI point browser to http://localhost:8080/ss/index.html

HTTP access

The main access to anansi is through an http api (though telnet access has also been implemented). Anansi runs a web-server on port 8080. You can send POST requests the "/api" url to execute a command. All request are JSON encoded hashes, for example:

$ curl http://localhost:8080/api -d '{"cmd":"get-state","params":{"receptor":13}}'
{"status":"ok","result" ... }

Anansi also directly serves all files (and sub-directories) from the htdocs directory. So, this is where to put UI code for your receptors.

Web Development aka How to set up a Browser Repl

  1. start the server: cd into a clojurescript checkout, run ./script/repl, and from there do

     (require '[cljs.repl :as repl])
     (require '[cljs.repl.browser :as browser])  ;; require the browser implementation of IJavaScriptEnv
     (def env (browser/repl-env)) ;; create a new environment
     (repl/repl env) ;; start the REPL
    
  2. connect from the client. make sure that

      (:require [clojure.browser.repl :as repl])
    

is required in a ns file (currently core.cljs) and that:

      (repl/connect "http://localhost:9000/repl")

is called in the document load.

Architecture

The ceptr platform consists of a nested hierarchy of receptors, with no necessary top.

Documentation

Streamscapes

As a test case for building out the ceptr platform, the anansi server includes a communications integration application called Streamscapes:

Documentation

API Documentation

API

Testing

Using midje, install lein-midje as directed at: https://github.com/marick/Midje/wiki/Lein-midje

Run all the unit tests with

$ lein midje

(Cucumber features are planned...)

Development

issue tracking

wiki

License

Copyright (C) 2011, The MetaCurrencyProject (Eric Harris-Braun, et. al.)

Distributed under the Eclipse Public License, the same as Clojure.

Acknowledgements

Thanks to ztellman for aleph, technomancy for swank-clojure, and all the good folks on the #clojure freenode channel and mailing-list for being way helpful.

anansi's People

Contributors

artbrock avatar leword avatar zippy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

anansi's Issues

nil e-mail subject problem

1bf80214770837250b fixes a bug caused by nil subjects in e-mail. The problem is that you can make JSON elements with nil items and this was causing it up the line. The fix is a bad fix in that it simply skips such e-mails. Need to look deeper at which kinds of e-mails produce that result in the JavaMail code.

multi-select

gotta be able to pick more than one droplet to apply an action to.

speed

Client is far too slow to refresh after about 100 droplets. Gotta fix somehow.

connect incoming to outgoing flow

There has to be some way where users can connect a detected incoming droplet, (by some grammar, or something) to an outgoing flow.

refactor state stuff

currently lots of state stuff is just being stored in vars accessed by globals like: s/grooves

This should probably be refactored into a single state object so that reseting state is automatic, and so on. Also this might cleanly allow for various different kinds of state info, i.e. some of it is the local stuff on the client side, and other aspects are syncronized to the server.

edit contact

editing contact needs to allow not specifying some channel addresses without creating that big nil bug.

channel type ontological problems

Currently the UI is doing a bunch of manual translations on channel names to try and discover the channel type so it can manage the contacts and other things. This needs to be made discoverable in the state.

For example see:
ss/src/streamscapes.clj#get-channel-ident-scape-from-type

refactor ident to contact in the code

All over the place, including in the scape names, we started with the notion of "identity" so there are ident receptors and ident-scapes and so on. This needs to be renamed to contact, to align with our new notion of what it actually is.

data-store

could be redis, couchdb, or something else.

updating the compository

Currently a copy of the compository is instantiated into grooves the first time the code runs. This means that if you update the compository you won't see any changes reflected in already running code. This needs to be addressed. It's part of versioning etc..

must be able to convert grooves on send

If a carrier (channel) can carry a particular grammar, the groove/grammar language must also specify how to convert from the base grammer to that channel's encoding of the groove. The current example we have of this is that xmpp messages natively look like they match subject-body-grammar, but really they are used for simple-message. This means that when creating droplets, folks will use the simple-message groove, but that has to be converted to the base grammar.

Currently we do groove matching on receive, but we don't handle groove transformation on send. This must be done.

Not that for now this is hacked to work in the xmpp-out-bridge.

create a generalized way for updating dialogs that change state

Currently when you create a new contact or edit it the values client side aren't actually refreshed. We have to match the state in the dialog with the state sent to the server.

This means either mean reconstructing the dialog or inserting it. Something smart should be done about how to handle this ala pivotal stuff that Lews has been describing.

droplet filtering

There has to be a way to include in a query a request not to see certain droplets, i.e. ones tagged as in the trash, or spam, etc.

update to clojure 1.3

There may be some small modifications that need making, as well as testing that all dependencies work on 1.3. Not sure if aleph does yet or not.

Merge Contacts

ability to select contact(s) and merge into other existing contact

droplet keyword scape

There has to be a keyword scape that allows searching content across all droplets.

This also probably requires improving the scape query system...

better contact management

1- delete contacts
2- hide, or something, contacts that are auto-created. Maybe all such contacts are the "unknown person" or something.
3- merge/move contact
4- multiple addresses of a given type per contact

icons

Streamscapes icons needed for UI

edit channel

We need to be able to edit the channel information.

delete channel

User should be able to delete a channel from the setup menu.

Question: what happens to any associated droplets?

date test failing

There seems to be a timezone problem where dates parsed by java.util.Date. don't take into account the +0000 in the rfc-822 string passed in.

FAIL at (util.clj:17)
Expected: "2011-10-04T03:21:40.000Z"
Actual: "2011-10-04T05:21:40.000Z"
FAIL at (util.clj:19)
Expected: "2011-10-04T03:21:40.000Z"
Actual: "2011-10-04T05:21:40.000Z"

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.