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

Derbyjs: how to connect to it with no-browser socket.io-client

step: start a derby app write a standalone node client app , set up socket.io-client , connect to derby's store's sockets questions: the client is not run at browser, so it don't has session, can it pass Racer's socket authorization? how to write…
atian25
  • 4,166
  • 8
  • 37
  • 60
1
vote
1 answer

Derbyjs TEMPLATE ERROR

I just started trying out Derbyjs, and I already ran into a problem. I can't find any support for this error, and most likely is some dumb mistake i'm making. I'm trying to render a view, following the example from the www.derbyjs.com…
F. Santiago
  • 842
  • 10
  • 18
1
vote
1 answer

Why my model does not get synced?

I've written my first program with racer. It displays a simple text box manually bound to 'col.doc.prop' path. When I change the value, it does not apply to the store at server. What causes my subscribed model not to get sync with server? Server…
tech-man
  • 3,166
  • 2
  • 17
  • 18
1
vote
2 answers

Results from MongoDB

I'm running into two issues with Derby and Mongo. I come from a MySQL and Redis background so maybe I'm just doing something wrong? 1) It seems I can't search for an Id whose type is ObjectId. model.query("users").byKey(params.userId); Will only…
Stephen Corgiat
  • 105
  • 1
  • 7
1
vote
3 answers

What tools to use for a website with lots of "realtime" page updates (coming from a Rails background)?

We are planning to make a "large" website for I'd say 5000 up to many more users. We think of putting in lots of real time functionality, where data changes instantly propagate to all connected clients. New frameworks like Meteor and DerbyJS look…
Nico
  • 881
  • 1
  • 6
  • 19
1
vote
1 answer

npm dependency resolution -OR- help! i cannot install derbyjs

I have been trying to install Derby, and npm keeps insisting it cannot find a suitable version of express. Here's the command I am using: npm install -g derby. Below is the output. I am running Ubuntu 11.10, node v0.7.6 and npm v1.1.17. Am I doing…
ravinggenius
  • 816
  • 1
  • 6
  • 14
0
votes
2 answers

How to clear a value on page load for derbyjs

Just out of curiosity if I have a chat application with an unread message counter... How do I reset that counter? Simply put, when User A writes a message, B increments there unread counter. When B is on the message page, I would like to reset that…
msj121
  • 2,812
  • 3
  • 28
  • 55
0
votes
1 answer

Check if model contains key derbyjs

Is there a way to check if a property exists on a model? var self = model.get("users."+userId); if (! self.name.firstName){ //do something }
msj121
  • 2,812
  • 3
  • 28
  • 55
0
votes
1 answer

file not showing up in render derbyjs

I have a new file: message.html Restarting node doesn't seem to get it to render. Pointing derby to render a different file works, just not "message".... I assume the filesystem or something is having an issue. For the record, it isn't the html file…
msj121
  • 2,812
  • 3
  • 28
  • 55
0
votes
1 answer

How to use indexof on array derbyjs

I have an array passed to my template and I want to see if I have the value stored in it: {{each _page.friends as #friend}} {{if _page.user.friends.indexOf(#friend.id)<0}} {{else}} Already Friends …
msj121
  • 2,812
  • 3
  • 28
  • 55
0
votes
1 answer

How to get email of Derby-Login user

I can easily get the user id from model.get("session.userId"); I am having trouble finding out how to use this to get the user's email.
msj121
  • 2,812
  • 3
  • 28
  • 55
0
votes
1 answer

how to save to derbyjs database properly

I want to use the userId in the session... to be able to save the users firstname and everything... I am trying in vein to use models.add("users."+userId) in vein.... app.proto.editUser = function(){ var userId = this.model.get('_page.userId'); …
msj121
  • 2,812
  • 3
  • 28
  • 55
0
votes
1 answer

Using {{each}} block to iterate through an array backwards in DerbyJS

In a DerbyJS component, I have an array items, which I want to display in the view. I want to display the latest items of the array first, so I am looking for something like each-reverse: {{each-reverse items as #item}} …
Anastasia
  • 184
  • 11
0
votes
1 answer

Start a simple DerbyJS project on Cloud9

I am trying to deploy a simple derby project on Cloud9. I have created a workspace using Node.js and added the content of following 4 files. index.html: Holler:
Jamgreen
  • 10,329
  • 29
  • 113
  • 224
0
votes
1 answer

Calling server-side code from client on Derby.js

I'm new to using Derby.js, and have scaffolded out a project using the yeoman generator-derby package. I thought everything was going fine, but I can't figure out what I'm doing wrong here. A breakdown: I have an 'app/dbWp.js' controller that…
amizzo
  • 55
  • 4