Skip to content

Commit 0801061

Browse files
committed
initial release 1.0.0
1 parent 2f9ac3f commit 0801061

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+884
-686
lines changed

.bowerrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"directory": "public/libs/",
2+
"directory": "public/libs",
33
"analytics": false,
44
"timeout": 1200000
55
}

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.idea
2+
.log
3+
/node_modules
4+
/public/compiled
5+
/public/libs
6+
/report
7+
8+
### OSX template
9+
.DS_Store
10+
.AppleDouble
11+
.LSOverride

.jshintrc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"predef": [
3+
"define",
4+
"require",
5+
"GlobalConfig",
6+
"angular",
7+
"inject"
8+
],
9+
"bitwise": true,
10+
"curly": true,
11+
"eqeqeq": true,
12+
"forin": true,
13+
"maxerr": 1000,
14+
"undef": true,
15+
"unused": true,
16+
"eqnull": true,
17+
"loopfunc": true,
18+
"browser": true,
19+
"jasmine": true,
20+
"jquery": true,
21+
"node": true
22+
}

README.md

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,50 @@
1-
## Nodejs Basicer
2-
Completely, basic angularjs frontend web framework for [node](http://nodejs.org).
1+
## angularjs-requirejs-boilerplate
2+
An complete angularjs requirejs boilerplate for node. There are angular and test samples in the project,
3+
you can quick start your new project with angularjs-requirejs-boilerplate.
34

4-
## Referenced Packges
5-
### Frontend
5+
## Features
6+
### Front-end
7+
* [angularjs](http://angularjs.org/), a JavaScript MVW Framework
8+
* [bootstrap](http://getbootstrap.com/), the most popular HTML, CSS, and JS framework for developing responsive, mobile first projects on the web
69
* [jquery](https://jquery.org/), the Write Less, Do More, JavaScript Library
10+
* [less](http://lesscss.org/), a CSS pre-processor
711
* [requirejs](http://requirejs.org/), a JavaScript file and module loader
8-
* [angularjs](http://angularjs.org/), a JavaScript MVW Framework
9-
* [lesscss](http://lesscss.org/), a CSS pre-processor
10-
* [bootstrap](http://getbootstrap.com/), the most popular HTML, CSS, and JS framework for developing responsive, mobile first projects on the web.
11-
* [react](http://facebook.github.io/react/), a JavaScript library for building user interfaces
1212
* etc
1313

14-
### Backend
15-
* [expressjs](http://expressjs.com/), sinatra inspired web development framework for node.js.
16-
* [swig](http://paularmstrong.github.io/swig/), a simple, powerful, and extendable JavaScript Template Engine
14+
### Back-end
15+
* [expressjs](http://expressjs.com/), sinatra inspired web development framework for node.js
1716
* [gulp](http://gulpjs.com/), the streaming build system
17+
* [swig](http://paularmstrong.github.io/swig/), a simple, powerful, and extendable JavaScript Template Engine
1818
* etc
1919

2020
## Quick Start
21-
Install dependencies:
22-
21+
### Install Dependencies:
2322
```bash
24-
$ npm install
2523
$ bower install
24+
$ npm install
2625
```
2726

28-
Compile and build system:
27+
### Development
28+
Development Environment using gulp-nodemon, gulp-livereload and gulp-jshint.
29+
1. Make sure <strong>isDevMode</strong> configuration is <strong>true</strong> in <strong>locals.js</strong>
30+
2. Install [livereload chrome extension](http://livereload.com/extensions/)
31+
3. Start the server with `gulp start-develop`
2932

30-
```bash
31-
$ gulp
32-
```
33+
### Production
34+
1. Make sure <strong>isDevMode</strong> configuration is <strong>false</strong> in <strong>locals.js</strong>
35+
2. Compile and build with `gulp`
36+
3. Start the server with pm2 or others
3337

34-
Start the server:
38+
### Configuration
39+
System configuration are stored in the <strong>locals.js</strong> file.
3540

36-
```bash
37-
$ node app
38-
```
41+
## Test
42+
Test using karma and jasmine, run the test with `npm test` or `karma start`. Unit and coverage test report are stored in report directory.
3943

40-
Open the browser and input http://localhost:4250/
44+
## Changelog
45+
### 1.0.0
46+
- initial release<br>
47+
18.10.2015
4148

4249
## License
4350

app.js

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,32 @@
11
var express = require('express'),
22
swig = require('swig'),
3-
favicon = require('serve-favicon'),
4-
morgan = require('morgan'),
5-
configRoutes = require('./routes/config-routes'),
6-
configSwig = require('./config/config-swig'),
7-
systemParams = require('./config/system-params.json');
3+
locals = require('./node-app/config/locals'),
4+
swigConfig = require('./node-app/swig/swig-config'),
5+
middlewareConfig = require('./middleware/middleware-config');
86

9-
var app = express();
10-
11-
app.engine('html', swig.renderFile);
7+
var app = express(),
8+
port = locals.port;
129

1310
app.set('view engine', 'html');
1411
app.set('views', __dirname + '/views');
12+
app.engine('html', swig.renderFile);
1513

16-
app.set('view cache', !systemParams.isDevMode);
17-
configSwig(swig);
14+
swigConfig(swig);
15+
middlewareConfig(app);
1816

19-
app.use(favicon(__dirname + '/public/images/favicon.ico'));
20-
app.use(express.static(__dirname + '/public/libs'));
21-
app.use(express.static(__dirname + '/public/images'));
17+
if (locals.SSL.enableSSL) {
18+
var fs = require('fs');
2219

23-
if (systemParams.isDevMode) {
24-
app.use(morgan('dev'));
25-
app.use(express.static(__dirname + '/public'));
26-
app.use(express.static(__dirname + '/public/javascripts'));
27-
app.use(express.static(__dirname + '/public/styles'));
20+
var options = {
21+
key: fs.readFileSync(locals.SSL.key),
22+
cert: fs.readFileSync(locals.SSL.cert)
23+
};
24+
25+
require('https').createServer(options, app).listen(port, function () {
26+
console.log('server listening on port(SSL enabled) ' + port);
27+
});
2828
} else {
29-
app.use(express.static(__dirname + '/public/compiled/styles'));
30-
app.use(express.static(__dirname + '/public/compiled/javascripts'));
29+
require('http').createServer(app).listen(port, function () {
30+
console.log('server listening on port ' + port);
31+
});
3132
}
32-
33-
configRoutes(app);
34-
35-
console.log('start server on port[' + systemParams.port + ']');
36-
app.listen(systemParams.port);

bower.json

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
11
{
2-
"name": "nodejs-basicer",
3-
"version": "0.8.02",
4-
"description": "nodejs-basicer frontend dependencies",
5-
"homepage": "https://github.com/ipluser/nodejs-basicer",
2+
"name": "angularjs-requirejs-boilerplate",
3+
"description": "An complete angularjs requirejs boilerplate for node.",
4+
"version": "1.0.0",
5+
"authors": "Pluser <[email protected]>",
6+
"main": "app.js",
67
"keywords": [
7-
"nodejs-basicer",
8-
"nodejs"
9-
],
10-
"main": [
11-
"public/libs/bootstrap/dist/js/bootstrap.min.js",
12-
"public/libs/bootstrap/dist/css/bootstrap.min.css"
8+
"angular",
9+
"angularjs",
10+
"requirejs",
11+
"angularjs-requirejs",
12+
"boilerplate"
1313
],
14+
"license": "MIT",
15+
"homepage": "https://github.com/ipluser/angularjs-requirejs-boilerplate",
1416
"dependencies": {
17+
"angular": "~1.4.7",
18+
"bootstrap": "~3.3.5",
1519
"jquery": "~2.1.4",
1620
"less": "~2.5.1",
17-
"requirejs": "~2.1.18",
18-
"requirejs-text": "~2.0.14",
19-
"jsx-requirejs-plugin": "~0.6.2",
20-
"react": "~0.13.3",
21-
"angular": "~1.4.1",
22-
"bootstrap": "~3.3.5",
23-
"jquery-backstretch": "~2.0.4"
24-
},
25-
"authors": [
26-
27-
],
28-
"license": "MIT"
21+
"requirejs": "~2.1.20",
22+
"angular-mocks": "~1.4.7"
23+
}
2924
}

config/config-swig.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

config/system-params.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

config/utils/logger.js

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)