NodeFly Buzz: Chocolate.js with Jean-Claude Levy

“Why Node.js?” some folks ask. In response, we like to show off cool products, pages or projects that use Node.js in our “NodeFly Buzz”. This time around, the NodeFly Buzz focuses on Jean-Clause Levy’s Chocolate. Chocolate is a simple webapp framework built on Node.js using Coffeescript.

In the 1980s Jean-Claude Levy brought “Tennis Championship” and Broderbund Software’s “Showoff” to Apple and the legendary action-adventure game “Prince of Persia” to Atari. He earned an M.S. in Computer Science at the Florida Institute of Technology in 1988. In 1991, he followed Steve Jobs adventure at NeXT by creating a NeXT Center in Paris. From 1997 to 2000 he helped top French companies use Microsoft technologies as Application Development Consultant. He was Information Technology Manager at Visiolis, the first company that enabled remote online expertise in the French motorcar insurance industry. For the last ten years, Jean-Claude Lev has been an Independent Consultant and Software Author in Paris, France.

That is one full CV. For now, though, we want to talk about Chocolate.js. 


NodeFly: What’s the background on Chocolate?

Jean-Claude Levy: I have a long run project called Intentware. My goals are enabling non-programmers to easily program and to create a better experience with office-like apps.

My main concerns were: having only one programming language to deal with servers, clients, database, user interface, workflow; having a programming language with a nice balance between imperative and functional orientation, and; having an immediate computing environment where, like in Excel, there is no time between intention and realization.

In 2011, after an exploration in the Python world, I discovered Coffeescript. It was the language I was looking for. At that time, I also took some time with Node.js and I liked its simplicity.

I, then, (re)started to build Intentware using Node.js and Coffeescript.

I quickly needed an online web development environment, so I created one. I called it Chocolate. Why? Because I don’t drink coffee!

NodeFly: Makes sense! Can you tell us why folks would want to use this framework?

Levy: Chocolate wants to make programming accessible. This means, anywhere you have a screen connected to Internet you can continue working on your code. And anytime you have an idea, or a question about your code, you can immediately test it.

With Locco and The Lab, Chocolate allows you to edit every source code file online and test live code.

Another basic idea is: specify, code and document should be one and the same activity. 
Chocolate goes in that direction with Specolate and Doccolate, which make those activities closer to each other.

Chocolate is free, open source and wants to stays as simple and close to standards as it can be. Chocolate can be used in conjunction other tools and framework like Express, Derby or Meteor.

I hope people will like Chocolate and help me make it clean, simple, and complete.

NodeFly: We love the naming conventions of Chocokup, Specolate and Doccolate. Can you tell us about these features and the other cool features of Chocolate?

Levy: As you will see Chocolate integrates great technologies created by really great guys.

I discovered Coffeekup just after Coffeescript. It allows you to write HTML code using a pure Coffeescript syntax. It’s what I was looking for: only one language. So I used it in Chocolate. 
However, I prefer panel oriented UI than page oriented UI, so I extended a little bit Coffeekup to introduce this panel orientation.

And as I was looking for a new name I decided put some Chocolate in every name! So here came Chocokup. And now my templates are kups of chocolate! 

Jeremy Ashkenas showed me Docco, a nice tool he created to produce good-looking documentation from your code. And as I transformed it to be available client side, it became Doccolate. Now, when I want to document my code, I can immediately see if it’s readable and useful.

And then, there is the spec part to complete the SpeCoDoc trilogy. I chose Jasmine.js so that I can have Behavior (or Test) Driven Development integrated in Chocolate. I made it available as simply as I could, client side and server side. With a nice chocolate layer it became Specolate. Of course it’s not complete but I find it really useful to program and not only to test.

Other nice features in Chocolate are The Lab and Newnotes. The Lab is a place where I do pair programming with myself. I write code in Coffeescript and as it is translated in Javascript I can have a different look at it. It has a Chocokup view where you type HTML with Coffeescript syntax and see the HTML produced and the final result in a live view. There is much room for improvements but I already like it a lot.

I also use The Lab to debug some code with the live debug view. It tries to mimic the tools shown by Bret Victor in his famous lecture (Inventing on Principles). 
I have to rewrite it for Javascript, to be more complete and also available server side, but it has already proved to be really useful.

Finally, Newnotes is the tool I’m currently working on. The purpose was to have a place to note where I am in my development, test or debugging activities when I have to stop working on it. 
But it quickly became a project on its own. The most impressive part is currently that it can display a branch in my notes as an Impress.js presentation. I used this with my Webapps development students.


NodeFly: You built this with Coffeescript. How did the whole development process go?

Levy: I started with Node.js and Coffeescript installed on a Debian 5.0 server virtual machine, plus Notepad++ and Filezilla installed on a windows 7client machine. Online editing was my first goal. I selected CodeMirror and Ace. I started with the first one and then changed my mind and used Ace.

I also decided that my main language would be Coffeescript and that my server would run with the Coffee command. A monitor service would see when source files change and then restart the application.

Then, gradually, Chocolate appeared. It included:

  •  Online source editing
  •  Jasmine basic integration
  •  Git integration
  •  Docco integration
  •  Locco protocol development
  •  Coffeekup integration
  •  Coffeekup extended (Chocokup)
  •  Basic client side ‘require’ introduced
  •  Session and registration introduction
  •  Source file sync between clients with polling
  •  Studio creation to integrate all those tools
  •  Live debug (Bret Victor lecture) introduced
  •  Immediate Chocokup available
  •  Interactive Docco introduced (Doccolate)
  •  Jasmine improvements (Specolate)
  •  Newnotes development
  •  Impress.js in Newnotes

Also, I wanted to make it look like chocolate tablets and make it available on Github and npm.

NodeFly: What were the benefits of creating this with Node.js and Coffeescript?

Levy: It creates a basic, simple, lightweight and immediate environment.

Node.js is modular and the mono-process, mono-thread and asynchronous orientation is relaxing. It made me leave the Microsoft environment with a great relief.

I could say that although I’ve had written tens of thousands of lines in JavaScript, I was not really good in JavaScript. Coffeescript helped me discover many things that were obscure to me.

NodeFly: What have your users said about Chocolate?

Levy: “It’s literally chocolate!” Many find it impressive and would love to use it at work, but most are stuck to heavy tools and environment.

I gave it to my students who learn web app development. They simply use it, and make good progress. I must say that I made them first use the service which is amazing but had load problems. With Chocolate it was really easy to share a virtual machine with 20 users developing online at the same time. It’s light.

I’m now looking for feedback, ideas and help.

NodeFly: What does the future have in store for Chocolate?

Levy: Many, many things. Simple and innovative database integration. Automatic user interface. User and security management. I will continue to go in the same direction: making it possible for enthusiasts to program. I’m only at the very beginning.

NodeFly: Sounds like you have a full plate. Do you have any other Node.js projects in the future?

Levy: Yes, I want we recreate all Office-like tools we use. I’m really not satisfied at all with the one we have. The first step is with Newnotes that could really be a breakthrough.

I want to thank you for your interest and your questions that help me think and speak about Chocolate!

NodeFly: Our pleasure!

You can check out Chocolate and try out a demo at to see Chocolate UI in action.

If you know all about some company or project that makes Node.js shine, email us at so we can share!