-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from raydecastro/master
Merging: docs. electrode app + confippet quick start
- Loading branch information
Showing
20 changed files
with
666 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "./node_modules/electrode-archetype-react-app/config/babel/.babelrc" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
|
||
|
||
# Created by https://www.gitignore.io/api/gitbook,node,webstorm,bower,osx | ||
|
||
### GitBook ### | ||
# Node rules: | ||
## Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
## Dependency directory | ||
## Commenting this out is preferred by some people, see | ||
## https://docs.npmjs.com/misc/faq#should-i-check-my-node_modules-folder-into-git | ||
node_modules | ||
|
||
# Book build output | ||
_book | ||
|
||
# eBook build output | ||
*.epub | ||
*.mobi | ||
|
||
|
||
### Node ### | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directory | ||
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git | ||
node_modules | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
|
||
### WebStorm ### | ||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm | ||
|
||
*.iml | ||
|
||
## Directory-based project format: | ||
.idea/ | ||
# if you remove the above rule, at least ignore the following: | ||
|
||
# User-specific stuff: | ||
# .idea/workspace.xml | ||
# .idea/tasks.xml | ||
# .idea/dictionaries | ||
# .idea/shelf | ||
|
||
# Sensitive or high-churn files: | ||
# .idea/dataSources.ids | ||
# .idea/dataSources.xml | ||
# .idea/sqlDataSources.xml | ||
# .idea/dynamic.xml | ||
# .idea/uiDesigner.xml | ||
|
||
# Gradle: | ||
# .idea/gradle.xml | ||
# .idea/libraries | ||
|
||
# Mongo Explorer plugin: | ||
# .idea/mongoSettings.xml | ||
|
||
## File-based project format: | ||
*.ipr | ||
*.iws | ||
|
||
## Plugin-specific files: | ||
|
||
# IntelliJ | ||
/out/ | ||
|
||
# mpeltonen/sbt-idea plugin | ||
.idea_modules/ | ||
|
||
# JIRA plugin | ||
atlassian-ide-plugin.xml | ||
|
||
# Crashlytics plugin (for Android Studio and IntelliJ) | ||
com_crashlytics_export_strings.xml | ||
crashlytics.properties | ||
crashlytics-build.properties | ||
fabric.properties | ||
|
||
|
||
### Bower ### | ||
bower_components | ||
.bower-cache | ||
.bower-registry | ||
.bower-tmp | ||
|
||
|
||
### OSX ### | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
# others | ||
.hg | ||
.project | ||
.tmp | ||
|
||
# Build | ||
dist | ||
Procfile | ||
config/assets.json | ||
npm-shrinkwrap.json | ||
|
||
.isomorphic-loader-config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
language: node_js | ||
node_js: | ||
- v6 | ||
- v5 | ||
- v4 | ||
- '0.12' | ||
- '0.10' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2016 Ray de Castro <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,92 @@ | ||
# electrode-app-confippet | ||
# Electrode App Confippet | ||
|
||
## Quickstart guide | ||
|
||
- Confippet is built-in to electrode. | ||
- Scaffold an electrode app using the following commands: | ||
|
||
``` | ||
npm install -g yo | ||
npm install -g generator-electrode | ||
yo electrode | ||
``` | ||
|
||
- Once the scaffolding is complete, open the following config files: | ||
|
||
``` | ||
config | ||
|_ default.json | ||
|_ development.json | ||
|_ production.json | ||
``` | ||
|
||
- Update the `config/development.json` to have the following settings: | ||
|
||
``` | ||
{ | ||
"server": { | ||
"connections": { | ||
"compression": false | ||
}, | ||
"debug": { | ||
"log": ["error"], | ||
"request": ["error"] | ||
} | ||
}, | ||
"connections": { | ||
"default": { | ||
"port": 3000 | ||
} | ||
} | ||
} | ||
``` | ||
|
||
- The above settings should show server log errors that may be beneficial for debugging, disable content encoding, and run the server in port 3000 | ||
- Update the `config/production.json` to have the following settings: | ||
|
||
``` | ||
{ | ||
"server": { | ||
"connections": { | ||
"compression": true | ||
}, | ||
"debug": { | ||
"log": false, | ||
"request": false | ||
} | ||
}, | ||
"connections": { | ||
"default": { | ||
"port": 8000 | ||
} | ||
} | ||
} | ||
``` | ||
|
||
- The above settings should disable server log errors, enable content encoding, and run the server in port 8000 | ||
- The `server` key related configs are from hapi.js. More config options can be found here: http://hapijs.com/api | ||
- The `connections` key are electrode server specific: https://github.com/electrode-io/electrode-server/tree/master/lib/config | ||
- Start the electrode app in `development` environment: | ||
|
||
``` | ||
export NODE_ENV=development | ||
gulp hot | ||
``` | ||
|
||
- Start the electrode app in `production` environment: | ||
|
||
``` | ||
export NODE_ENV=production | ||
gulp hot | ||
``` | ||
|
||
- Running in the selected environment should load the appropriate configuration settings | ||
- Keys that exist in the `config/default.json` that are also in the other environment configs will be replaced by the environment specific versions | ||
- In Electrode, the configurations are loaded from `server/index.js` at this line: | ||
|
||
``` | ||
const config = require("electrode-confippet").config; | ||
const staticPathsDecor = require("electrode-static-paths"); | ||
require("electrode-server")(config, [staticPathsDecor()]); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from "react"; | ||
import { routes } from "./routes"; | ||
import { Router } from "react-router"; | ||
import { Resolver } from "react-resolver"; | ||
import { createHistory } from "history"; | ||
import "./styles/base.styl"; | ||
|
||
window.webappStart = () => { | ||
Resolver.render( | ||
() => <Router history={createHistory()}>{routes}</Router>, | ||
document.querySelector(".js-content") | ||
); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from "react"; | ||
|
||
export class Home extends React.Component { | ||
render() { | ||
return ( | ||
<div><h1>Hello <a href="https://github.com/electrode-io">Electrode</a></h1></div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from "react"; | ||
import { Route, IndexRoute} from "react-router"; | ||
import { Home } from "./components/home"; | ||
|
||
export const routes = ( | ||
<Route path="/" component={Home} /> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
border-radius() | ||
-webkit-border-radius: arguments | ||
-moz-border-radius: arguments | ||
border-radius: arguments | ||
|
||
body | ||
font: 12px Helvetica, Arial, sans-serif | ||
|
||
a.button | ||
border-radius(5px) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"plugins": { | ||
"webapp": { | ||
"module": "./server/plugins/webapp", | ||
"options": { | ||
"paths": { | ||
"/{args*}": { | ||
"content": { | ||
"module": "./server/views/index-view" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"plugins": { | ||
"inert": { | ||
"enable": true | ||
}, | ||
"electrodeStaticPaths": { | ||
"enable": true, | ||
"options": { | ||
"pathPrefix": "dist" | ||
} | ||
} | ||
}, | ||
"server": { | ||
"connections": { | ||
"compression": false | ||
}, | ||
"debug": { | ||
"log": ["error"], | ||
"request": ["error"] | ||
} | ||
}, | ||
"connections": { | ||
"default": { | ||
"port": 3000 | ||
} | ||
} | ||
} |
Oops, something went wrong.