Setting Up Your Dev Environment

Welcome! This guide takes you from a fresh Mac to a working local copy of Hackley Clubz. You only do this once — after that, day-to-day development is just editing code and pushing to the dev branch.

These instructions assume you’re on a Mac.

1. Create a GitHub account and get access

The source code lives in a private GitHub repository, so you need a GitHub account and an invitation to the repo.

  1. If you don’t already have one, sign up at github.com/signup. Pick a username you’re happy to keep — it will be attached to all of your work.
  2. Send your GitHub username to Lilly and ask to be added as a collaborator on the hackley-clubz repository.
  3. GitHub will email you an invitation. Click Accept invitation — until you do, you won’t be able to see or download the code.

2. Install the developer tools

Open the Terminal app (press Cmd+Space, type “Terminal”, hit Enter) and run these commands one at a time.

First, Apple’s command line tools (this gives you git):

xcode-select --install

Next, Homebrew, the package manager we’ll use to install everything else (skip if you already have it):

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Homebrew prints a couple of “Next steps” commands at the end of its installer — run those too, so that brew works in your terminal.

Now install PHP, MySQL, and the GitHub command line tool:

brew install php mysql gh

Start MySQL so it runs in the background (it will also restart automatically when you reboot):

brew services start mysql

3. Download the source code

Log the GitHub tool into your account (choose GitHub.com, then HTTPS, then Login with a web browser when it asks):

gh auth login

Then clone the repository and switch to the dev branch — the branch where all development happens:

cd ~
gh repo clone FriendlyNeighborhoodHacker/hackley-clubz
cd hackley-clubz
git checkout dev

You now have the full source code in a hackley-clubz folder in your home directory.

4. Set up your local database

The app stores its data in MySQL. Create a database and load the schema:

mysql -u root -e "CREATE DATABASE hackleyclubz DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
mysql -u root hackleyclubz < docs/schema.sql

5. Configure the app

The app reads machine-specific settings from www/config.local.php, which is never committed to git. Create yours from the example:

cp www/config.local.php.example www/config.local.php

Open www/config.local.php in an editor and set the database section to match your local MySQL (a fresh Homebrew MySQL has a root user with no password):

define('DB_USER', 'root');
define('DB_PASS', '');

You can leave everything else in the file alone. (Some features — like Google sign-in, email, and chat — need extra keys to work locally, but you don’t need any of them for your first change.)

6. Run the site locally

PHP has a built-in web server that’s perfect for local development. From the repository folder:

cd www
php -S localhost:8000

Open http://localhost:8000/hello.php in your browser. If you see the current time, congratulations — you are running Hackley Clubz on your own machine. Leave this terminal window running while you develop; press Ctrl+C to stop the server.

7. Download VSCode

We recommend Visual Studio Code as your editor:

  1. Download it from code.visualstudio.com and drag it into your Applications folder.
  2. Open VSCode → File → Open Folder… → choose your hackley-clubz folder.

That’s your whole development setup: VSCode for editing, one terminal running php -S localhost:8000, and your browser for checking your work.

Next step

Head to Your First Change and get your name onto the dev site.