2017 © Pedro Peláez
 

library nymph

Don't use sciactive/nymph anymore. You should use sciactive/nymph-server and sciactive/nymph-pubsub.

image

sciactive/nymph

Don't use sciactive/nymph anymore. You should use sciactive/nymph-server and sciactive/nymph-pubsub.

  • Thursday, October 26, 2017
  • by hperrin
  • Repository
  • 12 Watchers
  • 88 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 29 Versions
  • 0 % Grown

The README.md

Nymph

Build Status Demo App Uptime Last Commit license, (*1)

Powerful object data storage and querying for collaborative web apps., (*2)

Nymph is an ORM with a powerful query language, modern client library, REST and Publish/Subscribe servers, and user/group management., (*3)

Deprecation Notice

The PHP implementation of Nymph/Tilmeld has been deprecated. It will no longer have any new features added. Instead, a new version of Nymph running on Node.js, written entirely in TypeScript will replace the PHP implementation. You can find it over at the Nymph.js repo., (*4)

Live Demos

Try opening the same one in two windows, and see one window update with changes from the other., (*5)

App Template

To start building an app with Nymph, you can use the Nymph App Template., (*6)

Nymph Entities

Nymph stores data in objects called Entities. Relationships between entities are done by saving one entity in another one's property., (*7)

// Creating entities is super easy.
async function createBlogPost(title, body, archived) {
  // BlogPost extends Entity.
  const post = new BlogPost();
  post.title = title;
  post.body = body;
  post.archived = archived;
  await post.$save();
  // The post is now saved in the database.
  return post;
}

// Creating relationships is also easy.
async function createBlogPostComment(post, body) {
  if (!(post instanceof BlogPost)) {
    throw new Error("post should be a BlogPost object!");
  }

  const comment = new Comment();
  comment.post = post;
  comment.body = body;
  await comment.$save();
  return comment;
}

const post = await createBlogPost(
  "My First Post",
  "This is a great blog post!",
  false
);
await createBlogPostComment(post, "It sure is! Wow!");

Nymph Query Language

Nymph uses an object based query language. It's similar to Polish notation, as 'operator' : ['operand', 'operand']., (*8)

// Object based queries are easy from the frontend.
async function searchBlogPosts(userQuery, page = 0) {
  // The server will only return entities the user has access to.
  return await Nymph.getEntities(
    {
      class: BlogPost.class,
      limit: 10,
      offset: page * 10,
    },
    {
      type: "&",
      // You can do things like pattern matching.
      like: ["title", "%" + userQuery + "%"],
      // Or strict comparison, etc.
      strict: ["archived", false],
    }
  );
}

// Querying relationships is also easy.
async function getBlogPostComments(post) {
  return await Nymph.getEntities(
    {
      class: BlogPostComment.class,
    },
    {
      type: "&",
      ref: ["post", post],
    }
  );
}

// Complicated queries are easy.
async function getMyLatestCommentsForPosts(posts) {
  return await Nymph.getEntities(
    {
      // Get all comments...
      class: BlogPostComment.class,
    },
    {
      type: "&",
      // ...made in the last day...
      gte: ["cdate", null, "-1 day"],
      // ...where the current user is the author...
      ref: ["user", await User.current()],
    },
    {
      // ...and the comment is on any...
      type: "|",
      // ...of the given posts.
      ref: posts.map((post) => ["post", post]),
    }
  );
}

Nymph PubSub

Making collaborative apps is easy with the PubSub server., (*9)

function watchBlogPostComments(post, component) {
  const comments = component.state.comments || [];

  const subscription = Nymph.getEntities(
    {
      class: BlogPostComment.class,
    },
    {
      type: "&",
      ref: ["post", post],
    }
  ).subscribe((update) => {
    // The PubSub server keeps us up to date on this query.
    PubSub.updateArray(comments, update);
    component.setState({ comments });
  });

  component.onDestroy(() => {
    subscription.unsubscribe();
  });
}

User/Group Management

Tilmeld is a user management system for Nymph. Check it out at tilmeld.org., (*10)

Installation

If you want to build an app with Nymph, you can use the app template., (*11)

You can also install Nymph in an existing app by following the instructions in the server and client repos, or in the wiki for Nymph and PubSub., (*12)

Nymph Server PubSub Server Tilmeld Server Browser Client Node.js Client Tilmeld Client App Examples, (*13)

Dev Environment Installation

If you are interested in working on Nymph itself:, (*14)

  1. Get Docker
    • You can run the Docker install script on Linux with: shell curl -fsSL https://get.docker.com -o get-docker.sh sh get-docker.sh
    • Or, from the repos on Ubuntu: shell sudo apt-get install docker.io sudo usermod -a -G docker $USER Then log out and log back in.
  2. Get Docker Compose
    • From the repos on Ubuntu: shell sudo apt-get install docker-compose
  3. Clone the repo: shell git clone --recursive https://github.com/sciactive/nymph.git cd nymph
  4. Make sure the submodules are on master: shell git submodule foreach git checkout master
  5. Run the app: shell ./run.sh

Now you can see the example apps on your local machine:, (*15)

  • Todo App with Svelte
    • http://localhost:8080/examples/examples/todo/svelte/
  • Todo App with React
    • http://localhost:8080/examples/examples/todo/react/
  • Sudoku App
    • http://localhost:8080/examples/examples/sudoku/
  • Simple Clicker App
    • http://localhost:8080/examples/examples/clicker/

API Docs

Check out the API Docs in the wiki., (*16)

The Versions

26/10 2017

1.6.2

1.6.2.0 http://nymph.io/

Don't use sciactive/nymph anymore. You should use sciactive/nymph-server and sciactive/nymph-pubsub.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

orm postgresql postgres mysql object relational mapping object relational mapper object database object data store

25/10 2017

dev-node-support

dev-node-support http://nymph.io/

Powerful object data storage and querying for collaborative web apps.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

orm postgresql postgres mysql object relational mapping object relational mapper object database object data store

21/07 2017

dev-master

9999999-dev http://nymph.io/

Powerful object data storage and querying for collaborative web apps.

  Sources   Download

Apache-2.0 LGPL

The Requires

 

The Development Requires

orm postgresql postgres mysql object relational mapping object relational mapper object database object data store

21/07 2017

dev-v1.6-dev

dev-v1.6-dev http://nymph.io/

Powerful object data storage and querying for collaborative web apps.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

orm postgresql postgres mysql object relational mapping object relational mapper object database object data store

21/07 2017

1.6.0

1.6.0.0 http://nymph.io/

Powerful object data storage and querying for collaborative web apps.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

orm postgresql postgres mysql object relational mapping object relational mapper object database object data store

18/06 2017

1.5.4

1.5.4.0 http://nymph.io/

Powerful object data storage and querying for collaborative web apps.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

orm postgresql postgres mysql object relational mapping object relational mapper object database object data store

18/06 2017

1.5.5

1.5.5.0 http://nymph.io/

Powerful object data storage and querying for collaborative web apps.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

orm postgresql postgres mysql object relational mapping object relational mapper object database object data store

16/06 2017

dev-cleanup

dev-cleanup http://nymph.io/

Powerful object data storage and querying for collaborative web apps.

  Sources   Download

Apache-2.0 LGPL

The Requires

 

The Development Requires

orm postgresql postgres mysql object relational mapping object relational mapper object database object data store

16/06 2017

1.5.1

1.5.1.0 http://nymph.io/

Powerful object data storage and querying for collaborative web apps.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

orm postgresql postgres mysql object relational mapping object relational mapper object database object data store

16/06 2017

1.5.2

1.5.2.0 http://nymph.io/

Powerful object data storage and querying for collaborative web apps.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

orm postgresql postgres mysql object relational mapping object relational mapper object database object data store

02/09 2015

1.4.3

1.4.3.0 http://nymph.io/

Powerful object data storage and querying for collaborative web apps.

  Sources   Download

LGPL

The Requires

 

The Development Requires

orm postgresql postgres mysql object relational mapping object relational mapper object database object data store

17/04 2015

1.4.2

1.4.2.0 http://nymph.io/

Powerful object data storage and querying for collaborative web apps.

  Sources   Download

LGPL

The Requires

 

The Development Requires

orm postgresql postgres mysql object relational mapping object relational mapper object database object data store

16/04 2015

1.4.1

1.4.1.0 http://nymph.io/

Powerful object data storage and querying for collaborative web apps.

  Sources   Download

LGPL

The Requires

 

The Development Requires

orm postgresql postgres mysql object relational mapping object relational mapper object database object data store

27/03 2015

1.4.0

1.4.0.0 http://nymph.io/

Powerful object data storage and querying for collaborative web apps.

  Sources   Download

LGPL

The Requires

 

The Development Requires

orm postgresql postgres mysql object relational mapping object relational mapper object database object data store

16/02 2015

1.4.0-beta.1

1.4.0.0-beta1 http://nymph.io/

An object relational mapper with PHP and JavaScript interfaces.

  Sources   Download

LGPL

The Requires

 

orm postgresql postgres mysql object relational mapping object relational mapper object database

16/02 2015

1.4.0-beta.2

1.4.0.0-beta2 http://nymph.io/

An object relational mapper with PHP and JavaScript interfaces.

  Sources   Download

LGPL

The Requires

 

orm postgresql postgres mysql object relational mapping object relational mapper object database

16/02 2015

1.4.0-beta.3

1.4.0.0-beta3 http://nymph.io/

An object relational mapper with PHP and JavaScript interfaces.

  Sources   Download

LGPL

The Requires

 

The Development Requires

orm postgresql postgres mysql object relational mapping object relational mapper object database

16/02 2015

1.4.0-beta.4

1.4.0.0-beta4 http://nymph.io/

An object relational mapper with PHP and JavaScript interfaces.

  Sources   Download

LGPL

The Requires

 

The Development Requires

orm postgresql postgres mysql object relational mapping object relational mapper object database

04/11 2014

0.0.4alpha

0.0.4.0-alpha http://nymph.io/

An object relational mapper with PHP and JavaScript interfaces.

  Sources   Download

LGPL

The Requires

 

orm postgresql postgres mysql object relational mapping object relational mapper object database

04/11 2014

1.0.0

1.0.0.0 http://nymph.io/

An object relational mapper with PHP and JavaScript interfaces.

  Sources   Download

LGPL

The Requires

 

orm postgresql postgres mysql object relational mapping object relational mapper object database

04/11 2014

1.0.0beta1

1.0.0.0-beta1 http://nymph.io/

An object relational mapper with PHP and JavaScript interfaces.

  Sources   Download

LGPL

The Requires

 

orm postgresql postgres mysql object relational mapping object relational mapper object database

04/11 2014

1.0.0beta2

1.0.0.0-beta2 http://nymph.io/

An object relational mapper with PHP and JavaScript interfaces.

  Sources   Download

LGPL

The Requires

 

orm postgresql postgres mysql object relational mapping object relational mapper object database

04/11 2014

1.0.0beta3

1.0.0.0-beta3 http://nymph.io/

An object relational mapper with PHP and JavaScript interfaces.

  Sources   Download

LGPL

The Requires

 

orm postgresql postgres mysql object relational mapping object relational mapper object database

04/11 2014

1.0.0beta4

1.0.0.0-beta4 http://nymph.io/

An object relational mapper with PHP and JavaScript interfaces.

  Sources   Download

LGPL

The Requires

 

orm postgresql postgres mysql object relational mapping object relational mapper object database

04/11 2014

1.1.0

1.1.0.0 http://nymph.io/

An object relational mapper with PHP and JavaScript interfaces.

  Sources   Download

LGPL

The Requires

 

The Development Requires

orm postgresql postgres mysql object relational mapping object relational mapper object database

04/11 2014

1.2.0

1.2.0.0 http://nymph.io/

An object relational mapper with PHP and JavaScript interfaces.

  Sources   Download

LGPL

The Requires

 

The Development Requires

orm postgresql postgres mysql object relational mapping object relational mapper object database

04/11 2014

1.3.0

1.3.0.0 http://nymph.io/

An object relational mapper with PHP and JavaScript interfaces.

  Sources   Download

LGPL

The Requires

 

The Development Requires

orm postgresql postgres mysql object relational mapping object relational mapper object database

07/10 2014

0.0.2alpha

0.0.2.0-alpha http://nymph.io/

An object relational mapper with PHP and JavaScript interfaces.

  Sources   Download

LGPL

The Requires

 

orm postgresql postgres mysql object relational mapping object relational mapper object database

07/10 2014

0.0.3alpha

0.0.3.0-alpha http://nymph.io/

An object relational mapper with PHP and JavaScript interfaces.

  Sources   Download

LGPL

The Requires

 

orm postgresql postgres mysql object relational mapping object relational mapper object database