freeCodeCamp.org's open-source codebase and curriculum. Learn to code for free.
 
 
 
 
 
Go to file
terakilobyte ba29f0533a Updated to show how json should be modeled, fleshed out resources to load new challengeMap stub 2015-05-18 22:03:27 -04:00
bower_components Angular validation 2015-01-06 01:09:17 -05:00
config Updated to show how json should be modeled, fleshed out resources to load new challengeMap stub 2015-05-18 22:03:27 -04:00
controllers Updated to show how json should be modeled, fleshed out resources to load new challengeMap stub 2015-05-18 22:03:27 -04:00
models Begin restructuring all Coursewares and Bonfires to one unified model and flow. 2015-05-16 00:39:43 -04:00
public Minor updates 2015-05-18 21:20:32 -04:00
seed_data Updated to show how json should be modeled, fleshed out resources to load new challengeMap stub 2015-05-18 22:03:27 -04:00
test Major refactor. Add error handlers everywhere. 2014-12-23 08:48:28 -08:00
views hotfix to fix #440 2015-05-11 23:46:38 -07:00
.bowerrc Harden camper news and don't expose user object. Upvoting still needs to be looked at. 2015-04-19 03:36:54 -04:00
.editorconfig Add .editorconfig to enforce certain automatic behavior on all editors, 2015-03-29 20:49:56 +09:00
.eslintrc Added start of individual post view and post lists view, wired upvoting functionality for individual posts 2015-03-03 22:03:33 +09:00
.gitignore Update .gitignore file 2015-05-04 17:03:05 -04:00
.jshintrc Work on bonfire and make better .jshintrc files 2015-01-16 18:58:27 -05:00
.node-inspectorrc twitter username now persisted 2014-10-13 21:38:10 -07:00
.travis.yml Travis-CI test against node.js 0.10 only 2014-02-27 19:45:47 -05:00
Procfile Changing forever script to correctly target app.js 2015-02-06 01:59:43 -05:00
README.md Update README.md 2015-05-04 14:03:42 -07:00
app.js fix #443 2015-05-12 00:05:08 -07:00
bower.json improve bonfires and js coursewares 2015-05-10 21:59:55 -07:00
gulpfile.js add code of conduct 2015-05-09 18:36:21 -07:00
package.json Update helmet js and use newer middleware, update reference to freecodecamp in trusted group 2015-05-06 19:10:03 -04:00
setup.js Major refactor. Add error handlers everywhere. 2014-12-23 08:48:28 -08:00

README.md

Throughput Graph

Stories in Ready

Welcome to Free Code Camp's open source codebase!

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.

We help our campers build job-worthy portfolios of real apps used by real people, while helping nonprofits.

80% of our campers are over 25, and nearly a fifth of our campers are women.

This code is running live at FreeCodeCamp.com. We also have Slack, a blog, and even a Twitch.tv channel.

Join our community!

Contributing

We welcome pull requests from Free Code Camp campers (our students) and seasoned JavaScript developers alike! Follow these steps to contribute:

  1. Check our public Waffle Board.
  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.
  3. Fork the project (Need help with forking a project?). 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?)
  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, and it will highlight anything doesn't conform to AirBnB's JavaScript Style Guide. 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.
  7. Once your code is ready, submit a pull request from your branch to Free Code Camp's staging branch. We'll do a quick code review and give you feedback, then iterate from there.
  8. Once we accept one of your pull requests, one of the project owners (currently @quincylarson, @terakilobyte, and @berkeleytrue) will add you to our camper contributor group.

Prerequisites

Getting Started

The easiest way to get started is to clone the repository:

# Get the latest snapshot
git clone --depth=1 https://github.com/freecodecamp/freecodecamp.git freecodecamp

cd freecodecamp

# Install NPM dependencies
npm install

# Install Bower dependencies
bower install

# Create a .env file and populate it with the necessary API keys and secrets:
touch .env

Edit your .env file with the following API keys accordingly (if you only use email login, only the MONGOHQ_URL, SESSION_SECRET, MANDRILL_USER and MANDRILL_PASSWORD fields are necessary:


MONGOHQ_URL='mongodb://localhost:27017/freecodecamp'
SESSION_SECRET='ANY ENGLISH PHRASE'
MANDRILL_USER='THE EMAIL ADDRESS FROM YOUR MANDRILL ACCOUNT'
MANDRILL_PASSWORD='YOUR MANDRILL PASSWORD'
FACEBOOK_ID='FACEBOOK APP API KEY'
FACEBOOK_SECRET='FACEBOOK SECRET'
GITHUB_ID='GITHUB APP API KEY'
GITHUB_SECRET='GITHUB APP SECRET'
TWITTER_KEY='TWITTER APP API KEY'
TWITTER_SECRET='TWITTER APP SECRET'
GOOGLE_ID='GOOGLE APP API KEY'
GOOGLE_SECRET='GOOGLE APP SECRET'
LINKEDIN_ID='LINKEDIN APP API KEY'
LINKEDIN_SECRET='LINKEDIN APP SECRET'


# Start the mongo server
mongod

# Seed your database with the challenges
node seed_data/seed.js

# start the application
gulp

Project Structure

Name Description
config/passport.js Passport Local and OAuth strategies, plus login middleware.
config/secrets.js Your API keys, tokens, passwords and database URL.
controllers/contact.js Controller for contact form.
controllers/home.js Controller for home page (index).
controllers/user.js Controller for user account management.
controllers/challenges.js Controller for rendering the challenges.
models/User.js Mongoose schema and model for User.
models/Challenge.js Mongoose schema and model for Challenge.
public/ Static assets (fonts, css, js, img).
public/js/application.js Specify client-side JavaScript dependencies.
public/js/main.js Place your client-side JavaScript here.
public/css/main.less Main stylesheet for the app.
views/account/ Templates for login, password reset, signup, profile.
views/partials/flash.jade Error, info and success flash notifications.
views/partials/navigation.jade Navbar partial template.
views/partials/footer.jade Footer partial template.
views/layout.jade Base template.
views/home.jade Home page template.
app.js Main application file.

List of Packages

Package Description
async Utility library that provides asynchronous control flow.
bcrypt-nodejs Library for hashing and salting user passwords.
cheerio Scrape web pages using jQuery-style syntax.
clockwork Clockwork SMS API library.
connect-assets Compiles LESS stylesheets, concatenates & minifies JavaScript.
connect-mongo MongoDB session store for Express.
csso Dependency for connect-assets library to minify CSS.
express Node.js web framework.
body-parser Express 4.0 middleware.
cookie-parser Express 4.0 middleware.
express-session Express 4.0 middleware.
morgan Express 4.0 middleware.
compression Express 4.0 middleware.
errorhandler Express 4.0 middleware.
method-override Express 4.0 middleware.
express-flash Provides flash messages for Express.
express-validator Easy form validation for Express.
fbgraph Facebook Graph API library.
github-api GitHub API library.
jade Template engine for Express.
less LESS compiler. Used implicitly by connect-assets.
helmet Restricts Cross site requests. You can modify its settings in app.js
mongoose MongoDB ODM.
nodemailer Node.js library for sending emails.
passport Simple and elegant authentication library for node.js
passport-facebook Sign-in with Facebook plugin.
passport-github Sign-in with GitHub plugin.
passport-google-oauth Sign-in with Google plugin.
passport-twitter Sign-in with Twitter plugin.
passport-local Sign-in with Username and Password plugin.
passport-linkedin-oauth2 Sign-in with LinkedIn plugin.
passport-oauth Allows you to set up your own OAuth 1.0a and OAuth 2.0 strategies.
request Simplified HTTP request library.
lodash Handy JavaScript utilities library.
uglify-js Dependency for connect-assets library to minify JS.
mocha Test framework.
chai BDD/TDD assertion library.
supertest HTTP assertion library.
multiline Multi-line strings for the generator.

License

The MIT License (MIT)

Copyright (c) 2015 Sahat Yalkabov (creator of the Hackathon Starter App with which Free Code Camp started) Copyright (c) 2015 Quincy Larson (the guy who started Free Code Camp and wrote a lot of the code here)

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.