This document is a personal note space, driven by my own research and preferences, about full-stack development with Node.js.
My aim is to distill current and cutting-edge frameworks, tools and practices that I want to keep track of, investigate or use in Node.js projects. These involve items in the following general categories:
- Coding (IDEs, formatting, organization, documentation, frameworks/libraries, version control, etc.)
- Testing (unit, load, API, coverage)
- Security
- Deployment (configuration, load balancing, automation, monitoring/logging, etc.)
Currently, this is mostly server-oriented.
- Fossil is a distributed SCM, issue tracking system and wiki.
- Gerrit Code Review instead of gitflow (read Abandoning Gitflow and GitHub in favour of Gerrit)
- OpenProject (will test a deployment)
- Tuleap (looked promissing at first, but way too complicated and restrictive to deploy; practically needs it's own server)
- editorconfig and atom module for consistent code style on the IDE This keeps preferred formatting styles in a
.editorconfig
project-local file and very vcs-friendly! - atom-beautify (conflicts with
editorconfig
?) This works very well, but I have to look into: unifying formatting conventions with ESLint and possibly keeping settings in a project-local config file. - markdown-preview and markdown-preview-plus for previewing markdown documents (Not sure of proper "github-flavored" formatting; Brackets seems to better handle this with paragraphs inside lists being properly rendered AFAICT.)
- ESLint (static analysis, lint) (with airbnb rules) I think this may be the most important component for writing clean ES6 code.
- Flow (static type checker) Looks interesting
- JSHint (static analysis)
- complexity-report (?)
- Javascript code documentation with JSDoc (anything else available?)
I like the Express framework, a "fast, unopinionated, minimalist web framework for Node.js".
With that, there are a few options that can be selected...
Templating engines for Express
-
Handlebars
Handlebars is like Mustache but with limited logic added, which gives you the ability to handle simple cases where you would otherwise need to generate extra data to feed the template with.
-
Jade
Jade is the classic templating engine for Express. It's a little weird and some features can be confusing. Also, it's not friendly to classic HTML developers as the syntax is not much like HTML.
-
Mustache/Hogan
-
React (with express-react-views). More about React below.
-
EJS (a simple templating engine)
Sources:
- Comparing JavaScript Templating Engines: Jade, Mustache, Dust and More (an old post at StrongLoop)
- Isomorphic React Apps with React-Engine
- Isomorphic JavaScript: The Future of Web Apps
- Node.js template showdown – 5 options compared
"a large, opinionated Node.js framework"
Also read:
I'm now mainly on the pro-Vue camp for the sole reason that Vue is highly regarded and is considered a much simpler solution than React.
I was previously on the pro-React camp for the following reasons:
- JSX is better (being JS-with-HTML instead of the other way around, or separating them needlessly)
- Server-side pre-render gives isomorphic apps
- Cleaner HTML (HTML is HTML!)
- ...?
With React, one should use:
- Flux as an architecture
- react-router for routing
- Redux to control state transitions (a Flux implementation?)
Interesting reads from the front lines:
- Angular 2 versus React: There Will Be Blood
- React vs Angular 2 - compare the incomparable?
- FullStackReact (site dedicated to full stack development with react; need to go over the whole yelp clone article)
Important: There seems to be a proliferation of new, interesting frameworks trending:
- vue.js is a contender for the 1st place in front-end frameworks and, AFAICT, tries to fill in the gap between functionality and ease-of-use in React
- Polymer by Google
- loopback-datasource-juggler, part of the LoopBack tools ("An ORM/ODM that provides a common set of interfaces for interacting with databases, REST APIs, and other types of data sources.")
- sails.js ? (rant by Kavin Burke here)
The Loopback stack (libraries) looks pretty good; a bit better than sails.js. I wonder if it is modular enough to get cherry-picked... a serving of ORM for starters and we'll see what else combines well with the rest.
Some more info:
-
loopback-graphql looks incomplete and I've experienced a bug as well (#90)
-
Relay and GraphQL (GraphQL for React)
also: Learn Relay
- D3 (how well does it integrate with React?)
- Production Best Practices: Security (Express site)
- Hacksplaining ("Comprehensive Security Training for Developers")
- nconf
- see various answers at How to store Node.js deployment settings/configuration files?
- nodemon for dev
- forever for prod
- PM2
- StrongLoop Process Manager (part of strongloop tools)
Notes on setting-up a development environment with Atom
- add package "atom-beautify"
- add package "linter"
- add package "linter-eslint"
- add package "react"
-
eslint with airbnb rules (no react)
npm i --save-dev eslint-config-airbnb-base eslint-plugin-import eslint
add
"extends": "airbnb-base"
to.eslintrc
-
eslint with airbnb rules (with react)
npm i --save-dev eslint-config-airbnb eslint-plugin-import eslint-plugin-react eslint-plugin-jsx-a11y eslint
add
"extends": "airbnb"
to.eslintrc
and"react"
toplugins
array