DEV Community

Discussion on: Any recommendations for a Rails-like NodeJS toolchain for building APIs?

Collapse
 
mful profile image
Matt

Yeah, that's kinda what I was worried about :D

I get the thinking behind it, and totally understand why many folks prefer the almost unix-y approach of small, separated tools, that you can combine as you choose. For me, developer productivity is a key consideration, and having consensus, battle-tested tools like those in the Rails world naturally fosters said productivity. Also makes it really easy to find answers to questions :)

So far, here is the stack I'm playing with, given some recommendations from another developer community:

Express + body-parser (JSON API support)
Knex (Database interface)
Knex + knex-migrate (migrations)
Bookshelf (ORM)
pg (PostgreSQL support)
mocha + chai + chai-http (API testing)
morgan (logging)
gulp (task runner)

(Open to suggestions if anyone prefers other tools)

In comparison, the same functionality in Rails looks like this:

rspec + webmock (API testing)
Rails (Everything else)

I also find myself writing lots of cli scripts that rails has built in, such as a console/repl that loads app files, DB creation scripts, DB seed scripts (Knex's built-in seed functionality doesn't work if seed order matters — important for relational data).

Anyway, seeing how spoiled I was in the Rails world :)