PHPackages                             sciactive/nymph - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. sciactive/nymph

ArchivedLibrary[Database &amp; ORM](/categories/database)

sciactive/nymph
===============

Powerful object data storage and querying for collaborative web apps.

1.6.2(8y ago)94315Apache-2.0PHP

Since Oct 7Pushed 4y ago9 watchersCompare

[ Source](https://github.com/sciactive/nymph)[ Packagist](https://packagist.org/packages/sciactive/nymph)[ Docs](http://nymph.io/)[ RSS](/packages/sciactive-nymph/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (25)Used By (0)

 [![Nymph](assets/nymph-header-125.png)](assets/nymph-header-125.png)

======================================================================

[](#--)

[![Build Status](https://camo.githubusercontent.com/62d453cddfe81638cf34a1ed36edf1ab95cc37ad6ddf2530e882b3a2888f138c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7363696163746976652f6e796d70682d7365727665722f6d61737465722e737667)](http://travis-ci.org/sciactive/nymph-server) [![Demo App Uptime](https://camo.githubusercontent.com/656c36c5f80c83b4d5dbe11094332b73fb58eb72646d82bcfbeda4e7887a24d3/68747470733a2f2f696d672e736869656c64732e696f2f757074696d65726f626f742f726174696f2f6d3737363733323336382d6264346361303965646336383164343737613364646639342e737667)](http://nymph-demo.herokuapp.com/examples/sudoku/) [![Last Commit](https://camo.githubusercontent.com/a0499ac3ba5ee0efc6751b2ea091ac9d1c550e44b9ccaeb63549fa1799236c13/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f7363696163746976652f6e796d70682e737667)](https://github.com/sciactive/nymph/commits/master) ![license](https://camo.githubusercontent.com/48c6562862a0aad22c94340273da1ef686f046aaf992760ce094ae8e0cfb368a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7363696163746976652f6e796d70682e737667)

Powerful object data storage and querying for collaborative web apps.

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

Deprecation Notice
------------------

[](#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](https://github.com/sciactive/nymphjs).

Live Demos
----------

[](#live-demos)

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

- [Todo](https://nymph-demo.herokuapp.com/examples/todo/svelte/) ([source](https://github.com/sciactive/nymph-examples/tree/master/examples/todo/))
- [Sudoku](https://nymph-demo.herokuapp.com/examples/sudoku/) ([source](https://github.com/sciactive/nymph-examples/tree/master/examples/sudoku))
- [Simple Clicker](https://nymph-demo.herokuapp.com/examples/clicker/) ([source](https://github.com/sciactive/nymph-examples/tree/master/examples/clicker))

App Template
------------

[](#app-template)

To start building an app with Nymph, you can use the [Nymph App Template](https://github.com/hperrin/nymph-template).

Nymph Entities
--------------

[](#nymph-entities)

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

```
// 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-query-language)

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

```
// 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
------------

[](#nymph-pubsub)

Making collaborative apps is easy with the PubSub server.

```
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
---------------------

[](#usergroup-management)

Tilmeld is a user management system for Nymph. Check it out at [tilmeld.org](https://tilmeld.org/).

Installation
------------

[](#installation)

If you want to build an app with Nymph, you can use the [app template](https://github.com/hperrin/nymph-template).

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](https://github.com/sciactive/nymph/wiki/Setup-Guide) and [PubSub](https://github.com/sciactive/nymph/wiki/PubSub-Server-Setup).

[![Nymph Server](https://camo.githubusercontent.com/20070e3360b1d42ef62e833f20b824b0c94a3d121c55f7b032db6cac29e888af/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7265706f2d6e796d70682532307365727665722d626c75652e737667)](https://github.com/sciactive/nymph-server) [![PubSub Server](https://camo.githubusercontent.com/d8e8192bb1ab2354aa0511f2d1a190795c270168d2bb5e2718bd64c8e900776e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7265706f2d7075627375622532307365727665722d626c75652e737667)](https://github.com/sciactive/nymph-pubsub) [![Tilmeld Server](https://camo.githubusercontent.com/56835c89dc550907836bad139a023aa64fa43b0846e2697f72b6769a733e8b38/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7265706f2d74696c6d656c642532307365727665722d626c75652e737667)](https://github.com/sciactive/tilmeld-server) [![Browser Client](https://camo.githubusercontent.com/fb90ae7fdf351a2ea3ea175eb751a4c140d22b9ed540e265d06ef475711f31de/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7265706f2d62726f77736572253230636c69656e742d627269676874677265656e2e737667)](https://github.com/sciactive/nymph-client) [![Node.js Client](https://camo.githubusercontent.com/81b69ee229abb1614e45fa6973e4fe5900411b4b388cf8f33233d6d9b9950c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7265706f2d6e6f6465253230636c69656e742d627269676874677265656e2e737667)](https://github.com/sciactive/nymph-client-node) [![Tilmeld Client](https://camo.githubusercontent.com/7fac749cfea7b6f02d057a9a0368dee9f7a1cd80174f7e94df8c9ee60d6951f7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7265706f2d74696c6d656c64253230636c69656e742d627269676874677265656e2e737667)](https://github.com/sciactive/tilmeld-client) [![App Examples](https://camo.githubusercontent.com/8f2134da8d7f683eb87eec2a425507539a9f77a50687d9ea3357ab9f1864045a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7265706f2d6578616d706c65732d6f72616e67652e737667)](https://github.com/sciactive/nymph-examples)

### Dev Environment Installation

[](#dev-environment-installation)

If you are interested in working on Nymph itself:

1. [Get Docker](https://docs.docker.com/install/#supported-platforms)
    - You can run the Docker install script on Linux with: ```
        curl -fsSL https://get.docker.com -o get-docker.sh
        sh get-docker.sh
        ```
    - Or, from the repos on Ubuntu: ```
        sudo apt-get install docker.io
        sudo usermod -a -G docker $USER
        ```

        Then log out and log back in.
2. [Get Docker Compose](https://docs.docker.com/compose/install/)
    - From the repos on Ubuntu: ```
        sudo apt-get install docker-compose
        ```
3. Clone the repo: ```
    git clone --recursive https://github.com/sciactive/nymph.git
    cd nymph
    ```
4. Make sure the submodules are on master: ```
    git submodule foreach git checkout master
    ```
5. Run the app: ```
    ./run.sh
    ```

Now you can see the example apps on your local machine:

- Todo App with Svelte
    -
- Todo App with React
    -
- Sudoku App
    -
- Simple Clicker App
    -

API Docs
--------

[](#api-docs)

Check out the [API Docs in the wiki](https://github.com/sciactive/nymph/wiki/API-Docs).

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 99.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~47 days

Recently: every ~33 days

Total

25

Last Release

3123d ago

Major Versions

0.0.4alpha → 1.0.02014-11-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/133c9c4eff1268723fc1be664b5312a40527c6a94bfd40215bf4ff276832738f?d=identicon)[hperrin](/maintainers/hperrin)

---

Top Contributors

[![hperrin](https://avatars.githubusercontent.com/u/195918?v=4)](https://github.com/hperrin "hperrin (295 commits)")[![mistermocha](https://avatars.githubusercontent.com/u/3794969?v=4)](https://github.com/mistermocha "mistermocha (2 commits)")

---

Tags

databasefrontendjavascriptnymphnymph-queryormphppubsubsqlormmysqlpostgresqlpostgresObject Relational MappingObject relational mapperobject databaseobject data store

### Embed Badge

![Health badge](/badges/sciactive-nymph/health.svg)

```
[![Health](https://phpackages.com/badges/sciactive-nymph/health.svg)](https://phpackages.com/packages/sciactive-nymph)
```

###  Alternatives

[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58523.9M36](/packages/scienta-doctrine-json-functions)[dunglas/doctrine-json-odm

An object document mapper for Doctrine ORM using JSON types of modern RDBMS.

6285.0M10](/packages/dunglas-doctrine-json-odm)[cycle/orm

PHP DataMapper ORM and Data Modelling Engine

1.3k835.4k65](/packages/cycle-orm)[aura/sql

A PDO extension that provides lazy connections, array quoting, query profiling, value binding, and convenience methods for common fetch styles. Because it extends PDO, existing code that uses PDO can use this without any changes to the existing code.

5632.5M43](/packages/aura-sql)[aura/sqlquery

Object-oriented query builders for MySQL, Postgres, SQLite, and SQLServer; can be used with any database connection library.

4572.9M34](/packages/aura-sqlquery)[creof/doctrine2-spatial

Doctrine2 multi-platform support for spatial types and functions

2763.3M11](/packages/creof-doctrine2-spatial)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
