Node.js / Express app generator: with, API validation, documentation, logging, and more

[Take me to the app generator]

I’m at work on a new project. My team and I are building a highly scalable service platform and have elected to build it using the microservices architecture pattern. The platform consists of many microservices, each of which is typically owned by a collaborating team. Teams are empowered to make decisions and choose technologies that best fit the need. This means that services may br written in a variety of different languages and/or stacks. In this case, its primarily Java (Play Framework), Scala (Play Framework), and JavaScript (ExpressJs node.js). We are also using Cloudant, Redis, and Postgres for persistent storage.

I am currently focused on a few node.js services. When starting out, I quickly found myself scaffolding the same basic node.js app for each new service.

“Makes sense, right? I’m working on a bunch of node.js services. I should keep them consistent”.

Each new service requires structured logging, environment based configuration, API validation, API documentation, a transpilation pipeline and so forth. I repeat myself each time I create a new service. Repetition doesn’t sit well with me…

As a result, I decided to create a Yeoman generator, called express-no-stress to do this work for me.

The generator scaffolds a consistent, fully functional REST API. It takes just seconds to generate. I get to focus my time on new code.

The generator includes the following:
Express.js – a fast, unopinionated , minimalist web framework for node.js.

Babel.js – a compiler that enables you to use next generation Javascript today.
Bunyan – a simple and fast JSON logging module for node.js services.
dotenv – Loads environment variables from .env for node.js projects.
Backpack – a minimalistic build system for node.js.
Swagger – a simple yet powerful representation of your RESTful API.
SwaggerUI – dynamically generated, beautiful documentation and sandbox from a Swagger-compliant API.
– Cloud Ready – deploy to any cloud. A CloudFoundry and Bluemix example provided. See README

If you’re building microservices or even if your not. Give the express-no-stress generator a try.

You can get started here.

It just might help 😀

You may also like...

Leave a Reply