DrumKit.js
DrumKit is a plugin-powered, full-stack Web development framework for Node.js. It allows the developer to write one set of CoffeeScript/JavaScript files and run them both on the server and on the browser.
WARNING! This framework is currently in very early development, it may be broken or may break at any time.
Why Use DrumKit?
Server/Browser Share Code
- DrumKit gives you a consistent framework API for both the server and the browser, letting you share your implementation code between them.
- Use models to perform CRUD operations on the database from either the server or browser.
- One set of URL routes allow your server to serve fully rendered pages, while the browser renders pages dynamically.
- Your view templates and helper methods are shared between the server and browser, allowing for full rendering capabilities in either environment.
Optimized for Fat Client Apps
- DrumKit automatically packages your JS and CSS assets into a single JS and CSS file.
- Routing in the browser degrades gracefully from
pushStateto hash-bang URLs, and even work without JavaScript enabled. - DrumKit provides built-in support for rendering "snapshots" of hash-bang URLs for the Google crawler.
- Data transport between the server and browser is baked in using Websockets/AJAX and is abstracted away from the developer's concerns.
Your Favorite Languages
- CoffeeScript is fully supported and compiled on the fly.
- Both EJS and ECO templating engines are supported for views.
- Stylus files are compiled on the fly for generating CSS assets.
- Easy to add support for your libraries of choice.
Flexibile and Extensible
- DrumKit plugins are easy to build and easy to hack, giving you all the flexibility you should need.
- Mix'n'match plugins to meet the specific needs of your app.
- DrumKit's core features are just plugins, so they too can be extended or replaced entirely.
- DrumKit plugins are easy to publish, find and install using
npm. drumkitcommand line tools can be added by plugins.
Installation
DrumKit is dependent on Node.js and NPM. If you have both, you can install DrumKit globally:
npm install -g drumkit
It is important to install this globally so that you have access to the drumkit command across your system.
All DrumKit modules on the other hand will be installed locally in each of your DrumKit projects.
Getting Started
DrumKit will bootstrap a project directory for you with the create command:
cd ~/myapps
drumkit create new-app
This will generate a DrumKit application in ~/myapps/new-app and will use npm to install
your dependencies. Once your app is installed, you can start the server:
cd new-app
drumkit start
By default, your app will be running at http://localhost:8080.
Running the Console
You also can interact with your code in a REPL by firing up the console:
cd path/to/your/app
drumkit console
Now Build Out Your App!
Build models with dk-model (see also dk-model-couchdb and dk-couchdb).
Build view templates and helpers with dk-template.
Build routes with dk-routes.
-
Check out these other core DrumKit plugins:
Start building your own plugins with
drumkit plugin [pluginName]
TODO List
I am actively looking for collaborators on DrumKit and would love your help! Please get in touch if you have ideas for specific tasks you would like to take on. As this is only version 0.1.0, there is still a huge amount of work to be done! This includes, but is not limited to:
Bug Reporting / Squashing
Now that the basic APIs for DrumKit have been firmed up and documented, work is needed to start building out test DrumKit apps to see what bugs are present.
Automated Testing
The existing plugins currently do not have test suites for regression testing. Adding test suites for these APIs as soon as possible is crucial for encouraging project collaboration, minimizing developer frustration and ensuring working code.
In the same way that all plugins are built the same way within the DrumKit API, I would like to see a consistent test runner used for all plugins' tests. Ideally, this should also be made available to DrumKit app developers that want to write tests for their implementation code.
I am currently open to two testing tools -- Jasmine and Vows. I love Jasmine and think it's an excellent tool, but Vows currently has a lot of traction in the Node community and seems to excel with async code. I would like to see a `dk-test` plugin built that sets up a library-agnostic testing environment, and then `dk-test-jasmine` and `dk-test-vows` (and eventually others) will include library specific implementations.
And the rest...
- Create
dk-mongodbanddk-model-mongodb - Create
dk-postgresanddk-model-postgres - Create
dk-datafor key/value persistence. - Create
dk-data-redisanddk-data-membase - Integrate offline support into all plugins, maybe with
dk-offline. - Incorporate more of CouchDB's features into
dk-couchdb - Add DrumKit logging.
- Find better way of debugging JavaScript compiled from CoffeeScript on the fly.
- Significantly improve capabilities of
dk-routesandRouteContext - Add validations to
dk-model - Improve typecasting of properties in
dk-model - Swap out callbacks for promises when possible (esp. in models).
- Browser detection of Websocket support
- Improve error handling in all plugins.
- Add HTTPS support.
- Create
dk-deployfor host-agnostic deployment workflows. - Create
dk-deploy-nodejitsu,dk-deploy-heroku, etc. - Incorporate dependency management between plugins.
- And there's plenty more... let me know if you have suggestions!