Giter Club home page Giter Club logo

tarantula's Introduction

tarantula

Build the web

What is tarantula?

Tarantula is a set of tools for practical and robust deployments of web application backends; the main tool groups consist of:

tarantula/log - a logging interface.

tarantula/router - http routing packages.

tarantula/graph - a graph database package.

tarantula/silk - a package which converts a database schema into an API model.

tarantula/markup - html wrapper for SSR webpages.

Package silk

Package silk will generate your web application API model from the database schema.

A typical system will consist of an instance of *graph.Database, a tarantula/router root node, an object that implements http.Server, a database client that implements graph.Client interface, and a logger that implements tarantula/log Logger interface.

Using an instance of a *silk.System, vertex classes can be defined in the graph package's database.


animals := system.AddClass("animal")

animals.AddProperty("species", validation.StringSet("cat", "dog"))
animals.AddProperty("age", validation.Int())

The above class declaration would create these endpoints:


/animal/:uid

/animal/:uid/properties/:propKeys

Defining classes as users is achieved with the .IsUser() method. Adding this attribute will allow silk to generate the registration and login routes.


users := system.AddClass("user").IsUser()

users.AddProperty("name", validation.String(1, 30))
users.AddProperty("age", validation.Int())

Relationships between classes can be modelled using the classes' .Link(...) method. The silk package will use these relationships to model corresponding endpoints exposing pre-configured queries to the graph database.


users.Link("owning", animals)

The above relationship would create:


/user/in/owning/count

/user/in/owning/list

/user/in/owning/export

/user/in/owning/animal/count

/user/in/owning/animal/list

/user/in/owning/animal/export

tarantula's People

Contributors

alexdianomi avatar chainetix avatar gopherdose avatar golangdaddy avatar

Stargazers

Peter Turner avatar Caleb Mingle avatar  avatar  avatar

Watchers

James Cloos avatar Abderraouf Lakhal avatar Benjamin Wall avatar  avatar Peter Turner 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.