Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

The "Simplified" Guide to Setting Up Dev Environment. (Mac)

Difficulty: :star: :star: :star: :star: (Intermediate-Advanced)

Intro

Ever wanted to “hack” CodeCombat and help contribute in making CodeCombat better? (There are two types of hacking, white-hat hacking, and black-hat hacking. White hat hacking is to help fix problems and stop black-hat hackers, and black-hat hacking is malicious hacking/cheating.) Do you find the current guide way too confusing? I’ve simplified the current guide so you can understand it.

Guide

  1. Download the Xcode command line tools by either:
    Going to Xcode->Preferences->Downloads
    or…
    Run xcode-select --install in the terminal app.

  2. Download NVM. Before you do that, go open up Terminal. You can spotlight search Terminal and click enter. (Spotlight search is the :mag: icon at the top).
    Once you go into the terminal app, type in the following to install NVM:
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
    or
    wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
    then run:
    export NVM_DIR="$HOME/.nvm"
    then
    [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
    then
    [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"

  3. Download Node and NPM using NVM. It’s simple, run the following command in your terminal:
    nvm install 8.15.1

  4. Set your default Node to version 8. You won’t have to manually type nvm use 8.15.1 every time. Run the following command:
    nvm alias default 8.15.1

  5. Update NPM.
    Run this:
    npm install -g npm@6.4.1

Not yet. We are around halfway there. :slight_smile:

  1. Create an account on GitHub. (You can skip this step if you already have an account)
  2. Download Git here: https://sourceforge.net/projects/git-osx-installer/files/git-2.21.0-intel-universal-mavericks.dmg/download?use_mirror=autoselect
  3. After downloading Git, set your username:
    git config --global user.name "username"
    then confirm it by:
    git config --global user.name
  4. Configure your email address:
    git config --global user.email "email@example.com"
    Confirm your email:
    git config --global user.email
  5. Clone CodeCombat:
    git clone https://github.com/codecombat/codecombat
  6. After cloning, (It takes a while), type in:
    cd codecombat
    then
    npm install
    Note: npm install might take a few minutes so be patient.
  7. To run your server, type:
    cd codecombat
    then
    npm run proxy
    (Optional) Create a new terminal window(Don’t close current one) and type in
    cd codecombat
    then
    npm run webpack -- --watch

Ok fine… Just go to localhost:3000 and see your very own environment in action!
It should look like this:


Those who want to start hacking codecombat, follow this guide:

Please ask for help here:

Update:
There were a few missing steps and easier steps.

  1. Added a new way to download Xcode command line tools(Running xcode-select --install in terminal)
  2. Enhanced step 2.

@Andrew @aliensinthesky,
Am I missing something here?