├── .bowerrc ├── config.json ├── .gitignore ├── index.html ├── package.json ├── bower.json ├── readme.md └── Gruntfile.js /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "app/public/components" 3 | } -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | {"root":"app/public","base":"app/public/javascripts/random","parent":"../app.js","router":"ui.router","name":"App","appName":"random","jsFolder":"app/public/javascripts"} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | pids 6 | *.pid 7 | *.seed 8 | lib-cov 9 | coverage 10 | .grunt 11 | .lock-wscript 12 | build/Release 13 | node_modules 14 | .npm 15 | .node_repl_history 16 | .sass-cache 17 | app/public/components -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | App 5 | 6 | 7 | 8 | 9 |
10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "minimal_angular_app", 3 | "version": "0.0.0", 4 | "description": "Minimal Angular App", 5 | "main": "", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "Alex Chin", 10 | "license": "ISC", 11 | "devDependencies": { 12 | "grunt": "^0.4.5", 13 | "grunt-bower-concat": "^0.6.0", 14 | "grunt-browserify": "^3.3.0", 15 | "grunt-cli": "^0.1.13", 16 | "grunt-contrib-cssmin": "^0.12.1", 17 | "grunt-contrib-sass": "^0.9.2", 18 | "grunt-contrib-watch": "^0.6.1", 19 | "load-grunt-tasks": "^3.1.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Minimal Angular App", 3 | "description": "Minimal Angular App", 4 | "main": "", 5 | "authors": [ 6 | "Alex Chin" 7 | ], 8 | "license": "ISC", 9 | "homepage": "https://github.com/alexpchin/minimal-angular-app", 10 | "moduleType": [], 11 | "private": true, 12 | "ignore": [ 13 | "**/.*", 14 | "node_modules", 15 | "bower_components", 16 | "app/public/components", 17 | "test", 18 | "tests" 19 | ], 20 | "dependencies": { 21 | "angular-jwt": "~0.0.9", 22 | "angular-resource": "~1.4.8", 23 | "angular-ui-router": "ui-router#~0.2.15", 24 | "angular": "~1.4.8", 25 | "bootstrap": "v4.0.0-alpha", 26 | "jquery": "~2.2.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | Minimal Angular App 2 | =================== 3 | 4 | This is a basic angular app using: 5 | 6 | - ui.router 7 | - angular-jwt 8 | 9 | The front-end framework is `bootstrap#v4.0.0-alpha`. 10 | 11 | It uses IIFE's to manage global variables. 12 | 13 | Uses Lo-Dash template strings for the grunt [templates](https://lodash.com/docs#template). 14 | 15 | ## Getting started 16 | 17 | To start, clone the app, delete the `.git` directory and `git init`. Then run: 18 | 19 | ```bash 20 | npm install 21 | ``` 22 | 23 | Next run to start a new app run: 24 | 25 | ```bash 26 | grunt start --name=chooseName 27 | ``` 28 | 29 | The app will be created in a new `app` directory. 30 | 31 | ## Generators 32 | 33 | You can use `grunt -h` to see a list of available tasks: 34 | 35 | To start a new app run: 36 | 37 | ```bash 38 | grunt start --name=chooseName 39 | ``` 40 | 41 | There are additional options. 42 | 43 | One you have done this, you can generate anyone of these: 44 | 45 | ### controller 46 | 47 | ```bash 48 | grunt g:controller --name=main 49 | ``` 50 | 51 | This will create a controller javascript file and a view directory. 52 | 53 | ### factory 54 | 55 | ```bash 56 | grunt g:factory --name=factory_name 57 | ``` 58 | 59 | ### service 60 | 61 | ```bash 62 | grunt g:service --name=service_name 63 | ``` 64 | 65 | ### constant 66 | 67 | ```bash 68 | grunt g:constant --name=test --key=API --value=http://localhost:3000 --type=string 69 | grunt g:constant --name=twitter --key=TWITTER --value=process.env.TWITTER_CLIENT_ID 70 | ``` 71 | 72 | ### directive 73 | 74 | ```bash 75 | grunt g:directive --name=directive_name 76 | ``` 77 | 78 | This will create both a javascript file and a corresponding view file found in `app/views/directives`. 79 | 80 | ## Contribute 81 | 82 | If there are any issues or you want to add things, please fork and PR. -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | 3 | var browserifyHelper = require('./build/helpers/browserify.js')(grunt); 4 | 5 | grunt.initConfig({ 6 | pkg: grunt.file.readJSON('package.json'), 7 | sass: { 8 | dist: { 9 | files: { 10 | 'app/public/stylesheets/style.css' : 'app/public/stylesheets/**/*.scss' 11 | } 12 | } 13 | }, 14 | bower_concat: { 15 | all: { 16 | dest: 'app/public/javascripts/bower.js', 17 | // dependencies: { 18 | // 'bootstrap': 'jquery' 19 | // } 20 | } 21 | }, 22 | browserify: { 23 | dist: { 24 | files: browserifyHelper('index.js', [ 25 | { path: 'bower.js' }, 26 | { path: '**/*.js' }, 27 | { path: '!index.js' } 28 | ]) 29 | } 30 | }, 31 | cssmin: { 32 | combine: { 33 | files: { 34 | 'app/public/stylesheets/app.min.css': [ 35 | 'app/public/components/**/bootstrap.min.css', 36 | 'app/public/stylesheets/**/*.scss', 37 | 'app/public/stylesheets/**/*.css' 38 | ] 39 | } 40 | } 41 | }, 42 | watch: { 43 | files: [ 44 | 'app/public/javascripts/**/*.js', 45 | '!app/public/javascripts/index.js', 46 | 'app/public/stylesheets/**/*.css', 47 | 'build/**/*.js', 48 | 'package.json' 49 | ], 50 | css: { 51 | files: 'app/public/stylesheets/**/*.scss', 52 | tasks: ['sass'] 53 | }, 54 | tasks: ['default'] 55 | }, 56 | g: { 57 | config: 'configs', 58 | controller: 'controllers', 59 | directive: 'directives', 60 | factory: 'factories', 61 | service: 'services', 62 | provider: 'providers', 63 | constant: 'constants', 64 | value: 'values', 65 | decorator: 'decorators' 66 | } 67 | }); 68 | 69 | // grunt.loadNpmTasks('grunt-contrib-sass'); 70 | // grunt.loadNpmTasks('grunt-contrib-watch'); 71 | // grunt.loadNpmTasks('grunt-bower-concat'); 72 | 73 | // https://github.com/sindresorhus/load-grunt-tasks 74 | require('load-grunt-tasks')(grunt); 75 | 76 | grunt.loadTasks('build/tasks'); 77 | } 78 | --------------------------------------------------------------------------------