Skip to content

Commit 9c5697c

Browse files
author
Benoit Jean
committed
Initial Commit
0 parents  commit 9c5697c

File tree

13 files changed

+419
-0
lines changed

13 files changed

+419
-0
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.iml
2+
.idea/
3+
.DS_store
4+
node_modules/
5+
target/
6+
bower_components/
7+
npm-debug.log
8+
src/main/client/stylesheets/style.css

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
mmm-push-it-ui
2+
===================================================
3+
4+
This UI must deploy internally because it's unsecure.
5+
6+
7+
# usage
8+
9+
## deploy application
10+
to use the project, there a docker file available
11+
12+
run
13+
* `docker pull docker-registry.tritondigital.com/mmm-push-it-ui`
14+
* `docker run -d -p 3000:3000 -e NODE_ENV=production docker-registry.tritondigital.com/mmm-push-it-ui`, then you can access application at ip:3000, where ip is the docker server ip.
15+
16+
## server
17+
start the server `npm start`
18+
19+
start the server in dev mode `npm run start:dev`

bin/www

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#!/usr/bin/env node
2+
3+
/**
4+
* Module dependencies.
5+
*/
6+
7+
var app = require('../src/main/server/app');
8+
var debug = require('debug')('react-tutorial:server');
9+
var http = require('http');
10+
11+
/**
12+
* Get port from environment and store in Express.
13+
*/
14+
15+
var port = normalizePort(process.env.PORT || '3000');
16+
app.set('port', port);
17+
18+
/**
19+
* Create HTTP server.
20+
*/
21+
22+
var server = http.createServer(app);
23+
24+
/**
25+
* Listen on provided port, on all network interfaces.
26+
*/
27+
28+
server.listen(port);
29+
server.on('error', onError);
30+
server.on('listening', onListening);
31+
32+
/**
33+
* Normalize a port into a number, string, or false.
34+
*/
35+
36+
function normalizePort(val) {
37+
var port = parseInt(val, 10);
38+
39+
if (isNaN(port)) {
40+
// named pipe
41+
return val;
42+
}
43+
44+
if (port >= 0) {
45+
// port number
46+
return port;
47+
}
48+
49+
return false;
50+
}
51+
52+
/**
53+
* Event listener for HTTP server "error" event.
54+
*/
55+
56+
function onError(error) {
57+
if (error.syscall !== 'listen') {
58+
throw error;
59+
}
60+
61+
var bind = typeof port === 'string'
62+
? 'Pipe ' + port
63+
: 'Port ' + port;
64+
65+
// handle specific listen errors with friendly messages
66+
switch (error.code) {
67+
case 'EACCES':
68+
console.error(bind + ' requires elevated privileges');
69+
process.exit(1);
70+
break;
71+
case 'EADDRINUSE':
72+
console.error(bind + ' is already in use');
73+
process.exit(1);
74+
break;
75+
default:
76+
throw error;
77+
}
78+
}
79+
80+
/**
81+
* Event listener for HTTP server "listening" event.
82+
*/
83+
84+
function onListening() {
85+
var addr = server.address();
86+
var bind = typeof addr === 'string'
87+
? 'pipe ' + addr
88+
: 'port ' + addr.port;
89+
debug('Listening on ' + bind);
90+
}

bower.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "react-tutorial",
3+
"version": "0.0.0",
4+
"private": true,
5+
"authors": [
6+
"Benoit Jean <benoit.jean@gmail.com"
7+
],
8+
"dependencies": {
9+
"bootstrap": "~3.3.6",
10+
"react": "~15.0.1",
11+
"react-bootstrap": "~0.29.2"
12+
},
13+
"devDependencies": {
14+
"karma-read-json": "karma-json-reader#~1.0.3"
15+
}
16+
}

config/default.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
3+
}

package.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "react-tutorial",
3+
"version": "0.0.0",
4+
"private": true,
5+
"dependencies": {
6+
"bower": "^1.7.9",
7+
"config": "^1.16.0",
8+
},
9+
"devDependencies": {
10+
"jasmine-core": "^2.3.4",
11+
"jasmine-reporters": "^2.0.7",
12+
"jshint": "^2.8.0",
13+
"karma": "^0.13.10",
14+
"karma-coverage": "^0.5.2",
15+
"karma-html-reporter": "^0.2.7",
16+
"karma-jasmine": "^0.3.6",
17+
"karma-junit-reporter": "^0.3.7",
18+
"karma-phantomjs-launcher": "^0.2.1",
19+
"live-reload": "^1.1.0",
20+
"nodemon": "^1.7.1",
21+
"opener": "^1.4.1",
22+
"parallelshell": "^2.0.0",
23+
"phantomjs": "^1.9.18"
24+
},
25+
"scripts": {
26+
"dep:add": "bower --save install",
27+
"dep:add-dev": "bower --save-dev install",
28+
"dep:dev": "bower install --allow-root",
29+
"dep:prod": "bower install -p --allow-root",
30+
"install:dev": "npm install && npm run dep:dev",
31+
"install:prod": "npm install --production && npm run dep:prod",
32+
"js:client": "jshint --config project/jshint-client.conf src/main/client",
33+
"js:server": "jshint --config project/jshint-server.conf src/main/server",
34+
"js:client-test": "jshint --config project/jshint-client-test.conf src/test/client",
35+
"js": "npm run js:client && npm run js:server && npm run js:client-test",
36+
"test:single": "karma start project/karma-conf.js --single-run",
37+
"test:watch": "karma start project/karma-conf.js",
38+
"test": "npm run test:single",
39+
"live-reload": "live-reload --port 3001 src/main",
40+
"open-browser": "opener http://localhost:3000",
41+
"start:dev": "parallelshell \"npm run live-reload\" \"npm run open-browser\" \"nodemon --watch src/main ./bin/www\"",
42+
"start": "node ./bin/www"
43+
}
44+
}

project/jshint-client-test.conf

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"curly": true,
3+
"bitwise": true,
4+
"camelcase": false,
5+
"eqeqeq": true,
6+
"forin": false,
7+
"freeze": true,
8+
"immed": false,
9+
"indent": 4,
10+
"latedef": true,
11+
"newcap": false,
12+
"noarg": true,
13+
"noempty": true,
14+
"nonbsp": true,
15+
"nonew": false,
16+
"plusplus": false,
17+
"quotmark": false,
18+
"undef": true,
19+
"unused": true,
20+
"strict": true,
21+
"maxparams": false,
22+
"maxdepth": false,
23+
"maxstatements": false,
24+
"maxcomplexity": false,
25+
"maxlen": false,
26+
"asi": false,
27+
"boss": false,
28+
"debug": false,
29+
"eqnull": false,
30+
"es5": false,
31+
"esnext": true,
32+
"moz": false,
33+
"evil": false,
34+
"expr": false,
35+
"funcscope": false,
36+
"globalstrict": true,
37+
"iterator": false,
38+
"lastsemic": false,
39+
"laxbreak": false,
40+
"laxcomma": false,
41+
"loopfunc": false,
42+
"multistr": true,
43+
"noyield": false,
44+
"notypeof": false,
45+
"proto": false,
46+
"scripturl": false,
47+
"shadow": false,
48+
"sub": false,
49+
"supernew": false,
50+
"validthis": false,
51+
"jasmine": true,
52+
"globals": {
53+
"angular": true,
54+
"module": true,
55+
"inject": true,
56+
"expected": true,
57+
"_": true,
58+
"ENV": true,
59+
"CONFIG": true
60+
}
61+
}

project/jshint-client.conf

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"curly": true,
3+
"bitwise": true,
4+
"camelcase": false,
5+
"eqeqeq": true,
6+
"forin": false,
7+
"freeze": true,
8+
"immed": false,
9+
"indent": 4,
10+
"latedef": true,
11+
"newcap": false,
12+
"noarg": true,
13+
"noempty": true,
14+
"nonbsp": true,
15+
"nonew": false,
16+
"plusplus": false,
17+
"quotmark": false,
18+
"undef": true,
19+
"unused": true,
20+
"strict": true,
21+
"maxparams": false,
22+
"maxdepth": false,
23+
"maxstatements": false,
24+
"maxcomplexity": false,
25+
"maxlen": false,
26+
"asi": false,
27+
"boss": false,
28+
"debug": false,
29+
"eqnull": false,
30+
"es5": false,
31+
"esnext": true,
32+
"moz": false,
33+
"evil": false,
34+
"expr": false,
35+
"funcscope": false,
36+
"globalstrict": true,
37+
"iterator": false,
38+
"lastsemic": false,
39+
"laxbreak": false,
40+
"laxcomma": false,
41+
"loopfunc": false,
42+
"multistr": true,
43+
"noyield": false,
44+
"notypeof": false,
45+
"proto": false,
46+
"scripturl": false,
47+
"shadow": false,
48+
"sub": false,
49+
"supernew": false,
50+
"validthis": false,
51+
"globals": {
52+
"angular": true,
53+
"_": true,
54+
"ENV": true,
55+
"CONFIG": true
56+
}
57+
}

project/jshint-server.conf

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"curly": true,
3+
"bitwise": true,
4+
"camelcase": false,
5+
"eqeqeq": true,
6+
"forin": false,
7+
"freeze": true,
8+
"immed": false,
9+
"indent": 4,
10+
"latedef": true,
11+
"newcap": false,
12+
"noarg": true,
13+
"noempty": true,
14+
"nonbsp": true,
15+
"nonew": false,
16+
"plusplus": false,
17+
"quotmark": false,
18+
"undef": true,
19+
"unused": true,
20+
"strict": true,
21+
"maxparams": false,
22+
"maxdepth": false,
23+
"maxstatements": false,
24+
"maxcomplexity": false,
25+
"maxlen": false,
26+
"asi": false,
27+
"boss": false,
28+
"debug": false,
29+
"eqnull": false,
30+
"es5": false,
31+
"esnext": true,
32+
"moz": false,
33+
"evil": false,
34+
"expr": false,
35+
"funcscope": false,
36+
"globalstrict": true,
37+
"iterator": false,
38+
"lastsemic": false,
39+
"laxbreak": false,
40+
"laxcomma": false,
41+
"loopfunc": false,
42+
"multistr": true,
43+
"noyield": false,
44+
"notypeof": false,
45+
"proto": false,
46+
"scripturl": false,
47+
"shadow": false,
48+
"sub": false,
49+
"supernew": false,
50+
"validthis": false,
51+
"node": true,
52+
"globals": {
53+
}
54+
}

0 commit comments

Comments
 (0)