7 reasons to use Yeoman’s angular-fullstack generator

For my next project and, after looking for candidates and reading some hundreds of lines of documentation, I finally choose to work with the so called MEAN stack: mongodb, express, angular and node.

As with any other technology ecosystem, the great number of frameworks, libraries and tools can make our choice a challenge, and JavaScript is not an exception. But for JavaScript projects we have lot of help and I decide to use the awesome Yeoman tool. Yeoman combines the power of grunt, bower, npm and adds its own salt: the generators.

Yeoman generators are tasks responsible to build the initial project scaffolding.

Yeoman offers an extensive set of official generators oriented to create: webapps, backbone app, chrome extension, etc but we can also found a myriad of non oficial generators (yes, because anyone can create a new generator to satisfy his/her needs).

Within all the generators I chose angular-fullstack to create my MEAN project structure and next are my reasons:

1. Easy to install

You require to have node and npm installed on your system. Once you have them installYeoman and the angular-fullstack is as easy as:

Once installed the generator you simply need to create a new folder and initialise your project:

2. Creates both client and server scaffoldings

The generator generates the full stack of your project, both the client and server code. Your project will start well organised and prepared to create an awesome RIA application.

3. Introduces good practices in the generated code

Because the generated is made by experienced developers, they applies good practices in code organisation and style programming (like the environment configuration on the server side using node).

For me, this is one of the most important reasons to use this generator. Anybody knows starting with a new technology is always hard, but it is nothing when you start with four new technologies :)

4. Server side API prepared to use authentication

Following best practices the code is prepared so you can easily add security to you API via a node middleware so each request requires authentication of the client side.

5. Support HTML or jade templating on client side

You can use any template engine for client side but by default the generator works with HTML and Jade. I don’t really like Jade too much so I always try to use EJS or similar (Warning this last sentence is the author’s opinion).

6. Support for different CSS preprocessors

For different opinions there are different alternatives. This way angular-fullstack has support for plain CSS, Stylus, Sass or LESS pre-processors. Choose your preferred.

7. Commands to scaffold anything

With theangular-fullstack you can create new end points for the server side or client side components (like routes, controllers, services, filters, directives, …) with a sentences. So, next command:

will produce:

 Conclusion

In my opnion, angular-fullstack is a really powerful tool that simplifies our day to day work.

As always it is not the panacea, it is simply a generic tool to automatize many common tasks. Because of this we can found situations it lacks some feature.

The Book of OpenLayers 3, released !!!

Finally I completed most of the chapters I had thought for the book. Although two chapters remains to be written, I think the current content is extensive enough to help anybody interested to lean this great new version of the OpenLayers project.

The current chapters explains:
– The map and the view
– Layers
– Data sources and formats
– Vector layers
– Events, listeners and properties

The two remaining chapters I have in mind are:
– Controls and interaction
– Overlays

Hope, this book help you to introduce to the OpenLayers version 3.

Remember, thanks to the LeanPub platform, when you buy the book you can get any later update I make on it. In addition, you have 45 days for refund if you think the book does not cover your expectations. In addition, don’t hesitate to contact me for any errors, misspelled words or sentences, etc.

Remember, this is a self-published book. No main company is behind it and no great marketing campaign is prepared. Any help from you, talking about the book at any forum or social network will be appreciated.

Finally, I would like to thank my wife, Pilar, for her understanding and almost infinite patience for my job, hobby and profession, the computer science.

Announcing the release of The Book of OpenLayers 3

I just sent this words to all the people interested in the book via LeanPub and I would like to post it here too, hoping this message arrives to more people.

The Book of OpenLayers3 is progressing well. It is not finished but I would like to notify you, in the next weeks, I will launch a pre-release of the book.

At this moment the book contains five chapters covering the most important topics of the new architecture and design of the library. All chapters are divided in a theory section, where I explain all the concepts and involved classes, and a practice section, where I show real working examples.

Remember, all the examples are also freely available at the GitHub repository: https://github.com/acanimal/thebookofopenlayers3 are right now running at: http://acanimal.github.io/thebookofopenlayers3.

My intention is continue writing, at least, two more chapters. One dedicated to the controls OpenLayers3 offers to interact with the map, and a second one, related to the concept of overlays. I hope to cover these two chapter in one month.

Thanks to LeanPub platform, once you buy a book you are allowed to download the new updates freely. I will notify you when new releases are available.

Please, do not hesitate to send me your feedback related with the book, from its content to its costs.

Finally, remember this book is self published, no great publishing company is behind it and no great marketing campaigns are organised, so any comments on shared networks that publicise the book will be appreciated.

Antonio Santiago (@acanimal) – #thebookofopenlayers3

thebookofopenlayers3

Releasing code samples for The Book of OpenLayers 3

Writing a book is hard, requires constance and motivation and, more important, be strong to keep them both. Least but not last you need time. Time to see the source code and learn. Time to see the examples and learn. Time to understand all the concepts and learn. Time to explain in your words what you have learnt.

Today, I announced the links where you can find the online samples and code repository for The book of OpenLayers3. Code repository is open, so don’t hesitate to download and contribute with new samples.

The work is not complete, I need to finish the theory part of a chapter related to vector information and write two more chapters I have in mind and, of course, create some samples to see the theory in practice. I will write another post introducing the book with a more in depth chapter description. This post is only about the code samples. Your feedback is really valuable for me !!!

The book of OpenLayers3

About the code samples

For those interested in contribute, the project for the code samples is built using the Yeoman tool, which combines Grunt and Bower, and the generator for web application generator-webapp, which offers a project skeleton with a bunch of good practices.

In addition to the default plugins used by the generator, I made use of the Grunt’s plugin grunt-includes (see here) that implement like PHP include directive. This way, I can create a page layout (with headers, footers, etc) reusable for all the pages. See the package.json file for more details about plugins.

For the implementation I made use of the Bootstrap framework, the nice Yeti theme from Bootswatch project and the highlight.js project to highlight the samples code. See more details of project dependencies in the bower.json file.