Skip to content

Commit 9c74e4b

Browse files
committed
Intial commit
0 parents  commit 9c74e4b

9 files changed

+257
-0
lines changed

Diff for: README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Things to do :
2+
Basic authentication mechanism
3+
Get data before routing
4+
Session maitaining
5+
LDAP
6+
On- Refresh - reroute get all data
7+
Call API and cancel them (Blue bird or Redux-Saga)
8+
Service worker Cache

Diff for: index.html

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!doctype html>
2+
<html lang="en" manifest="/manifest.appcache">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<!-- include libraries(jQuery, bootstrap) -->
8+
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.css" rel="stylesheet">
9+
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script>
10+
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.js"></script>
11+
<link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.6/summernote.css" rel="stylesheet">
12+
<script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.6/summernote.js"></script>
13+
<link rel="apple-touch-icon" href="favicon.png">
14+
<link rel="manifest" href="manifest.json">
15+
<meta name="mobile-web-app-capable" content="yes">
16+
<link rel="icon" sizes="124x124" href="favicon.png">
17+
<title>Login Flow by Mohan</title>
18+
</head>
19+
<body>
20+
<!-- The app hooks into this div -->
21+
<div id="app"></div>
22+
<!-- The JavaScript bundle -->
23+
<script src="js/bundle.js"></script>
24+
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
25+
</body>
26+
</html>

Diff for: js/app.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from 'react'
2+
import ReactDOM from 'react-dom'
3+
4+
5+
class Welcome extends React.Component {
6+
componentDidMount() {
7+
$('#summernote').summernote({
8+
height:700
9+
});
10+
11+
}
12+
render() {
13+
return <div id="summernote">Hello Client - You will be happy to see this</div>
14+
}
15+
}
16+
ReactDOM.render(<Welcome></Welcome>,document.getElementById('app'))

Diff for: js/bundle.js

+20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: makewebpackconfig.js

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
var path = require('path');
2+
var webpack = require('webpack');
3+
var HtmlWebpackPlugin = require('html-webpack-plugin');
4+
var AppCachePlugin = require('appcache-webpack-plugin');
5+
6+
module.exports = function(options) {
7+
var entry, jsLoaders, plugins, cssLoaders, devtool;
8+
9+
// If production is true
10+
if (options.prod) {
11+
// Entry
12+
entry = [
13+
path.resolve(__dirname, 'js/app.js') // Start with js/app.js...
14+
];
15+
cssLoaders = ['file-loader?name=[path][name].[ext]', 'postcss-loader'];
16+
// Plugins
17+
plugins = [// Plugins for Webpack
18+
new webpack.optimize.UglifyJsPlugin({ // Optimize the JavaScript...
19+
compress: {
20+
warnings: false // ...but do not show warnings in the console (there is a lot of them)
21+
}
22+
}),
23+
new HtmlWebpackPlugin({
24+
template: 'index.html', // Move the index.html file...
25+
minify: { // Minifying it while it is parsed using the following, self–explanatory options
26+
removeComments: true,
27+
collapseWhitespace: true,
28+
removeRedundantAttributes: true,
29+
useShortDoctype: true,
30+
removeEmptyAttributes: true,
31+
removeStyleLinkTypeAttributes: true,
32+
keepClosingSlash: true,
33+
minifyJS: true,
34+
minifyCSS: true,
35+
minifyURLs: true,
36+
}
37+
}),
38+
new AppCachePlugin({
39+
exclude: ['.htaccess']
40+
})
41+
];
42+
43+
// If app is in development
44+
} else {
45+
devtool = 'cheap-eval-source-map';
46+
// Entry
47+
entry = [
48+
"webpack-dev-server/client?http://localhost:3000", // Needed for hot reloading
49+
"webpack/hot/only-dev-server", // See above
50+
path.resolve(__dirname, 'js/app.js') // Start with js/app.js...
51+
];
52+
cssLoaders = ['style-loader', 'css-loader', 'postcss-loader'];
53+
// Only plugin is the hot module replacement plugin
54+
plugins = [
55+
new webpack.HotModuleReplacementPlugin(), // Make hot loading work
56+
new AppCachePlugin()
57+
]
58+
}
59+
60+
return {
61+
devtool: devtool,
62+
entry: entry,
63+
output: { // Compile into js/build.js
64+
path: path.resolve(__dirname, 'build'),
65+
filename: "js/bundle.js"
66+
},
67+
module: {
68+
loaders: [{
69+
test: /\.js$/, // Transform all .js files required somewhere within an entry point...
70+
loader: 'babel', // ...with the specified loaders...
71+
exclude: path.join(__dirname, '/node_modules/') // ...except for the node_modules folder.
72+
}, {
73+
test: /\.css$/, // Transform all .css files required somewhere within an entry point...
74+
loaders: cssLoaders // ...with PostCSS
75+
}, {
76+
test: /\.jpe?g$|\.gif$|\.png$/i,
77+
loader: "url-loader?limit=10000"
78+
}
79+
]
80+
81+
},
82+
plugins: plugins,
83+
postcss: function() {
84+
return [
85+
require('postcss-import')({ // Import all the css files...
86+
onImport: function (files) {
87+
files.forEach(this.addDependency); // ...and add dependecies from the main.css files to the other css files...
88+
}.bind(this) // ...so they get hot–reloaded when something changes...
89+
}),
90+
require('postcss-simple-vars')(), // ...then replace the variables...
91+
require('postcss-focus')(), // ...add a :focus to ever :hover...
92+
require('autoprefixer')({ // ...and add vendor prefixes...
93+
browsers: ['last 2 versions', 'IE > 8'] // ...supporting the last 2 major browser versions and IE 8 and up...
94+
}),
95+
require('postcss-reporter')({ // This plugin makes sure we get warnings in the console
96+
clearMessages: true
97+
})
98+
];
99+
},
100+
target: "web", // Make web variables accessible to webpack, e.g. window
101+
stats: false, // Don't show stats in the console
102+
progress: true
103+
}
104+
}

Diff for: package.json

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"name": "reactjs-boilerplate",
3+
"version": "2.3.0",
4+
"description": "Quick setup for new React.js applications featuring Redux, hot–reloading, PostCSS, react-router and Mocha.",
5+
"dependencies": {
6+
"bcryptjs": "2.3.0",
7+
"fontfaceobserver": "^1.5.1",
8+
"react": "^0.14.3",
9+
"react-dom": "^0.14.3",
10+
"react-redux": "^4.0.0",
11+
"react-router": "2.0.0-rc5",
12+
"redux": "^3.0.4",
13+
"redux-thunk": "^1.0.0",
14+
"bootstrap": "^3.3.6",
15+
"codemirror": "^5.11.0",
16+
"font-awesome": "^4.5.0",
17+
"jquery": "^2.2.0",
18+
"summernote": "^0.8.1"
19+
},
20+
"devDependencies": {
21+
"appcache-webpack-plugin": "^1.2.0",
22+
"autoprefixer": "^6.0.2",
23+
"babel": "^5.8.23",
24+
"babel-core": "^5.8.24",
25+
"babel-eslint": "^4.1.2",
26+
"babel-loader": "^5.3.2",
27+
"babel-plugin-react-transform": "^1.0.5",
28+
"css-loader": "^0.23.0",
29+
"cssnano": "^3.0.1",
30+
"eslint": "^1.4.1",
31+
"eslint-config-airbnb": "1.0.0",
32+
"eslint-plugin-react": "^3.3.2",
33+
"file-loader": "^0.8.4",
34+
"html-webpack-plugin": "^1.6.1",
35+
"json-loader": "^0.5.2",
36+
"object.assign": "^4.0.1",
37+
"postcss-focus": "^1.0.0",
38+
"postcss-import": "^7.0.0",
39+
"postcss-loader": "^0.8.0",
40+
"postcss-reporter": "^1.2.1",
41+
"postcss-simple-vars": "^1.0.0",
42+
"react-transform-hmr": "^1.0.1",
43+
"style-loader": "^0.13.0",
44+
"url-loader": "^0.5.6",
45+
"webpack": "^1.12.1",
46+
"webpack-dev-server": "^1.11.0"
47+
},
48+
"repository": {
49+
"type": "git",
50+
"url": "[email protected]:mohanprasaths/Redux-Relearn.git"
51+
},
52+
"scripts": {
53+
"start": "NODE_ENV=development node server.js",
54+
"build": "NODE_ENV=production webpack --config webpack.prod.config.js --progress --colors -p"
55+
},
56+
"author": "Mohan Prasath",
57+
"license": "MIT"
58+
}

Diff for: server.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Gets called when running npm start
2+
3+
var webpack = require('webpack');
4+
var WebpackDevServer = require('webpack-dev-server');
5+
var config = require('./webpack.dev.config');
6+
7+
new WebpackDevServer(webpack(config), { // Start a server
8+
publicPath: config.output.publicPath,
9+
hot: true, // With hot reloading
10+
inline: false,
11+
historyApiFallback: true,
12+
quiet: true // Without logging
13+
}).listen(3000, 'localhost', function (err, result) {
14+
if (err) {
15+
console.log(err);
16+
}
17+
18+
console.log('Listening at localhost:3000');
19+
});

Diff for: webpack.dev.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = require("./makewebpackconfig")({
2+
prod: false
3+
});

Diff for: webpack.prod.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = require("./makewebpackconfig")({
2+
prod: true
3+
});

0 commit comments

Comments
 (0)