Git Product home page Git Product logo

ty-po / code-dot-org Goto Github PK

View Code? Open in Web Editor NEW

This project forked from code-dot-org/code-dot-org

0.0 2.0 0.0 2.19 GB

The code powering code.org and studio.code.org

Home Page: http://code.org

License: Other

Ruby 1.73% JavaScript 79.98% Shell 0.02% Python 0.16% CSS 2.85% Perl 0.01% HTML 11.92% Emacs Lisp 0.01% Gherkin 0.09% Prolog 0.01% Processing 0.01% PHP 2.95% ApacheConf 0.01% Racket 0.17% SourcePawn 0.09% C++ 0.01%

code-dot-org's Introduction

Build setup

This document describes how to set up your workstation to develop for Code.org.

Install OS-specific prerequisites

You can do Code.org development using OSX, Ubuntu, or Windows (running Ubuntu in a VM). Setup for Windows is more complicated and relatively few developers use it. Start with the instructions for your platform in the subsections below, followed by the Common Setup section.

OS X Mavericks / Yosemite

  1. Install Homebrew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. Run sudo chown -R $(whoami):admin /usr/local/. (Brew assumes it can write to subdirectories of /usr/local/, which not all installs of OSXallow. Running brew as root is discouraged.)
  3. brew install https://raw.github.com/quantiverge/homebrew-binary/pdftk/pdftk.rb enscript gs mysql imagemagick rbenv ruby-build coreutils
  4. If it complains about an old version of <package>, run brew unlink <package> and run brew install <package> again
  5. Set up MySQL
  6. Have launchd start mysql at login: ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
  7. Start mysql now: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
  8. Set up RBENV, ruby-build, and Ruby 2.0
  9. Add if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi to ~/.profile
  10. source ~/.profile
  11. git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
  12. rbenv install 2.0.0-p451
  13. rbenv global 2.0.0-p451
  14. rbenv rehash

Ubuntu 14.04

  1. sudo aptitude update
  2. sudo aptitude upgrade
  3. sudo aptitude install -y git mysql-server mysql-client libmysqlclient-dev libxslt1-dev libssl-dev zlib1g-dev imagemagick libmagickcore-dev libmagickwand-dev openjdk-7-jre-headless libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev curl pdftk ruby2.0 ruby2.0-dev
  • Hit enter and select default options for any configuration popups
  1. Upgrade npm to 2.0. If npm -v says less than 2.0,
  • sudo add-apt-repository ppa:chris-lea/node.js
  • sudo apt-get update
  • sudo apt-get install nodejs
  1. Either setup RBENV or configure your default ruby and gem version to 2.0
  2. Option A - RBENV: (instructions) 1. Install RBENV and ruby-build 1. rbenv install 2.0.0-p451 1. rbenv global 2.0.0-p451 1. rbenv rehash
  3. Option B - Symlinks: 1. Ruby: sudo ln -sf /usr/bin/ruby2.0 /usr/bin/ruby 1. Gem: sudo ln -sf /usr/bin/gem2.0 /usr/bin/gem 1. sudo chown `whoami` /usr/bin/gem/`
  4. Install Node.js 0.12.4 and npm 2.10.1
  5. Option A - nodesource repository 1. curl -sL https://deb.nodesource.com/setup | sudo bash - 1. sudo aptitude install -y nodejs
  6. Option B - Manual install 1. Nodejs.org

Windows note: use an Ubuntu VM

Many Windows developers have found that setting up an Ubuntu virtual machine is less painful than getting Ruby and other prerequisites running on Windows.

  • Option A: Use VMWare Player and an Ubuntu 14.04 iso image
  • Option B: Use vagrant (install):
    1. First clone the code.org git repo to get the provided Vagrantfile (you will be able to skip step 1 of the common setup instructions): git clone https://github.com/code-dot-org/code-dot-org.git
    2. cd code-dot-org
    3. vagrant up
    4. vagrant ssh
    5. Goto step 2 of the common setup instructions
  • Option C: Use AWS EC2: launch Ubuntu 14.04 AMI

Common setup

  1. git clone https://github.com/code-dot-org/code-dot-org.git
  2. gem install bundler -v 1.10.4
  3. rbenv rehash (if using rbenv)
  4. cd code-dot-org/aws
  5. bundle install
  6. cd ..
  7. sudo chown $(whoami) $HOME/.npm (It is OK if this path doesn't exist.)
  8. rake install

Organizational Structure

Our code is segmented into four parts:

  • Blockly Core is the visual programming language platform used for the interactive tutorials.
  • Blockly includes apps—blockly puzzles built based on Blockly Core.
  • Dashboard, is the tutorial platform which organizes blockly levels into tutorials.
  • Pegasus is the main site which also includes the teacher dashboard (support for teachers to track student progress).

Running Dashboard

  1. cd code-dot-org
  2. rake build:dashboard (Generally, do this after each pull)
  3. bin/dashboard-server
  4. Visit http://localhost.studio.code.org:3000/

Running Pegasus

  1. cd code-dot-org
  2. rake build:pegasus (Generally, do this after each pull)
  3. bin/pegasus-server
  4. Visit http://localhost.code.org:3000/

Building Apps and Blockly-core (optional)

The studio.code.org default dashboard install includes a static build of blockly, but if you want to make modifications to blockly or blockly-core you'll want to enable building them in the build:

Enabling Apps Builds

You'll need to do this once:

  1. OS X:
  2. Install the Java 8 JDK
  3. cd code-dot-org
  4. Edit locals.yml
  5. Add build_apps: true
  6. Add build_blockly_core: true
  7. Add use_my_apps: true
  8. rake install

This configures your system to build apps (and blockly-core) whenever you run rake build and to use the version of blockly that you build yourself.

Building Apps and Blockly-Core

  1. cd code-dot-org
  2. rake build

This will build everything you have set to build in locals.yml.

You can use rake build:apps and rake build:blockly_core to build a specific project.

You can also set build_dashboard: false and/or build_pegasus: false in locals.yml if you don't need to build these frequently. They default to true.

Alternatively, you can run: rake build:core_and_apps_dev, which will build blockly core and the apps bundle without running tests and without localization.

Contributing

We'd love to have you join our group of contributors! Please e-mail your areas of interest and your availability to Alice ([email protected]), and we’ll be happy to match you with a project. You can start setting up with these next steps.

  1. Anyone who would like to contribute to code.org projects must read and sign the Contributor License Agreement. We can't accept pull requests from contributors who haven't yet signed the CLA.

  2. Join our community development HipChat room for help getting set up, picking a task, etc. We're happy to have you! If you want to make sure you get our attention, include an @all (everyone) or @here (everyone currently in the room) in your message.

  3. Get your build setup, following this README. Fork our repo and make sure to merge our staging branch in WEEKLY as we do update frequently.

Submitting Contributions

Please check your PR against our tests before submitting.

Code style

Running rake lint locally will find any Ruby warnings. For other languages see the style guide.

Manually

We support recent versions of Firefox, Chrome, IE9, iOS Safari and the Android browsers (full list of supported browsers and versions). Be sure to try your feature out in IE9, iOS and Android if it's a risk. BrowserStack live or Sauce Labs manual let you run manual tests in these browsers remotely.

Unit tests

For dashboard changes, be sure to test your changes using rake test. For apps or blockly changes, see our grunt testing instructions.

UI tests

Our continuous integration server regularly runs a suite of UI tests using Selenium / Cucumber which run against many browsers via BrowserStack Automate, and can also be run locally using chromedriver. See the README in that folder for instructions.

If your changes might affect level paths, blockly UI, or critical path site logic, be sure to test your changes with a local UI test.

Submitting your Pull Request

Contributors should follow the GitHub fork-and-pull model to submit pull requests into this repository.

  1. On your fork, you'll either push to your own finished branch or checkout a new branch for your feature before you start your feature
    • git checkout -b branch_name
  2. Develop the new feature and push the changes to your fork and branch
    • git add YYY
    • git commit -m "ZZZ"
    • git push origin branch_name
  3. Go to the code-dot-org GitHub page
  4. For your submission to be reviewed
    • Click on the "Pull Request" link, look over and confirm your diff
    • Submit a pull request for your branch to be merged into staging
    • For bonus points, include screenshots in the description. Command + Ctrl + Shift + 4 in OS X lets you copy a screen selection to your clipboard, which GitHub will let you paste right into the description
  5. After your pull request is merged into staging, you can review your changes on the following sites:

code-dot-org's People

Contributors

deploy-code-org avatar bjvanminnen avatar laurelfan avatar islemaster avatar tanyaparker avatar bcjordan avatar breville avatar davidsbailey avatar geoffrey-elliott avatar rlhawk avatar cpirich avatar wjordan avatar sfilman avatar dabbler0 avatar steveeisner avatar hamms avatar mrjoshida avatar philbogle avatar beezwaxz avatar pickettd avatar joshlory avatar ty-po avatar rhc2104 avatar drewperlman avatar raboof avatar joshk avatar bakerfranke avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.