diff --git a/.env b/.env new file mode 100644 index 00000000..71a46f30 --- /dev/null +++ b/.env @@ -0,0 +1,3 @@ +MONGO_URL=mongodb://localhost:27017/p5js-web-editor +PORT=8000 +SESSION_SECRET=dyR;Ihp9Y/W@?r~k$JR$nw74=#_Cus[z{yBj`Mq:I8LpWE~g{;B,}t\p/`Wjevkb!$n}N];u`Om57NF^GK@z5qF{0L04)Mz6{Djk \ No newline at end of file diff --git a/README.md b/README.md index 73fc2f92..2743f19b 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ As this project is currently being developed, there is only development mode. ##Dump of links I'm saving for reference * https://github.com/Hashnode/mern-starter +* https://github.com/mxstbr/react-boilerplate * https://sass-guidelin.es/#the-7-1-pattern * https://github.com/petehunt/react-howto * https://github.com/gajus/react-css-modules diff --git a/client/index.js b/client/index.js index 4e647922..5f1067c1 100644 --- a/client/index.js +++ b/client/index.js @@ -1,17 +1,19 @@ import React from 'react' import { render } from 'react-dom' import { Provider } from 'react-redux' +import { Router, browserHistory } from 'react-router' import configureStore from '../shared/redux/store/configureStore' -import App from '../shared/containers/App/App' +import routes from '../shared/routes' require('../styles/main.scss'); +const history = browserHistory const initialState = window.__INITIAL_STATE__ const store = configureStore(initialState) render( - + , document.getElementById('root') ) \ No newline at end of file diff --git a/server/routes/session.routes.js b/server/routes/session.routes.js index 98028509..64c30e6b 100644 --- a/server/routes/session.routes.js +++ b/server/routes/session.routes.js @@ -1,9 +1,12 @@ import { Router } from 'express'; import * as SessionController from '../controllers/session.controller'; +import passport from 'passport'; const router = new Router(); router.route('/login').get(SessionController.newSession); router.route('/login').post(SessionController.createSession); -router.route('/logout').get(SessionController.destroySession); \ No newline at end of file +router.route('/logout').get(SessionController.destroySession); + +//TODO add github authentication stuff \ No newline at end of file diff --git a/shared/containers/App.jsx b/shared/containers/App.jsx new file mode 100644 index 00000000..62b9d8ae --- /dev/null +++ b/shared/containers/App.jsx @@ -0,0 +1,18 @@ +import React from 'react'; +import { connect } from 'react-redux'; + +class App extends React.Component { + constructor(props, context) { + super(props, context); + } + + render() { + return ( +
+ { this.props.children } +
+ ); + } +} + +export default connect()(App); \ No newline at end of file diff --git a/shared/containers/App/App.jsx b/shared/containers/IDEView/IDEView.jsx similarity index 85% rename from shared/containers/App/App.jsx rename to shared/containers/IDEView/IDEView.jsx index 7305d584..a6763484 100644 --- a/shared/containers/App/App.jsx +++ b/shared/containers/IDEView/IDEView.jsx @@ -1,19 +1,18 @@ -import React from 'react'; +import React from 'react' import Editor from '../../components/Editor/Editor' import PreviewFrame from '../../components/Preview/PreviewFrame' -import Preview from '../../components/Preview/Preview' import Toolbar from '../../components/Toolbar/Toolbar' import Preferences from '../../components/Preferences/Preferences' import { bindActionCreators } from 'redux' import { connect } from 'react-redux' import * as FileActions from '../../redux/actions' -class App extends React.Component { +class IDEView extends React.Component { render() { return ( -
- +
- ); + ) } } @@ -53,4 +52,4 @@ function mapDispatchToProps(dispatch) { return bindActionCreators(FileActions, dispatch); } -export default connect(mapStateToProps, mapDispatchToProps)(App); +export default connect(mapStateToProps, mapDispatchToProps)(IDEView); diff --git a/shared/routes.js b/shared/routes.js new file mode 100644 index 00000000..862a1d79 --- /dev/null +++ b/shared/routes.js @@ -0,0 +1,12 @@ +import { Route, IndexRoute } from 'react-router' +import React from 'react' +import App from './containers/App' +import IDEView from './containers/IDEView/IDEView' + +const routes = ( + + + +); + +export default routes; \ No newline at end of file diff --git a/styles/base/_base.scss b/styles/base/_base.scss index 0f333f27..06d9f4ec 100644 --- a/styles/base/_base.scss +++ b/styles/base/_base.scss @@ -6,7 +6,7 @@ html { font-size: #{$base-font-size}px; } -.root-app { +.root-app, .app { min-height: 100%; height: 100%; } \ No newline at end of file diff --git a/styles/layout/_ide.scss b/styles/layout/_ide.scss index 2be7c528..30ac97c0 100644 --- a/styles/layout/_ide.scss +++ b/styles/layout/_ide.scss @@ -1,4 +1,4 @@ -.app { +.ide { display: flex; flex-direction: row; height: 100%;