Giter Club home page Giter Club logo

frontend-boiler's Introduction

Go to generator-frontend-boiler repo, this one will no longer be updated

Modular frontend boiler leveraging browserify and angular to cleanly group by concern

#####To use: npm install -g generator-frontend-boiler yo frontend-boiler [mySite] cd mySite gulp localhost:1338

#####To create another module in components: cd mySite yo frontend-boiler:mod [modName]

####Structure
index.jade #bootstrap angular assets/ #images, sass, etc app/ #angular --common/ # modules likely to be reused across many --components/ # modules based on concern | --home/ | --index.coffee # bootstraps --controllers.coffee # all controllers for this module go here --services.coffee --factories.coffee --directives.coffee

A component's index.coffee contains:

app = angular.module('home', [])

require('./controllers')(app)
require('./directives')(app)
#require('./services')(app)
#require('./factories')(app)

module.exports = app

A controllers.coffee file would look like:

module.exports = (app)->
  app.controller('homeCtrl', ($scope)->

  )
  .controller('anotherCtrl', ($scope, someService) ->
    #do stuff
  )

An example of requiring a compnonent in our app (app.coffee):

home = require('./components/home')
routes = require('./routes')

angular.module('simple',['ngRoute', home.name])
.config(routes)

In the above example home is a component's folder name. How clean is that!

#####Notes:

  1. Our gulp file minifies/concatenates our coffee files, but thanks to gulp-ng-annotate you don't have to worry about using the array of string includes, typically required. Instead of .controller('anotherCtrl',['$scope','someService', ($scope, someService) -> we only need .controller('anotherCtrl', ($scope, someService) ->
  2. Livereload is setup so no reloading/refreshing

ToDo

Sourcemaps
Option for vanilla JS
Option for vanilla HTML
option for less instead of sass

frontend-boiler's People

Contributors

jakegibson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.