CleverStack provides a fully featured Command Line Interface that does everything you will need in your Software Development Lifecycle

Our Command Line Interface (CLI) was designed to be as modular as possible, so that applications could take advantage of modules that are created and published to our Open Source EcoSystem by anyone, as well as our Official Modules.

The CLI has a few packages it depends on that cannot be defined inside of it's package.json, you have to install these before you can install or use the Command Line Interface.


NodeJS & NPM
is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. Download now

Bower
is a package manager for the web made by Twitter. It offers a generic, unopinionated solution to the problem of front-end package management, while exposing the package dependency model via an API that can be consumed by a more opinionated build stack. There are no system wide dependencies, no dependencies are shared between different Applications, and the dependency tree is flat.
npm install -g bower

Grunt
is a Task Runner for Node.js, with literally hundreds of plugins to choose from, you can use Grunt to automate just about anything with a minimum of effort. If someone hasn't already built what you need, authoring and publishing your own Grunt plugin to npm is a breeze.
npm install -g grunt-cli

Installation is made easy using NPM, to install the CleverStack Command Line Interface (CLI) please run the following.

npm install -g cleverstack-cli

Windows users

You should run this command (and others like it) in the windows command (cmd) prompt, and in some cases you will need to run your cmd prompt as Administrator

Linux/Mac Users

You may need to run this command using "sudo", but you should note if you need to use sudo then something is wrong with your file/folder permissions

sudo npm install -g cleverstack-cli

Here is a list of all commands available using our Command Line Interface (CLI).


Coming soon, we are working hard on the section!

Coming soon, we are working hard on the section!

Coming soon, we are working hard on the section!

Coming soon, we are working hard on the section!

Coming soon, we are working hard on the section!

Coming soon, we are working hard on the section!

Coming soon, we are working hard on the section!

Coming soon, we are working hard on the section!

Coming soon, we are working hard on the section!

Coming soon, we are working hard on the section!

Coming soon, we are working hard on the section!

Coming soon, we are working hard on the section!

Coming soon, we are working hard on the section!

Coming soon, we are working hard on the section!

Coming soon, we are working hard on the section!

Coming soon, we are working hard on the section!

All functionality except what is in the CleverStack Core must be defined inside of modules, because we take advantage of NPM & Bower for our package management it mean's that you can use the thousands of already available packages as Modules for your CleverStack powered Applications.

We currently have a handful of important Official CleverStack modules available which we list here and update as frequently as possible, however we recommend visiting our Modules page to get the full and upto date list of modules.


Object Relational Mapper (ORM)

This module deeply integrates SequelizeJS into CleverStack, to provide an out of the box Object Relational Mapper which is widely accepted, widely used, full featured and mature SQL Solution for CleverStack.

$ clever install clever-orm

Object Document Mapper (ODM)

This module deeply integrates MongooseJS into CleverStack, to provide an out of the box Object Document Mapper, which is a primarily MongoDB based NoSQL solution to storing data.

$ clever install clever-odm

Background Tasks

This module allows you to define tasks that will be run in the background a separate dedicated process, by providing master-slave locking this module also allows you to never have to use CRON files ever again; Simply define your task as masterOnly and it will only run on the Master server ensuring its execution does not overlap (even in an elastic cloud configuration with hundreds of servers).

While NodeJS is designed around being non blocking it is still very possible for any line of code to block any other code running until that line has finished executing, this means that processing CPU intensive operations cannot be done inside any of the Processes that are responding to HTTP Requests (otherwise the user will get no response, because its busy doing some CPU Intensive Operation).

$ clever install clever-background-tasks

Authentication

This module provides you with a user model, service, migrations and all the code you need to provide a registration, login/logout, forgotten password as well as Google, LinkedIn, Twitter and Facebook social signup & signin. (Both the Frontend and Backend have this module available for installation).

$ clever install clever-auth

This is a list of modules that are used in the Core of CleverStack, you do not need to install these (as they are by default). However these modules are designed to work with anything, so if you want to use these components in something other than CleverStack you have that option.


Controller

This module provides Lightning-fast flexible Controller's for CleverStack, the main aim of the controller is to help simplify the most common tasks that you need to do when setting up routes and functions/classes to handle them.


Dependency Injector (DI)

This module provides Dependency Injection for CleverStack, it is non blocking, Lightning-fast, easy to use and flexible.

Adding, Removing, Upgrading or Downgrading modules is the same with both the Frontend or Backend seeds. Here is some examples of working with the clever-auth module.

Adding
$ clever install clever-auth
Removing
$ clever remove clever-auth
Upgrading
$ clever upgrade clever-auth
Downgrading
$ clever downgrade clever-auth

Note You can specify multiple modules in each install, remove, upgrade or downgrade command separated by spaces.

Finding modules is easy, here are some of the ways available

  • The CleverStack Modules Page.
  • The NPM Packages Page, using the keyword "cleverstack-module".
  • The Bower Packages Page, using the keyword "cleverstack-module".
  • The Command Line
    # Using the CleverStack CLI
    $ clever search cleverstack-module
    
    # Using NPM (using the keyword "cleverstack-module")
    $ npm search cleverstack-module
    
    # Using Bower (using the keyword "cleverstack-module")
    $ bower search cleverstack-module

You can develop your own CleverStack modules, here's how you create a module using the CleverStack CLI.

  1. Run the following command:

    $ clever new <my-module>

    This will install and setup a new skeleton module for you.


Example modules:

If you have any problems (including errors, exceptions and even general usage) with the CleverStack CLI.

Firstly please read our guidelines for contributing, Then fork the CleverStack CLI github repo, once you are ready please submit a "Pull Request" for review.

At Clevertech we believe in testing our code as we develop, then if something breaks we know exactly where to start looking. Spending more time on developing the features we love.

Running Unit Tests

To run the unit tests for your app and modules, from the front-end/back-end root directory run:

$ clever test unit

Or simply use the alias:

$ clever test

Running E2E Tests

To setup your environment for e2e testing with Protractor run the following command. This will install Selenium Server (WebDriver), ChromeDriver & PhantomJS based on your OS. If you wish to run selenium server in a separate terminal then use Webdriver Manager (see below).

$ cd Frontend
$ npm run-script setup-protractor

Using Webdriver Manager

Webdriver Manager comes shipped with protractor and installs selenium server & chrome driver for you. Selenium server can then run in a separate terminal so when you run your e2e tests it doesn't need to boot up (saving heaps of time when running your e2e tests!). To set this up do the following:

npm install -g protractor
webdriver-manager update
webdriver-manager start

Your selenium server should be running in this terminal.

Finally update your e2e test config file located: my-app/Frontend/test-e2e.conf.js

// uncomment this line:
seleniumAddress: 'http://localhost:4444/wd/hub',

// comment these lines:
seleniumServerJar: ''
seleniumPort: ''
chromeDriver: ''

To run the end-to-end tests for your app and modules, from the front-end/back-end root directory run:

$ clever test e2e

Code Coverage Reports

To generate a code coverage report for your unit tests, from the front-end directory run:

$ clever test coverage

Your browser should open the following URL:

$ http://localhost:5555

Then select your report from the list.

At Clevertech we build lots of MVP's so we like our deployment to be as efficient as possible. We are going to implement some of these strategies for CleverStack.

Production Builds

To build a production version of your front-end app, from your front-end root directory run:

$ clever build

This will build your app, minifying your assets etc and puts everything into the /dist folder ready for deployment.

Note: You can view a production version of your app on port 9009.

Deployment Strategies

Stay Tuned!! NodeJS deployment strategies coming soon. AWS, Heroku and more.

Troubleshooting CleverStack CLI.

Troubleshooting Backend (NodeJS).

Troubleshooting Frontend (AngularJS).


Get some help from the Google Group


We will document any "gotchas" here along with any important open GitHub issues. Please open an issue if you see a bug.

  • EMFILE error on Mac: By default some macs have a ulimit of 256 which limits the number of open files each process can have, when using "clever init my-app" you will need to raise your ulimit by running "ulimit -n 1024" in your console. You will need to run that in your console before running the init command unless you define that setting globally in your mac.

Answers to some frequently asked questions about CleverStack. Please open an issue if you are requesting a new feature.

We will add important FAQ here.