Questions tagged [derbyjs]

Derby.js is a full-stack JavaScript MVC framework with support for HTML templates, view bindings, model syncing, customizable persistence and conflict resolution.

Derby is a full-stack JavaScript MVC framework built on top of popular libraries, including Node.js, Express, Socket.IO, Browserify, Stylus, UglifyJS, MongoDB, and soon other popular databases and datastores. These libraries can also be used directly. The data synchronization layer, Racer, can be used separately. Other client libraries, such as jQuery, and other Node.js modules from npm work just as well along with Derby.

Features:

  • HTML templates: Handlebars-like templates are rendered into HTML on both the server and client. Because they render on the server, pages display immediately—even before any scripts are downloaded. Templates are mostly just HTML, so designers can understand and modify them.

  • View bindings: In addition to HTML rendering, templates specify live bindings between the view and model. When model data change, the view updates the properties, text, or HTML necessary to reflect the new data. When the user interacts with the page—such as editing the value of a text input—the model data updates.

  • Client and server routing: The same routes produce a single-page browser app and an Express server app. Links render instantly with push/pop state changes in modern browsers, while server rendering provides access to search engines and browsers without JavaScript.

  • Model syncing: Model changes are automatically synchronized with the server and all clients subscribed to the same data over Socket.IO.

  • Customizable persistence: Apps function fully with in-memory, dynamic models by default. Apps can also use the racer-db-mongo plugin to add MongoDB support with no change to the application code. Any changes to data made within the app are automatically persisted. Adding support for other databases is simple.

  • Conflict resolution: The server detects conflicts, enabling clients to respond instantly and work offline. Multiple powerful techniques for conflict resolution are included.

94 questions
1
vote
1 answer

Including Styles Across Apps in Derby.js

In a Derby.js app, I am trying to install skeleton through bower and include it in all derby apps. I know how to include styles within a single app, but can they be registered to all apps at once? For instance if I had the following apps: + apps …
BenM
  • 553
  • 1
  • 6
  • 23
1
vote
1 answer

Get count of documents without loading the whole collection in DerbyJS 0.6

How can I count the results of a query without loading the whole resultset into memory? The easy way of counting documents returned by a query would be: var q = model.query('mycollection', { date: today }); q.fetch(function() { var length =…
Roman
  • 5,888
  • 26
  • 47
1
vote
1 answer

Import "normal" MongoDB collections into DerbyJS 0.6

Same situation like this question, but with current DerbyJS (version 0.6): Using imported docs from MongoDB in DerbyJS I have a MongoDB collection with data that was not saved through my Derby app. I want to query against that and pull it into my…
Roman
  • 5,888
  • 26
  • 47
1
vote
1 answer

Server-side model change event in DerbyJS 0.6

In DerbyJS: How do I add event listeners to "The Model", only server side, without having to rely on requests (express middleware)? Related question I've found: How to create server-side application logic on Racer / DerbyJS? Of course I can write an…
Roman
  • 5,888
  • 26
  • 47
1
vote
2 answers

Using Node Inspector with Derby App?

I would like to use node-inspector to debug an application written with Derbyjs, but have not had much success. I think the problem is that derby runs in a child process. My code loads like this: derby.run(function () { ... }); When I start the app…
Scheiner
  • 87
  • 1
  • 6
1
vote
1 answer

couldn't show list of documents in the view using derbyjs

It's my first time with derbyjs, don't know if i am being stupid or is it a lack of documentation. i have a model called "books", and i am just trying to show list of books. here is my code: module.exports = { properties: { title: {type:…
shehata
  • 531
  • 6
  • 20
1
vote
1 answer

Derby.js Front end and Backend interaction

I'm new to NodeJs and i'm a core java developer. Can anyone explain me how DerbyJs interacts with Backend and how backend replies to frontend in turn? I can see many functions. not sure which function i should use for which scene!! I created a…
1
vote
2 answers

Derbyjs v0.6 app.fn() doesn't exist

I'm following the Multi-Payer Notepad game tutorial on youtube and can't get the x-bind to work, because I get the following error: app.fn('startGame', function(e, el) { ^ TypeError: Object # has no method 'fn' I'm assuming this method was…
1
vote
1 answer

Access ShareJS metadata from DerbyJS

DerbyJS uses ShareJS for its data synchronization. ShareJS stores various metadata values, as you can see here: { "id" : "ABCDEFG12345", "_type" : "http://sharejs.org/types/JSONv0", "_v" : 3, "_m" : { "mtime" : 1403674645713, "ctime" : 1403674645618…
Leon Mergen
  • 336
  • 4
  • 14
1
vote
1 answer

DerbyJS Find Record from collection

I wand to get record from collection var query=model.query('sales.dept',{price:100}); model.subscribe(query,function(err,bun) { var data= query.ref('+page.sales').get(); //its return empty array console.log(data); });
Murugan Pandian
  • 768
  • 1
  • 5
  • 17
1
vote
1 answer

Where can I put my client file in derbyjs

I'm new to derbyjs and I want to know where I can put my client js file in derbyjs ? Can I place it into the /public/js folder ? or in components folder /ui ? Thanks :)
Ricklemer
  • 201
  • 1
  • 2
  • 10
1
vote
0 answers

How to troubleshoot ECONNREFUSED error?

I'm trying to get the d3.js demo given here to work. I'm following along the instructions in the README.md file. I get the npm install step to work, but the next step, node server, fails: % node server Master pid 16196 16197 listening. Go to:…
kjo
  • 33,683
  • 52
  • 148
  • 265
1
vote
1 answer

Is it possible to access m.mtime or m.ctime from share.js in derby.js?

I notice that (I think) share.js creates a sub-document called m that contains mtime and ctime in my database. Is there a derby.js way to $orderby based on those attributes? Thanks
rdprescott
  • 11
  • 1
1
vote
1 answer

derbyJS with canvas synchronisation example

Starting out with derbyJS. I am looking for a working example (or directions) for a small derbyJS app that synchronizes the content of a canvas. Something like the multiplayer notepad screencast, but using an HTML canvas. Edit : I will only ever…
nha
  • 17,623
  • 13
  • 87
  • 133
1
vote
1 answer

derby.js How can I query using $skip and $limit on a sorted collection?

Sorry if this is a dump question but I cannot figure it out. As collections grow in size, it become convenient to render a portion of the data. For that we can something like model.query('items', { $skip: 30, $limit: 30 }) but what if we want to…
rprescott
  • 13
  • 3