diff --git a/.gitignore b/.gitignore index 112d64591e..60d9092f91 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ bower_components main.css bundle.js coverage +.remote-sync.json diff --git a/README.md b/README.md index 0a7e0e9151..9770de3ebc 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ Welcome to Free Code Camp's open source codebase! ======================= #Note -We're currently very close to moving from express to loopback. As such, please keep in mind that the instructions here for setting up and running the project do not directly translate to the staging branch. Additionally, the file structure is quite a bit different. As always, the staging branch is the appropriate place to branch off of to fix/add something! +We're currently very close to moving from Express to Loopback. As such, please keep in mind that the instructions here for setting up and running the project do not directly translate to the staging branch. Additionally, the file structure is quite a bit different. As always, the staging branch is the appropriate place to branch off of to fix/add something! -Free Code Camp is an open-source community of busy people who learn to code, then build projects for nonprofits. +Free Code Camp is an open-source community of busy people who learn to code, then build projects for nonprofits. Our campers (students) start by working through our free, self-paced, browser-based curriculum. Next, they build several practice projects. Finally, we pair two campers together with a stakeholder from a nonprofit organization, and help them build the solution the nonprofit has requested. @@ -17,7 +17,7 @@ Our campers (students) start by working through our free, self-paced, browser-ba 80% of our campers are over 25, and nearly a fifth of our campers are women. -This code is running live at [FreeCodeCamp.com](http://www.FreeCodeCamp.com). We also have [Slack](http://freecodecamp.slack.com), a [blog](http://blog.freecodecamp.com), and even a [Twitch.tv channel](http://twitch.tv/freecodecamp). +This code is running live at [FreeCodeCamp.com](http://www.FreeCodeCamp.com). We also have [Slack](http://freecodecamp.slack.com), a [blog](http://blog.freecodecamp.com), and even a [Twitch.tv channel](http://twitch.tv/freecodecamp). [Join our community](http://www.freecodecamp.com/signin)! @@ -28,7 +28,7 @@ We welcome pull requests from Free Code Camp campers (our students) and seasoned 1. Check our [public Waffle Board](https://waffle.io/freecodecamp/freecodecamp). 2. Pick an issue that nobody has claimed and start working on it. If your issue isn't on the board, open an issue. If you think you can fix it yourself, start working on it. Feel free to ask for help in our [Slack](http://freecodecamp.slack.com). -3. Fork the project ([Need help with forking a project?](https://help.github.com/articles/fork-a-repo/)). You'll do all of your work on your forked copy. +3. Fork the project ([Need help with forking a project?](https://help.github.com/articles/fork-a-repo/)). You'll do all of your work on your forked copy. 4. Create a branch specific to the issue or feature you are working on. Push your work to that branch. ([Need help with branching?](https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches)) 5. Name the branch something like `user-xxx` where user is your username and xxx is the issue number you are addressing. 6. You should have [ESLint running in your editor](http://eslint.org/docs/user-guide/integrations.html), and it will highlight anything doesn't conform to [AirBnB's JavaScript Style Guide](https://github.com/airbnb/javascript). Please do not ignore any linting errors, as they are meant to **help** you. Make sure none of your JavaScript is longer than 80 characters per line. diff --git a/client/README.md b/client/README.md new file mode 100644 index 0000000000..b75516ce38 --- /dev/null +++ b/client/README.md @@ -0,0 +1,3 @@ +This is the entry point for the client +Code that should only run on the client should be put here. +NOTE(berks): For react specific stuff this should be the entry point diff --git a/client/index.js b/client/index.js new file mode 100644 index 0000000000..68baa7ec0a --- /dev/null +++ b/client/index.js @@ -0,0 +1,20 @@ +import BrowserHistory from 'react-router/lib/BrowserHistory'; +import debugFactory from 'debug'; +import { Cat } from 'thundercats'; + +import AppFactory from '../common/app/appFactory'; + +const debug = debugFactory('fcc:client'); +const DOMContianer = document.getElemenetById('#fCC'); +const fcc = new Cat(); + +// returns an observable +fcc.render(AppFactory(BrowserHistory), DOMContianer) + .subscribe( + function() { + debug('react rendered'); + }, + function(err) { + debug('an error has occured', err.stack); + } + ); diff --git a/common/app/App.jsx b/common/app/App.jsx new file mode 100644 index 0000000000..f3a77cae51 --- /dev/null +++ b/common/app/App.jsx @@ -0,0 +1,25 @@ +import React, { PropTypes } from 'react'; + +import Nav from './components/Nav'; +import Footer from './components/Footer'; + +export default class extends React.Component { + constructor(props) { + super(props); + } + + static displayName = 'FreeCodeCamp' + static propTypes = { + children: PropTypes.node + } + + render() { + return ( +
+
+ ); + } +} diff --git a/common/app/appFactory.jsx b/common/app/appFactory.jsx new file mode 100644 index 0000000000..b8732a89c6 --- /dev/null +++ b/common/app/appFactory.jsx @@ -0,0 +1,18 @@ +import React from 'react'; +import { Router, Route } from 'react-router'; + +// components +import App from './App.jsx'; +import Jobs from './screens/App/screens/Jobs'; + +module.exports = function appFactory(history) { + return ( + + + + + + ); +}; diff --git a/common/app/components/Footer/Footer.jsx b/common/app/components/Footer/Footer.jsx new file mode 100644 index 0000000000..f95e0e3adc --- /dev/null +++ b/common/app/components/Footer/Footer.jsx @@ -0,0 +1,50 @@ +import React from 'react'; +import { Col, Row, Grid } from 'react-bootstrap'; + +import links from './links.json'; + +export default class extends React.Component { + static displayName = 'Footer' + renderLinks(mobile) { + return links.map(link => { + return ( + + { this.renderContent(mobile, link.content) } + + ); + }); + } + + renderContent(mobile, content) { + if (mobile) { + return ( + + content; + + ); + } + return content; + } + + render() { + return ( + + + + { this.renderLinks() } + + + { this.renderLinks(true) } + + + + ); + } +} diff --git a/common/app/components/Footer/index.js b/common/app/components/Footer/index.js new file mode 100644 index 0000000000..c50e0cda87 --- /dev/null +++ b/common/app/components/Footer/index.js @@ -0,0 +1 @@ +export { default as Footer } from './Footer.jsx'; diff --git a/common/app/components/Footer/links.json b/common/app/components/Footer/links.json new file mode 100644 index 0000000000..54071917b4 --- /dev/null +++ b/common/app/components/Footer/links.json @@ -0,0 +1,44 @@ +[ + { + "className": "ion-speakerphone", + "content": " Blog  ", + "href": "http://blog.freecodecamp.com", + "target": "_blank" + }, + { + "className": "ion-social-twitch-outline", + "content": " Twitch  ", + "href": "http://www.twitch.tv/freecodecamp", + "target": "_blank" + }, + { + "className": "ion-social-github", + "content": " Github  ", + "href": "http://github.com/freecodecamp", + "target": "_blank" + }, + { + "className": "ion-social-twitter", + "content": " Twitter  ", + "href": "http://twitter.com/freecodecamp", + "target": "_blank" + }, + { + "className": "ion-social-facebook", + "content": " Facebook  ", + "href": "http://facebook.com/freecodecamp", + "target": "_blank" + }, + { + "className": "ion-information-circled", + "content": " About  ", + "href": "/learn-to-code", + "target": "_self" + }, + { + "className": "ion-locked", + "content": " Privacy  ", + "href": "/privacy'", + "target": "_self" + } +] diff --git a/common/screens/nav/Nav.jsx b/common/app/components/Nav/Nav.jsx similarity index 56% rename from common/screens/nav/Nav.jsx rename to common/app/components/Nav/Nav.jsx index 52a9a8728b..f5c339c2c1 100644 --- a/common/screens/nav/Nav.jsx +++ b/common/app/components/Nav/Nav.jsx @@ -1,31 +1,30 @@ -var React = require('react'), - bootStrap = require('react-bootstrap'), - Navbar = bootStrap.Navbar, - Nav = bootStrap.Nav, - NavItem = bootStrap.NavItem, - NavItemFCC = require('./NavItem.jsx'); +import React from 'react'; +import { Nav, Navbar, NavItem } from 'react-bootstrap'; +import NavItemFCC from './NavItem.jsx'; -var NavBarComp = React.createClass({ +export default class extends React.Component { + constructor(props) { + super(props); + } - propTypes: { signedIn: React.PropTypes.bool }, + static displayName = 'Nav' + static propTypes = { + signedIn: React.PropTypes.bool + } - getDefaultProps: function() { - return { signedIn: false }; - }, - - _renderBrand: function() { + renderBrand() { var fCClogo = 'https://s3.amazonaws.com/freecodecamp/freecodecamp_logo.svg'; return ( learn to code javascript at Free Code Camp logo + className='img-responsive nav-logo' + src={ fCClogo } /> ); - }, + } - _renderSignin: function() { + renderSignin() { if (this.props.signedIn) { return ( - Sign In + href='/login'> + Sign In ); } - }, - - render: function() { + } + render() { return ( + toggleNavKey={ 0 }>