Programming Club · Great Neck South High School

Chapter 1

Getting started

Three steps take you from nothing installed to the Great Neck South App running on your own phone. Do them in order; each one depends on the last. Nothing here needs an Apple Developer account.

  1. Git and GitHub

    The club’s code lives on GitHub, and Git is the tool that moves it between GitHub and your computer. You need an account on the one and an installation of the other.

    1. Create a free account at github.com. Pick a username you will not mind seeing next to your commits for years.
    2. Install Git from git-scm.com/downloads. On Windows the default installer options are fine. Once it is installed, a terminal command called git exists on your machine.
    3. Tell Git who you are. Every commit is stamped with a name and an email, so set both once, globally, before your first one. GitHub documents the two commands: setting your username in Git and setting your commit email address. Use the same email as your GitHub account so GitHub links the commits to you.
    Listing 1.1 Configuring your identity, once.
    $ git config --global user.name "Your Name"
    $ git config --global user.email "you@example.com"
    $ git config --global --list # prints both back, so you can check
  2. Your editor and toolchain

    An IDE, an integrated development environment, is the program you write code in. It is more than a text editor: it has a terminal built into the window, it compiles your code, and it flags errors as you type instead of after you run. The club uses VS Code.

    1. Install VS Code from code.visualstudio.com/download.
    2. Install Node.js from nodejs.org/en/download. Node runs JavaScript outside a browser and comes with npm, the package manager that installs the app’s dependencies.
    3. Install TypeScript, following typescriptlang.org/download. The app is written in TypeScript, which is JavaScript with types, so your editor can catch a whole class of mistakes before the code runs.
    4. Install the Expo CLI and create an Expo account. Expo’s own guide covers both: Set up your environment, with iOS and a physical device selected. Stop at the point where the guide starts talking about creating a development build; that part is not yours to do.
    Listing 1.2 Checking that the tools are on your path.
    $ git --version
    $ node --version
    $ npm --version
    $ tsc --version

    Each command should print a version number. If one says the command is not found, close and reopen the terminal first; a fresh install is not always visible to a terminal that was already open.

  3. Clone and run the app

    Now you have everything the project needs. Get a copy of it, install its dependencies, and start it.

    1. Open a terminal in the folder where you keep your projects and clone the repository. Git creates a folder called GreatNeckSouthApp-Official containing the whole project and its history.
    2. Open that folder in VS Code (File, then Open Folder), open the integrated terminal, and run npm install. This reads the project’s dependency list and downloads each package into a node_modules folder. It only has to be done once, and again whenever the list changes.
    3. Run npx expo start. Expo starts a development server and prints a QR code in the terminal.
    4. On your iPhone, install Expo Go from the App Store, then scan the QR code with the Camera app. Expo Go opens and loads the Great Neck South App from your computer. Expo’s Start developing page walks through this with pictures. Your phone and computer need to be on the same Wi-Fi network.
    Listing 1.3 From an empty folder to a running app.
    $ git clone https://github.com/GNS-programming-club/GreatNeckSouthApp-Official.git
    $ cd GreatNeckSouthApp-Official
    $ npm install
    $ npx expo start

    Leave npx expo start running while you work. Edit a file, save it, and the app on your phone reloads with the change. When you are done, press Ctrl+C in the terminal to stop the server.

When you are done

You should be able to tick every line below. The ticks are saved in this browser, so you can come back to the list later.

From here, the code itself is the next thing to read. Open the folder in VS Code, find the screen you just saw on your phone, and change something small. The repository on GitHub is where the club’s work comes together.