Table of Contents
Before You Start
For more information about the tools being installed and what they do, see our third party software and services page.
Most steps take place in the Terminal, which is in Applications > Utilities
, or can be found with Spotlight Search. When you run a command and it doesn't end, and you want it to end, use the shortcut Ctrl-C
.
These steps are our recommended approach to setting up CodeCombat's development environment. As long as you cover the General Setup Instructions, you can install these tools however you prefer.
Setup Steps
- Install Xcode.
- Install Xcode Command Line Tools. Open XCode and go through menus
Xcode -> Preferences -> Downloads
. This will install Git and provide the command line tools for building the development environment. - Install Homebrew. This will help install MongoDB, CodeCombat's database.
- Install MongoDB with HomeBrew.
brew install mongodb
. - Install NVM. This will help in installing Node, the server and NPM, the Node package manager. There are multiple ways to install Node, so if you install the latest Stable version some other way, skip down to setting up GitHub.
- Install Node and NPM with NVM. As of writing, we're using Node 5.1.1, so the command is
nvm install 5.1.1
. Check the node version we're using in package.json. - Use Node 5 (Stable) By Default.
nvm alias default 5.1.1
. This way Node 5.1.1 is used for every new terminal. Otherwise you'll need to runnvm use 5.1.1
before running any dev environment commands. - Create an account on GitHub. This is where our code repository is hosted.
- Configure Git to connect with your GitHub account.
- Clone the CodeCombat repository. This will copy our source code and all its history to your computer to be run and modified.
- Install and compile CodeCombat source files. Navigate into the folder where you downloaded the CodeCombat repository and run
npm install
. This will install npm and bower (client library) dependencies, as well as building the public directory, which is what the server... serves. - Add data to MongoDB. See below.
- Run the dev environment.
- Visit http://localhost:3000/ to see your CodeCombat development environment!
Installing the Database
Download the CodeCombat database (updated every 10 minutes) and import it to your locally running database:
- Start MongoDB. From the codecombat folder, run
./bin/coco-mongodb
. You should now be able to, from another terminal, runmongo
and connect. - Uncompress the dump. Open a new terminal and navigate to the folder where you downloaded the dump.tar.gz file and run
tar xzvf [filename]
. This will create adump
folder. - Load the uncompressed dump folder into the database. At a normal command prompt run:
mongorestore --drop [path to dump]
.
Following these same steps will also clear out all old data (including any local data you have created) and replace it with just the new data.
If you see an error like no reachable servers
when running mongorestore, and mongo is running, try adding --host=127.0.0.1
to the command line options.
In version 3.0.7 of mongoDB is a bug in mongorestore. If you see an error like Failed: restore error: [some file name]: error restoring from dump/[some file name]: insertion error: EOF
when running mongorestore, then try adding --batchSize=100
to the command. (try 1000, or 100, or even smaller) see here for a discussion on that
- Home
- Archmage Home
- Artisan Home
- Adventurer Home
- Scribe Home
- Diplomat Home
- Ambassador Home
- Archmage General
- Mission statement
- Coco Models
- Coding Guidelines
- Cookbook
- File system
- JSON Schema
- Technical overview
- Testing
- Third party software and services
- Artisan General
- Building A Level
- Coding Guidelines for Artisans
- Editing Thang Components
- Important Artisan Concepts
- Keyboard Shortcuts
- Artisan How-To Index
- Adventurer General
- Scribe General
- Diplomat General
- i18n
- i18n Glossary nb
- i18n Glossary ru
- i18n Glossary es-419
- Ambassador General
- Dev Setup
- Dev Setup: Linux
- Dev Setup: Windows
- Dev Setup: Mac
- Dev Setup: Vagrant
- Dev Setup: Issues
- Game Engine
- Component
- Multiplayer
- Surface
- System
- Thang
- Thang Component System
- Tome
- World
- Artisan Tabs
- Components And Systems
- Scripts
- Settings
- Thangs
- Other
- Aether
- Client models
- Developer organization
- Educational Standards
- Events, subscriptions, shortcuts
- Chat Room
- Chat Room Rules
- Permissions
- Project Ideas List
- Treema
- Versioning
- Views
CodeCombat | Home | Blog | Forum | Teachers | Legal | Contribute