Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including generator-sql-fullstack with all npm packages installed. Try it out:

generator-sql-fullstack lists no main file and has no index.js, so it can't be directly required. If this is a mistake, please let us know. It may however contain internal files that you can require manually:

require("yo/package.json"); // yo is a peer dependency. // require("generator-sql-fullstack/[??]")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

generator-sql-fullstack v1.0.1

Yeoman generator for creating SQL-EAN stack applications, using SQL(e.g. Postgres, MySQL, MariaDB, SQLite, MSSQL), Express, AngularJS, and Node

SQL Full-Stack Generator Build Status Gitter chat

Forked from DaftMonk/generator-angular-fullstack

Yeoman generator for creating sql-fullstack applications, using SQL(MySQL, Postgres, MariaDB, MSSQL, SQLite), Express, AngularJS, and Node - lets you quickly set up a project following best practices.

Example project

Generated with defaults:

Source code:


Install generator-sql-fullstack:

npm install -g generator-sql-fullstack

Make a new directory, and cd into it:

mkdir my-new-project && cd $_

Run yo sql-fullstack, optionally passing an app name:

yo sql-fullstack [app-name]

Run grunt for building, grunt serve for preview, and grunt serve:dist for a preview of the built app.


  • Postgres - Download and Install Postgres - If you plan on scaffolding your project with Sequelize, you'll need a SQL relational database to be installed and have the process running.

Supported Configurations


  • Scripts: JavaScript, CoffeeScript
  • Markup: HTML, Jade
  • Stylesheets: CSS, Stylus, Sass, Less,
  • Angular Routers: ngRoute, ui-router


  • Database: MySQL, Postgres, MariaDB, MSSQL, SQLite
  • Sequelize: Yes, No
  • Authentication boilerplate: Yes, No
  • oAuth integrations: Facebook Twitter Google
  • integration: Yes, No


A grunt task looks for new files in your client/app and client/components folder and automatically injects them in the appropriate places based on an injection block.

  • less files into client/app.less
  • scss files into client/app.scss
  • stylus files into client/app.styl
  • css files into client/index.html
  • js files into client/index.html
  • coffeescript temp js files into client/index.html


Available generators:


Sets up a new AngularJS + Express app, generating all the boilerplate you need to get started.


yo sql-fullstack


Generates a new API endpoint.


yo sql-fullstack:endpoint message
[?] What will the url of your endpoint be? /api/messages


server/api/message/message.model.js  (optional)
server/api/message/message.socket.js (optional)


Generates a new route.


yo sql-fullstack:route myroute
[?] Where would you like to create this route? client/app/
[?] What will the url of your route be? /myroute




Generates a controller.


yo sql-fullstack:controller user
[?] Where would you like to create this controller? client/app/




Generates a directive.


yo sql-fullstack:directive myDirective
[?] Where would you like to create this directive? client/app/
[?] Does this directive need an external html file? Yes



Simple directive without an html file


yo sql-fullstack:directive simple
[?] Where would you like to create this directive? client/app/
[?] Does this directive need an external html file? No




Generates a filter.


yo sql-fullstack:filter myFilter
[?] Where would you like to create this filter? client/app/




Generates an AngularJS service.


yo sql-fullstack:service myService
[?] Where would you like to create this service? client/app/



You can also do yo sql-fullstack:factory and yo sql-fullstack:provider for other types of services.


Generates an AngularJS service decorator.


yo sql-fullstack:decorator serviceName
[?] Where would you like to create this decorator? client/app/




Deploying to OpenShift can be done in just a few steps:

yo sql-fullstack:openshift

A live application URL will be available in the output.


If you're using any oAuth strategies, you must set environment variables for your selected oAuth. For example, if we're using Facebook oAuth we would do this :

rhc set-env FACEBOOK_ID=id -a my-openshift-app
rhc set-env FACEBOOK_SECRET=secret -a my-openshift-app

You will also need to set DOMAIN environment variable:

rhc config:set DOMAIN=<your-openshift-app-name>

# or (if you're using it):

rhc config:set DOMAIN=<your-custom-domain>

After you've set the required environment variables, restart the server:

rhc app-restart -a my-openshift-app

To make your deployment process easier consider using grunt-build-control.

Pushing Updates


Commit and push the resulting build, located in your dist folder:

grunt buildcontrol:openshift


Deploying to heroku only takes a few steps.

yo sql-fullstack:heroku

To work with your new heroku app using the command line, you will need to run any heroku commands from the dist folder.

If you're using mongoDB you will need to add a database to your app:

heroku addons:add mongohq

Your app should now be live. To view it run heroku open.

If you're using any oAuth strategies, you must set environment variables for your selected oAuth. For example, if we're using Facebook oAuth we would do this :

heroku config:set FACEBOOK_ID=id
heroku config:set FACEBOOK_SECRET=secret

You will also need to set DOMAIN environment variable:

heroku config:set DOMAIN=<your-heroku-app-name>

# or (if you're using it):

heroku config:set DOMAIN=<your-custom-domain>

To make your deployment process easier consider using grunt-build-control.

Pushing Updates


Commit and push the resulting build, located in your dist folder:

grunt buildcontrol:heroku

Bower Components

The following packages are always installed by the app generator:

  • angular
  • angular-cookies
  • angular-mocks
  • angular-resource
  • angular-sanitize
  • angular-scenario
  • es5-shim
  • font-awesome
  • json3
  • jquery
  • lodash

These packages are installed optionally depending on your configuration:

  • angular-route
  • angular-ui-router
  • angular-socket-io
  • angular-bootstrap
  • bootstrap

All of these can be updated with bower update as new versions are released.


Yeoman generated projects can be further tweaked according to your needs by modifying project files appropriately.

A .yo-rc file is generated for helping you copy configuration across projects, and to allow you to keep track of your settings. You can change this as you see fit.


Running grunt test will run the client and server unit tests with karma and mocha.

Use grunt test:server to only run server tests.

Use grunt test:client to only run client tests.

Protractor tests

To setup protractor e2e tests, you must first run

npm run update-webdriver

Use grunt test:e2e to have protractor go through tests located in the e2e folder.

Environment Variables

Keeping your app secrets and other sensitive information in source control isn't a good idea. To have grunt launch your app with specific environment variables, add them to the git ignored environment config file: server/config/local.env.js.

Project Structure


├── client
│   ├── app                 - All of our app specific components go in here
│   ├── assets              - Custom assets: fonts, images, etc…
│   ├── components          - Our reusable components, non-specific to to our app
├── e2e                     - Our protractor end to end tests
└── server
    ├── api                 - Our apps server api
    ├── auth                - For handling authentication with different auth strategies
    ├── components          - Our reusable or app-wide components
    ├── config              - Where we do the bulk of our apps configuration
    │   └── local.env.js    - Keep our environment variables out of source control
    │   └── environment     - Configuration specific to the node environment
    └── views               - Server rendered views

An example client component in client/app

├── main.js                 - Routes
├── main.controller.js      - Controller for our main route
├── main.controller.spec.js - Test
├── main.html               - View
└── main.less               - Styles

An example server component in server/api

├── index.js                - Routes
├── thing.controller.js     - Controller for our `thing` endpoint
├── thing.model.js          - Database model
├── thing.socket.js         - Register socket events
└── thing.spec.js           - Test


See the contributing docs

This project has 2 main branches: master and canary. The master branch is where the current stable code lives and should be used for production setups. The canary branch is the main development branch, this is where PRs should be submitted to (backport fixes may be applied to master).

By seperating the current stable code from the cutting-edge development we hope to provide a stable and efficient workflow for users and developers alike.

When submitting an issue, please follow the guidelines. Especially important is to make sure Yeoman is up-to-date, and providing the command or commands that cause the issue.

When submitting a PR, make sure that the commit messages match the AngularJS conventions.

When submitting a bugfix, try to write a test that exposes the bug and fails before applying your fix. Submit the test alongside the fix.

When submitting a new feature, add tests that cover the feature.

See the travis.yml for configuration required to run tests.


BSD license

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free