Node on Fire includes a list of amazing modules and features to help you write apps faster:
Angular's dependency injection is great. That's why, in Node on Fire, that dependency injection is also available in the back-end.
You can even use the simpler implicit annotation because Node on Fire seamlessly replaces implicit annotations with inline array notations in the build phase.
apppost'/api/users'return UserModelcreaterequestbodythenreturn user;;;
When you create a service, it's available on both the front- and the back-end. This makes it easy to re-use code in your UI but also in your back-end logic.
// This creates a GET route and returns 123 from MyService (in the back-end).appget'/api/value'return MyServicegetValue;;// This creates a controller and sets the scope's value to 123 from MyService (in the front-end).appcontroller'/'$scopevalue = MyServicegetValue;;// This is an isomorphic service, available in both the front- and the back-end.appservicereturn 123;;;
It's easy to declare your data model and all associations (one-to-one, one-to-many and many-to-many).
appmodelthislist = thisBelongsToTodoListModel thisRequired;thisname = thisString thisRequired;thiscompleted = thisBoolean thisRequired thisDefaultfalse;thiscreatedAt = thisDateTime thisDefault'CURRENT_TIMESTAMP';;appmodelthisitems = thisHasManyTodoItemModel thisAutoFetch;thiscreatedAt = thisDateTime thisDefault'CURRENT_TIMESTAMP';;
All changes to your data model are applied through migrations. This makes it super easy to share your data model. You do not need to write migrations yourself, instead, migrations are generated automatically based on the changes of your models.
thismodelscreateModel'TodoItem'id: thisUUID thisCanUpdatefalselist: thisBelongsTothismodelsTodoList thisRequiredname: thisString thisRequiredcreatedAt: thisDateTime thisDefault'CURRENT_TIMESTAMP';thismodelscreateModel'TodoList'id: thisUUID thisCanUpdatefalseitems: thisHasManythismodelsTodoItemcreatedAt: thisDateTime thisDefault'CURRENT_TIMESTAMP';;thismodelsdestroyModel'TodoItem';thismodelsdestroyModel'TodoList';;
It's trivial to create A/B tests. Tests work with your existing analytics service e.g. Mixpanel.
iftextOfButtonTest == 'A'$scopebuttonText = 'Register for FREE';else$scopebuttonText = 'Register now';;appcontroller'/' StartController;returnreturn TextOfButtonTestparticipate;;;
Workers execute background tasks to off-load intensive tasks from the web process. It is super easy to create workers.
appworkervar defer = Qdefer;mandrill'/messages/send'message:to:email: useremailname: usernamedefermakeNodeResolver;return deferpromise;;;
It's easy to queue a background task from a web process which the worker executes in a worker process.
apppost'/api/forgot-password'return UserModelgetMerequestthenreturn MailWorkersendResetPassworduser userresetPassword;;;
To make your app feel even more snappy, Node on Fire utilizes smart caching. Node on Fire instantly shows a result if a cache is available, and quickly replaces it with a fresh version from your back-end.
Node on Fire automatically purges any cache when a related model gets created or updated.
// retrieve a recipeRecipeModelfindOneid: $routeparamsid autoReload: true cache: 1000 * 60 * 5then// recipes;
All your config is stored in the
.env file (this file shouldn't be tracked in version control), but you can use the
fire command line interface to manage the config. You can e.g. set
production by invoking
fire config:set NODE_ENV=production or view your config by invoking
$ fire configDEBUG:NODE_ENV: developmentSESSION_KEYS: XI4frrvs+z1JU9auFEmOIAtM...FL3di8Eysw==DATABASE_URL: postgres://firstname.lastname@example.org/todomvc
Install Node on Fire globally:
$ npm install -g fire
Create your first app:
$ fire apps:create helloworld
Run your app:
$ cd helloworld/$ fire run
For additional reading and documentation please visit http://nodeonfire.org/.
0.41.0 and later, every odd numbered minor release is a beta release. Every even numbered minor release is considered a stable release.
Open an issue over at GitHub or send a tweet to @nodeonfire.