├── 00-README.md ├── 01-macos-setup.md ├── 02-windows-setup.md ├── 03-ubuntu-setup.md ├── 04-google-chrome-setup.md ├── 05-visual-studio-code-setup.md ├── 06-homebrew-setup.md ├── 07-nodejs-setup.md ├── 08-python-setup.md ├── 09-docker-setup.md ├── 10-checking-your-setup.md ├── 11-apple-silicon-mac-addendum.md ├── 12-github-setup.md └── 13-migrating-to-wsl2.md /00-README.md: -------------------------------------------------------------------------------- 1 | # Setting up your computer for App Academy 2 | 3 | In order to be successful in the course, your computer needs to be setup in a 4 | very specific way. If the setup is correct, you will not waste your time 5 | fighting the setup of tools and applications, so you can concentrate on the new 6 | material you are learning. 7 | 8 | First, head to the guide for your particular operating system. This will give 9 | you an overview of anything in particular you should be aware of for your 10 | system. 11 | 12 | From there, you can proceed to the individual sections for installing Google 13 | Chrome, Visual Studio Code, Node.JS, Python, and Docker. 14 | 15 | > Important, if you have an Apple Silicon Mac be sure to read the 16 | > [Apple Silicon Mac Addendum] before you start installing software. 17 | 18 | > **Prepworkers**: If you are working on the "Online Learning and Challenge Modules" 19 | > course, you do not need to install Node.JS, Python, or Docker to complete the 20 | > assessments. If you are working on the "Beta Solo Prep Work" course, you 21 | > need to install Node.JS, but do not need Python or Docker yet. All prepworkers 22 | > must properly configure Git by following the instructions in [Git Setup]. 23 | 24 | - [macOS Setup] 25 | - [Windows Setup] 26 | - [Ubuntu Setup] 27 | 28 | After you have done your OS setup, be sure to check your setup for problems by 29 | reading this: 30 | 31 | [Checking your Setup] 32 | 33 | [Apple Silicon Mac Addendum]: https://github.com/appacademy/practice-for-SETUP-unified-setup/blob/main/11-apple-silicon-mac-addendum.md 34 | [Checking your Setup]: https://github.com/appacademy/practice-for-SETUP-unified-setup/blob/main/10-checking-your-setup.md 35 | [macOS Setup]: https://github.com/appacademy/practice-for-SETUP-unified-setup/blob/main/01-macos-setup.md 36 | [Windows Setup]: https://github.com/appacademy/practice-for-SETUP-unified-setup/blob/main/02-windows-setup.md 37 | [Ubuntu Setup]: https://github.com/appacademy/practice-for-SETUP-unified-setup/blob/main/03-ubuntu-setup.md 38 | [Git Setup]: https://github.com/appacademy/practice-for-SETUP-unified-setup/blob/main/12-github-setup.md -------------------------------------------------------------------------------- /01-macos-setup.md: -------------------------------------------------------------------------------- 1 | # macOS Setup 2 | 3 | ## Requirements 4 | 5 | You need a mac running macOS Mojave or newer to follow these instructions. 6 | 7 | > IMPORTANT If you have a mac with an Apple Silicon chip (M1), please see the 8 | > [Apple Silicon addendum] reading before proceeding with these instructions. 9 | > Not sure what kind of mac you have? You can find this out by going to the 10 | > Apple menu and choosing "About this Mac". If you see "Chip: Apple" then you 11 | > have an Apple Silicon Mac. 12 | 13 | ## What to install 14 | 15 | Install all of these pieces, in order: 16 | 17 | 1. [Google Chrome] 18 | 2. [Visual Studio Code] 19 | 3. [Homebrew] 20 | 4. [Node.JS] 21 | 5. [Python] 22 | 6. [Docker] 23 | 24 | > Note: Even if you have some of the software listed above already installed, it 25 | > is still necessary to read through all of the instructions. You may need to 26 | > upgrade to a new software version, or change some configurations. 27 | 28 | ## Video 29 | 30 | Watch this video walkthrough of the macOS Setup: 31 | 32 | [macOS Setup] 33 | 34 | [Apple Silicon addendum]: 11-apple-silicon-mac-addendum.md 35 | [Google Chrome]: 04-google-chrome-setup.md 36 | [Visual Studio Code]: 05-visual-studio-code-setup.md 37 | [Homebrew]: 06-homebrew-setup.md 38 | [Node.JS]: 07-nodejs-setup.md 39 | [Python]: 08-python-setup.md 40 | [Docker]: 09-docker-setup.md 41 | [macOS Setup]: https://player.vimeo.com/video/489722391 -------------------------------------------------------------------------------- /02-windows-setup.md: -------------------------------------------------------------------------------- 1 | # Windows Setup 2 | 3 | Welcome Windows users! Your operating system comes from a different lineage than 4 | most operating systems. Windows has its roots in MS-DOS and Windows NT, while 5 | macOS and Linux both are "Unix" style operating systems. We will be using the 6 | Unix command line in this course so everyone in class is using the same command 7 | line tools and programs. Windows does not include a unix style system by 8 | default, so we are going to use an add-on piece of Microsoft Technology called 9 | "Windows Subsystem for Linux" (WSL). 10 | 11 | ## WSL 12 | 13 | Windows Subsystem for Linux (WSL) is a Linux Virtual Computer that you run on 14 | your PC. It gives you all the same tools and command line utilities that your 15 | mac and Linux-using classmates use. 16 | 17 | To install WSL you must have a specific version of Windows 10. 18 | 19 | > For x64 systems: Version 1903 or higher, with Build 18362 or higher. 20 | 21 | If you do not have this version or cannot update to this version, please 22 | contact an instructor. 23 | 24 | ## Installing WSL 2 25 | 26 | Future versions of Windows will include an automatic installer for WSL, but 27 | for now you will have to use the manual install instructions: 28 | 29 | [Windows Subsystem for Linux Installation Guide for Windows 10] 30 | 31 | Follow this guide to install WSL 2 and Ubuntu Linux. 32 | 33 | ## Tips for using WSL 34 | 35 | You will launch the Ubuntu terminal when the instructions in our curriculum tell 36 | you to open a Terminal. 37 | 38 | You should always store your code files in your Ubuntu home directory and not in 39 | your Windows users home directory on your C: drive. Many of the tools we use 40 | will perform better and be more stable if the files exist on the Ubuntu 41 | filesystem. 42 | 43 | If you do need to access the files in your Ubuntu home directory from Windows 44 | Explorer you can type `Windows + R` to bring up the run command dialog and type 45 | `\\wsl$\home\` replacing `your-user` with your Ubuntu user name (you 46 | can find this out by typing `whoami` at your Ubuntu terminal prompt.) 47 | 48 | If you want to access your Windows hard drive from Ubuntu you can use the path 49 | `/mnt/c` inside of the Ubuntu virtual machine. 50 | 51 | If you ever need to restart the Ubuntu virtual machine, you need to open a 52 | Powershell window and run the following command: 53 | 54 | ```shell 55 | wsl --shutdown 56 | ``` 57 | 58 | Next time you open the Ubuntu terminal it will start the virtual machine back 59 | up. 60 | 61 | ## Install everything else 62 | 63 | Now that you have WSL installed you can install all the rest of these tools in 64 | this order: 65 | 66 | 1. [Google Chrome] 67 | 2. [Visual Studio Code] 68 | 3. [Node.JS] 69 | 4. [Python] 70 | 5. [Docker] 71 | 72 | > Note: Even if you have some of the software listed above already installed, it 73 | > is still necessary to read through all of the instructions. You may need to 74 | > upgrade to a new software version, or change some configurations. 75 | 76 | ## Video 77 | 78 | Watch this video walkthrough of the Windows 10 Setup 79 | 80 | [Windows 10 Setup] 81 | 82 | 83 | [Windows Subsystem for Linux Installation Guide for Windows 10]: https://docs.microsoft.com/en-us/windows/wsl/install-win10#manual-installation-steps 84 | [Google Chrome]: 04-google-chrome-setup.md 85 | [Visual Studio Code]: 05-visual-studio-code-setup.md 86 | [Node.JS]: 07-nodejs-setup.md 87 | [Python]: 08-python-setup.md 88 | [Docker]: 09-docker-setup.md 89 | [Windows 10 Setup]: https://player.vimeo.com/video/489725118 -------------------------------------------------------------------------------- /03-ubuntu-setup.md: -------------------------------------------------------------------------------- 1 | # Ubuntu Setup 2 | 3 | ## Requirements 4 | 5 | You must be running the latest LTS release of Ubuntu which is 20.04. 6 | 7 | ## What to install 8 | 9 | Install these pieces in this order: 10 | 11 | 1. [Google Chrome] 12 | 2. [Visual Studio Code] 13 | 3. [Node.JS] 14 | 4. [Python] 15 | 5. [Docker] 16 | 17 | > Note: Even if you have some of the software listed above already installed, it 18 | > is still necessary to read through all of the instructions. You may need to 19 | > upgrade to a new software version, or change some configurations. 20 | 21 | [Google Chrome]: 04-google-chrome-setup.md 22 | [Visual Studio Code]: 05-visual-studio-code-setup.md 23 | [Node.JS]: 07-nodejs-setup.md 24 | [Python]: 08-python-setup.md 25 | [Docker]: 09-docker-setup.md -------------------------------------------------------------------------------- /04-google-chrome-setup.md: -------------------------------------------------------------------------------- 1 | 2 | # Installing Google Chrome 3 | 4 | Here at App Academy, our browser of choice is Google Chrome. This isn't super 5 | important at the beginning of the course, but once we get into frontend 6 | development (writing code that runs in a web browser) the Chrome DevTools will 7 | be crucial for debugging every manner of issue. Other browsers do include 8 | DevTools, but they may work slightly differently than the ones in Google Chrome. 9 | 10 | If you want to follow along with instructors and our curriculum you will want 11 | to make sure you install Google Chrome or it's open source equivalent, Chromium. 12 | 13 | To install Google Chrome, download the necessary files and follow the 14 | instructions on the [Google Chrome website][chrome-dl]. 15 | 16 | ## macOS 17 | 18 | macOS users should just download the Google Chrome DMG (Disk image) file and 19 | double click on it to mount it as a drive. Then drag the Chrome icon to your 20 | Applications Folder, then you can eject the Google Chrome Disk Image by dragging 21 | it to the Trash. 22 | 23 | ## Windows 24 | 25 | Windows users should run the downloaded Chrome installer application, and 26 | follow the instructions. 27 | 28 | ## Ubuntu 29 | 30 | Ubuntu users should download the .deb version of Google Chrome and double click 31 | on it from the Downloads folder in the file manager. 32 | 33 | [chrome-dl]: https://www.google.com/chrome/browser/desktop/index.html -------------------------------------------------------------------------------- /05-visual-studio-code-setup.md: -------------------------------------------------------------------------------- 1 | # Visual Studio Code 2 | 3 | Our code editor of choice in this course is Microsoft's Visual Studio Code. 4 | 5 | This is an open source cross-platform code editor built with Javascript. 6 | Don't confuse this with Microsoft's other product _Visual Studio_ which is 7 | designed to only program for the Windows platform. Visual Studio Code (or 8 | VSCode) is a multi-language editor that can handle almost any programming 9 | language for any platform. 10 | 11 | Go to website for [Visual Studio Code][vs-code], then 12 | download and install VS Code. 13 | 14 | You'll want to make sure you download the Stable release. 15 | 16 | ## macOS 17 | 18 | Download the DMG (Disk Image) file for VSCode and open it up. This will mount as 19 | virtual 'disk' on your desktop. Drag the VSCode icon to your Applications folder 20 | and then eject the virtual disk on the Desktop by dragging it to the Trash. 21 | 22 | In macOS, the command line utility `code` isn't installed by default when you 23 | install VSCode. 24 | 25 | Open the VS Code editor, open the Command Palette (`Cmd+Shift+P`) and type 26 | type `shell command` to find the `Shell Command: Install 'code' command in PATH` 27 | command. 28 | 29 | This will now allow you to easily open files in VS Code from the terminal using 30 | the `code` command followed by a file or directory. 31 | 32 | ## Windows 33 | 34 | In Windows we will be using VSCode alongside WSL (Windows Subsystem for Linux). 35 | 36 | In order to do this, we must make sure we install this VSCode extension: 37 | 38 | [Remote: WSL by Microsoft][wsl-extension] 39 | 40 | Once you've installed this you can open VSCode and connect to your WSL instance. 41 | 42 | Make sure you read this tutorial from Microsoft on how to use WSL and VSCode together: 43 | 44 | [Remote Development in WSL] 45 | 46 | ## Ubuntu 47 | 48 | To install VSCode in Ubuntu Linux, download the 64-bit .deb file to your 49 | Downloads folder, the open that folder in your File Manager and double click on 50 | it to install it. 51 | 52 | [wsl-extension]:https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl 53 | [vs-code]:https://code.visualstudio.com/ 54 | [Remote Development in WSL]: https://code.visualstudio.com/docs/remote/wsl-tutorial -------------------------------------------------------------------------------- /06-homebrew-setup.md: -------------------------------------------------------------------------------- 1 | # Homebrew 2 | 3 | **For Mac Only** 4 | 5 | Homebrew is a piece of software for macOS that lets you install extra unix 6 | software on your Mac. 7 | 8 | Head to the [homebrew] website at http://brew.sh and follow the instructions on 9 | the main page. 10 | 11 | You will see instructions to run a command like this, so open a Terminal and run this: 12 | 13 | ```shell 14 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 15 | ``` 16 | 17 | After some output it should print out that homebrew is installed successfully. 18 | 19 | You can always check homebrew for possible problems by typing this: 20 | 21 | ```shell 22 | brew doctor 23 | ``` 24 | 25 | [homebrew]: http://brew.sh -------------------------------------------------------------------------------- /07-nodejs-setup.md: -------------------------------------------------------------------------------- 1 | # Installing Node.JS 2 | 3 | Node.JS is Javascript Runtime Environment for running JavaScript files directly 4 | on a computer. JavaScript is built into every web browser, but if you want 5 | to run JavaScript directly without a browser, you need to install Node.JS. 6 | 7 | > NOTE: We do not install Node.JS using the installer provided at the Node.JS 8 | > website in this class. If you have this one installed, please uninstall it 9 | > before proceeding with these instructions. 10 | 11 | 12 | ## Node Version Manager (nvm) 13 | 14 | Often as a developer, you will need to juggle multiple projects on our computer, 15 | each running a different version of Node.JS. Because of this, just installing a 16 | new version from the Node.JS website would be difficult and error-prone. 17 | 18 | Luckily, there's a piece of open source software that can help called Node 19 | Version Manager, or `nvm`. 20 | 21 | To install nvm, check out the `nvm` github page here: 22 | 23 | [nvm Github Page] 24 | 25 | Below the code, there is a README section. Usually when installing software 26 | from github you'll want to check the README for instructions. If you scroll 27 | down you'll see instructions for how to install nvm. In this case we can run 28 | a special command with `curl` to download and install nvm from the terminal. 29 | 30 | So open a Terminal and use the curl command listed in the README. It should 31 | look something like this, although the version number in the URL might vary: 32 | 33 | ```shell 34 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash 35 | ``` 36 | 37 | When you do this you'll see something like this: 38 | 39 | ```shell 40 | % Total % Received % Xferd Average Speed Time Time Time Current 41 | Dload Upload Total Spent Left Speed 42 | 100 13527 100 13527 0 0 49731 0 --:--:-- --:--:-- --:--:-- 49915 43 | => Downloading nvm from git to '/home/your-user/.nvm' 44 | => Cloning into '/home/your-user/.nvm'... 45 | remote: Enumerating objects: 333, done. 46 | remote: Counting objects: 100% (333/333), done. 47 | remote: Compressing objects: 100% (283/283), done. 48 | remote: Total 333 (delta 38), reused 150 (delta 25), pack-reused 0 49 | Receiving objects: 100% (333/333), 177.16 KiB | 1.46 MiB/s, done. 50 | Resolving deltas: 100% (38/38), done. 51 | => Compressing and cleaning up git repository 52 | 53 | => Appending nvm source string to /home/your-user/.bashrc 54 | => Appending bash_completion source string to /home/your-user/.bashrc 55 | => Close and reopen your terminal to start using nvm or run the following to use it now: 56 | 57 | export NVM_DIR="$HOME/.nvm" 58 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm 59 | [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion 60 | ``` 61 | 62 | The lines to pay attention to are the last three. These are the shell commands 63 | necessary to initialize nvm. But we don't want to have to run these commands 64 | everytime we open a terminal, so we should put these into our _shell startup file_ 65 | 66 | The general rule on this is: 67 | 68 | If your shell is `zsh`, use `~/.zshrc` 69 | If your shell is `bash`, use `~/.bashrc` 70 | 71 | > You can determine which shell you have by typing `echo $SHELL` at the command 72 | > line 73 | 74 | You'll notice, in the example above, the nvm installer automatically added the 75 | lines to the `~/.bashrc` even though the example runs zsh. You need to verify 76 | that the lines were correctly added to your startup file. Don't trust the 77 | installer to always do the right thing in this case. Everyone's system is 78 | different. 79 | 80 | To verify it, open up your startup file in vscode with the `code` command. Use 81 | the appropriate startup filename depending on which shell you have (`~/.zshrc` 82 | or `~/.bashrc`). 83 | 84 | ```shell 85 | code ~/.zshrc 86 | ``` 87 | 88 | If you do not see the nvm startup lines in your file already, add them in there. 89 | 90 | There are two ways to run your startup file. You can run it live in your current 91 | shell by typing the `source` command and following it with your startup file, or 92 | an even easier option is to just close your terminal window and open it back up. 93 | 94 | Once you have done these steps, run `nvm` by itself at the command prompt. You 95 | should see the help messages from nvm. If this doesn't work, double check your 96 | shell startup files. 97 | 98 | ## Installing Node.JS 99 | 100 | Now that you have nvm installed and ready to go, you can use it to install a 101 | particular version of Node.JS. 102 | 103 | Currently in this course, you will use version 16. While 14 and 12 should work 104 | as well, they are missing newer language features that you may like to use. 105 | 106 | > NOTE: Only stick to LTS versions of Node.JS. This stands for Long Term Support. 107 | > These are the stable versions of Node.JS. The odd-numbered releases such as 15 108 | > are experimental releases, and should not be used for anything important. They 109 | > are a way for people to test new releases of Node.JS, not something you should 110 | > rely on for your code. 111 | 112 | So let's install it! 113 | 114 | ```shell 115 | nvm install 16 116 | ``` 117 | 118 | You should see something like this: 119 | 120 | ```shell 121 | Downloading and installing node v16.14.0... 122 | Downloading https://nodejs.org/dist/v16.14.0/node-v16.14.0-darwin-arm64.tar.xz... 123 | ######################################################################### 100.0% 124 | Computing checksum with shasum -a 256 125 | Checksums matched! 126 | Now using node v16.14.0 (npm v8.3.1) 127 | Creating default alias: default -> 16 (-> v16.14.0) 128 | ``` 129 | 130 | You'll notice we can just provide `16` here and not any specific version of 131 | Node.JS like `16.14.0`. nvm is good like that, it will automatically install 132 | the latest version of `16`. 133 | 134 | Once this is complete, you should be able to type 135 | 136 | ```shell 137 | node --version 138 | ``` 139 | 140 | and it should print out the correct version of Node.JS. 141 | 142 | You can verify that the Node.JS you installed is coming from your `nvm` 143 | setup, by using this shell command: 144 | 145 | ```shell 146 | which node 147 | ``` 148 | 149 | If it prints out a path with .nvm in it, then you've done it correctly! 150 | 151 | ```shell 152 | /home/<>/.nvm/versions/node/v16.14.0/bin/node 153 | ``` 154 | 155 | Congratulations you've just installed Node.JS! 156 | 157 | ## Mocha - One last step 158 | 159 | You will use a tool called Mocha for testing your Javascript code. You will use 160 | it to test in your projects and also when you do assessments. 161 | 162 | To install it, use the `npm` command. 163 | 164 | > NOTE: DO NOT confuse `npm` with `nvm`. They are different tools. `nvm` 165 | > controls the version of Node.JS you have installed, while `npm` is responsible 166 | > for installing Node Packages which are third party pieces of software written 167 | > in JavaScript. 168 | 169 | To install mocha, do this: 170 | 171 | ```shell 172 | npm install -g mocha 173 | ``` 174 | 175 | The `-g` is called a flag. This changes the behavior of the install command. 176 | 177 | In this case it means `global`. By default, `npm` will install files into your 178 | project directory. We want mocha to be installed for all projects, so we 179 | specify `-g`. 180 | 181 | You can verify mocha works by typing 182 | 183 | `mocha --version` 184 | 185 | If it prints out a version number, pay yourself on the back, you have 186 | successfully installed Node.JS and Mocha! 187 | 188 | [nvm Github Page]: https://github.com/nvm-sh/nvm -------------------------------------------------------------------------------- /08-python-setup.md: -------------------------------------------------------------------------------- 1 | # Python Installation Instructions 2 | 3 | Python is the second programming language you will use in this course. 4 | 5 | > Note: We do not install Python using the installer from the python.org website 6 | > in this course. If you have one installed, you should uninstall it before 7 | > installing this version of python. 8 | 9 | Currently the curriclum for this course is compatible with Python 3.9. 10 | 11 | ## Installing pyenv 12 | 13 | The first thing you need is to install the Python version manager ([pyenv]). 14 | This is similar to the `nvm` tool you used to install Node.JS, except it 15 | controls what versions of python you use on your system. 16 | 17 | To install pyenv we use the [pyenv-installer]. 18 | 19 | From the installation instructions on the [pyenv-installer] website, it says to 20 | run the following command: 21 | 22 | ```shell 23 | curl https://pyenv.run | bash 24 | ``` 25 | 26 | Unlike `nvm`, `pyenv` does not automatically add it's startup lines to your 27 | shell startup file. 28 | 29 | The files that you have to change will depend on which shell you are running 30 | (you can check which shell you have by running `echo $SHELL`). Follow the 31 | instructions to update the startup files associated with the shell that you are 32 | running. 33 | 34 | ### If your shell is `zsh` 35 | 36 | 1. Open your `.zshrc` with the following command 37 | ```shell 38 | code ~/.zshrc 39 | ``` 40 | 41 | 2. Add the following lines. 42 | ```shell 43 | export PYENV_ROOT="$HOME/.pyenv" 44 | export PATH="$PYENV_ROOT/bin:$PATH" 45 | eval "$(pyenv init -)" 46 | eval "$(pyenv init --path)" 47 | ``` 48 | 49 | ### If your shell is `bash` 50 | 51 | 1. Open your `.bashrc` with the following command 52 | ```shell 53 | code ~/.bashrc 54 | ``` 55 | 56 | 2. Add the following lines. 57 | ```shell 58 | export PYENV_ROOT="$HOME/.pyenv" 59 | export PATH="$PYENV_ROOT/bin:$PATH" 60 | eval "$(pyenv init -)" 61 | eval "$(pyenv init --path)" 62 | ``` 63 | 64 | To get your startup file to execute, restart your terminal. 65 | 66 | ## Installing dependencies on Windows and Ubuntu 67 | 68 | *If you use macOS you can skip this step.* 69 | 70 | For Windows and Ubuntu users you will need to install some extra dependencies 71 | for python. (See here for more information about the prerequisites: [pyenv Prerequities]) 72 | 73 | First, run this command to update your apt repositories: 74 | 75 | ```shell 76 | sudo apt update 77 | ``` 78 | 79 | Then, run this command to install the packages listed on the pyenv. 80 | 81 | ```shell 82 | sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \ 83 | libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ 84 | xz-utils tk-dev libffi-dev liblzma-dev python3-openssl git 85 | ``` 86 | 87 | ## Apple Silicon ONLY: Install openssl and readline 88 | 89 | If you are using an M1 (silicon) mac, you need to install homebrew ARM versions of `openssl` and `readline`. All other users can skip this step. 90 | 91 | ```shell 92 | brew install openssl readline 93 | ``` 94 | 95 | ## Installing python itself 96 | 97 | Now, you are ready to install python. You will be installing Python version 98 | 3.9.4. 99 | 100 | Run this command to install python (you'll notice `pyenv` makes you put in the 101 | _exact_ version instead of being able to just say `3.9` or `3`). 102 | 103 | ```shell 104 | pyenv install 3.9.4 105 | ``` 106 | 107 | After some time, this should complete without any errors. It could take a while 108 | since you are compiling python from source code. 109 | 110 | Once this is finished, you also need to tell `pyenv` that this is our default 111 | version of python using this command: 112 | 113 | ```shell 114 | pyenv global 3.9.4 115 | ``` 116 | 117 | Ensure that these changes take effect by closing your terminal and opening 118 | a new one. Then, verify your python is the correct version by typing: 119 | 120 | ```shell 121 | python --version 122 | python3 --version 123 | ``` 124 | 125 | Both of these commands should show 3.9.4. 126 | 127 | ## Pipenv 128 | 129 | Another piece of software you will use in class is Pipenv. 130 | 131 | ```shell 132 | pip install pipenv 133 | ``` 134 | 135 | After you have installed pipenv, add this line to your shell startup 136 | file (either your `.bashrc` or your `.zshrc`) somewhere after 137 | the `eval "$(pyenv init --path)"`: 138 | 139 | ```shell 140 | export PIPENV_VENV_IN_PROJECT=1 141 | ``` 142 | 143 | Congratulations! If you've completed all these steps you are ready to code in 144 | Python! 145 | 146 | [pyenv-installer]:https://github.com/pyenv/pyenv-installer 147 | [pyenv]: https://github.com/pyenv/pyenv 148 | [pyenv Prerequities]: https://github.com/pyenv/pyenv/wiki/Common-build-problems 149 | -------------------------------------------------------------------------------- /09-docker-setup.md: -------------------------------------------------------------------------------- 1 | # Docker Setup 2 | 3 | You won't use Docker until much later in the course, but it is required to be installed. 4 | 5 | ## macOS and Windows 6 | 7 | Just visit [docker.com] and download and install the latest 8 | version of Docker Desktop. Docker for Windows requires WSL 2 to be already 9 | configured and working. 10 | 11 | ## Ubuntu Linux 12 | 13 | Installing Docker on Ubuntu Linux is a little more involved, as there isn't a 14 | download on the main docker page. Docker does have an easy-to-use 15 | convenience script that will install docker for you using curl. 16 | 17 | You can read [Install using the convenience-script] for more info about this. 18 | 19 | But it involves running these commands: 20 | 21 | ```shell 22 | curl -fsSL https://get.docker.com -o get-docker.sh 23 | sudo sh get-docker.sh 24 | ``` 25 | 26 | Then, in order for you to be able to run the docker commands without using `sudo` 27 | you should run this command, replacing `your-user` with your linux user name. Remember, you can type `whoami` to find out what this is. 28 | 29 | ```shell 30 | sudo usermod -aG docker your-user 31 | ``` 32 | 33 | [docker.com]: https://docker.com 34 | [Install using the convenience-script]: https://docs.docker.com/engine/install/ubuntu/#install-using-the-convenience-script -------------------------------------------------------------------------------- /10-checking-your-setup.md: -------------------------------------------------------------------------------- 1 | # Checking your Setup 2 | 3 | > **Prepworkers**: If you are working on the "Online Learning and Challenge 4 | > Modules" course, you do not need to install Node.JS, Python, or Docker to complete 5 | > the assessments. Therefore, you can ignore setup-checker messages for 6 | > those programs until you enroll in the course. If you are working on the 7 | > "[Beta] Solo Prep Work" course, you can ignore any Python or Docker issues 8 | > until you enroll in the course. 9 | 10 | It can be difficult to know if you've followed all the steps correctly. There 11 | are so many things that can go wrong, and everyone's computer is different. To 12 | help with this problem, AppAcademy has created a script that checks your setup 13 | to verify it is done correctly and is ready for the SWE Online program. 14 | 15 | To run this script, simply open a terminal and run this command: 16 | 17 | ```shell 18 | curl -s https://raw.githubusercontent.com/appacademy/aa-setup-checker/master/run.sh | bash 19 | ``` 20 | 21 | This command will download a script from our github page and if your setup is correct 22 | you should see output like this: 23 | 24 | ```shell 25 | ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― 26 | Checking macOS 27 | ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― 28 | macOS Version: 11.0.1 29 | ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― 30 | Checking Shell 31 | ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― 32 | Shell: /bin/zsh 33 | Shell Startup File: /Users/echo/.zshrc 34 | ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― 35 | Checking Node.JS 36 | ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― 37 | Node Binary: /Users/echo/.nvm/versions/node/v12.18.4/bin/node 38 | Node Version: v12.18.4 39 | NPM Binary: /Users/echo/.nvm/versions/node/v12.18.4/bin/npm 40 | NPM Version: 6.14.6 41 | Mocha Binary: /Users/echo/.nvm/versions/node/v12.18.4/bin/mocha 42 | Mocha Version: 8.1.3 43 | Node.JS is OK 44 | ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― 45 | Checking VSCode 46 | ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― 47 | Code Binary: /usr/local/bin/code 48 | Version: 1.49.0 49 | VSCode is OK 50 | ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― 51 | Checking Python 52 | ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― 53 | pyenv version: pyenv 1.2.21 54 | Python Binary: /Users/echo/.pyenv/shims/python 55 | Python3 Binary: /Users/echo/.pyenv/shims/python3 56 | Python Version: 3.8.6 57 | pipenv Binary: /Users/echo/.pyenv/shims/pipenv 58 | pipenv Version: pipenv, version 2020.8.13 59 | Python OK 60 | ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― 61 | Checking Docker 62 | ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― 63 | Docker Binary: /usr/local/bin/docker 64 | Docker Version: Docker version 19.03.13, build 4484c46d9d 65 | Docker is OK 66 | ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― 67 | Congratulations, you have everything installed properly! 68 | ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― 69 | ``` 70 | 71 | If you get the Congratulations message you'll know you have everything setup 72 | properly. The script tries to tell you what steps you should probably take 73 | if some piece fails. 74 | 75 | If you get a failure and don't know how to fix it, feel free to post your output 76 | in Slack or to ask an instructor for help. -------------------------------------------------------------------------------- /11-apple-silicon-mac-addendum.md: -------------------------------------------------------------------------------- 1 | # Apple Silicon Macs and Software Development 2 | 3 | > NOTE: This document may change often. As new software gets updated for Apple 4 | > Silicon this document will be ever-evolving. 5 | 6 | In November 2020, Apple released their first Macintosh computers running custom 7 | Apple designed CPUs instead of using the Intel CPUs they had used in the prior 8 | decade. These CPUs run an architecture called ARM (Acorn Risc Machine). 9 | 10 | ## What is an architecture? 11 | 12 | At the lowest level, the CPU (Central Processing Unit) of a computer uses 13 | something called an _instruction set_ to actually do the work of running 14 | programs. 15 | 16 | In this course we learn JavaScript and Python which are both _high-level 17 | languages_. 18 | 19 | So, does that mean we don't have to worry about the instruction set of our CPUs? 20 | 21 | Not directly, but since we've had more than a decade of Apple computers using 22 | the Intel x86 instruction set (sometimes abbreviated x86, x64, x86_64 or i386), 23 | much of the software we use hasn't been _compiled_ for the new Apple Silicon 24 | architecture called ARM (Acorn Risc Machines, sometimes abbreviated as arm64). 25 | 26 | Your Apple Silicon based Mac has a piece of software called Rosetta 2 that will translate x86 instuctions into ARM instructions. This is mostly transparent, although the software does run with about 70% of the performance of software compiled directly for ARM. 27 | 28 | __Luckily as of March 2021, we don't have to use Rosetta 2 for most of our development tools.__ 29 | 30 | ## A Note on Universal Apps 31 | 32 | Some apps are 'universal' on macOS. This means they've been compiled for BOTH 33 | Intel and ARM architectures, and the file for the app contains BOTH sets of 34 | instructions. An example of this is the zsh shell. You can use the `file` 35 | command in macOS to determine if an apple is intel, arm or universal. 36 | 37 | ```shell 38 | file /bin/zsh 39 | /bin/zsh: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e] 40 | /bin/zsh (for architecture x86_64): Mach-O 64-bit executable x86_64 41 | /bin/zsh (for architecture arm64e): Mach-O 64-bit executable arm64e 42 | ``` 43 | 44 | You can see zsh is universal since it lists both x86_64 and arm64e 45 | architectures. 46 | 47 | ## What this means for developers 48 | 49 | Whenever we compile software from the command prompt, that software must be 50 | turned into _machine code_ for whatever processor our computer has. Since macOS 51 | can run both x86 programs and ARM programs, we need a way to tell our computer 52 | we would like to run things in Rosetta or not from the command line. 53 | 54 | MacOS ships with a command to do just that, the `arch` command. 55 | 56 | You can run it at anytime and it will print out the current architecture of 57 | your shell. 58 | 59 | ```shell 60 | > arch 61 | arm64 62 | ``` 63 | 64 | If it prints `arm64` you are running natively on Apple Silicon. If it prints out 65 | `i386` you are running under Rosetta 2. 66 | 67 | You can also preface any command with `arch` to force it to run under any 68 | particular architecture. For instance if we would like to run our shell `zsh` 69 | under Rosetta 2 we can do this: 70 | 71 | ```shell 72 | arch -x86_64 zsh 73 | ``` 74 | 75 | This starts a brand new shell that is running in Rosetta 2. If you use the 76 | `arch` command by itself now, you'll see it prints out `i386`. 77 | 78 | This is handy for when we want to run something in Rosetta 2. 79 | 80 | However, as of March 2021, several improvments have been made to how homebrew, 81 | node and python work on Apple Silicon machines, and it is possible to install 82 | them as native ARM compiled binaries so we won't need to use Rosetta 2 much for 83 | our development. 84 | 85 | ### Homebrew for ARM 86 | 87 | If you run the homebrew installer on an M1 Mac. Homebrew will install the ARM 88 | version of homebrew into the `/opt/homebrew` folder instead of the usual 89 | `/usr/local` folder used on Intel macs. So, you can follow the normal 90 | instructions for setting up Homebrew on macOS. 91 | 92 | ### Python 3.9 and ARM 93 | 94 | Python 3.9 will compile under ARM, so we mostly use the regular macOS instructions 95 | to install it, however Python 3.9 needs homebrew ARM versions of `openssl` and `readline` installed. This step is included in the Python setup directions. 96 | 97 | You can check what architecture your python is compiled with by running 98 | this at the python REPL once Python is installed. 99 | 100 | ```python 101 | >>> import platform 102 | >>> platform.machine() 103 | 'arm64' 104 | ``` 105 | 106 | ### Node.JS and ARM 107 | 108 | Node.JS 12 and 14 have been updated to compile correctly on Apple Silicon. Node 109 | 16 also compiles correctly on Apple Silicon. 110 | 111 | You can verify what architecture your node is compiled for by starting the Node.JS REPL and typing the following: 112 | 113 | ```js 114 | > os.arch(); 115 | 'arm64' 116 | ``` 117 | 118 | ## Google Chrome 119 | 120 | Google Chrome already has an Apple Silicon version of itself. You should 121 | definitely install this version when downloading Chrome. 122 | 123 | ### __Recommendation:__ Install the Apple Chip version of Chrome 124 | 125 | ## Visual Studio Code 126 | 127 | Visual Studio Code is available compiled as either Intel, Apple Silicon or as a Universal App. 128 | 129 | You can install either the Apple Silicon or Universal Version and it will work 130 | well on your Apple Silicon based Mac. 131 | 132 | ### __Recomendation:__ Install the Apple Silicon or Universal Version 133 | 134 | ### Docker 135 | 136 | Docker is generally available for Apple Silicon. You can install it by downloading docker desktop from this location: 137 | 138 | [Docker Desktop for M1] 139 | 140 | ### __Recommendation:__ Install the Docker Desktop for Mac with Apple Chip 141 | 142 | [Docker Desktop for M1]: https://www.docker.com/products/docker-desktop -------------------------------------------------------------------------------- /12-github-setup.md: -------------------------------------------------------------------------------- 1 | # GitHub Setup 2 | 3 | ## Getting Started with git 4 | 5 | ### What is git? 6 | 7 | > Git is a free and open source distributed version control system designed to 8 | > handle everything from small to very large projects with speed and efficiency. 9 | 10 | git is a software program much like *MS Word* or *Google Chrome* but it is part 11 | of a class of programs known as **cli tools**. This program does not have a user 12 | interface (UI) like most programs we are familiar with, but instead is 13 | accessible primarily through our **command line** / **terminal**. 14 | 15 | Being accessible primarily only through the **command line**/**terminal** sounds 16 | like a huge restriction, but it allows us as developers to use it for what it's 17 | good at and for it to then quickly go away. 18 | 19 | So what does git do? Well it is a *Version Control System* or **VCS**. It keeps 20 | track of a set of files over time. 21 | 22 | Each time changes need to get recorded, they are wrapped in a 'commit' and that 23 | commit is saved to the repository (or repo) as a snapshot of the files at that 24 | time. The tracking and reconciling abilities that git has to handle conflicts 25 | makes git an effective tool for many developers to work on the same codebase at 26 | the same time, as well as to record the history of a project in case an issue is 27 | introduced. 28 | 29 | ### What is GitHub? 30 | 31 | Github is a company that provides hosting for git repositories. It works 32 | together with the git cli tools to manage the codebase by making or deleting 33 | branches, creating pull requests, and sharing the git project with other 34 | developers. 35 | 36 | --- 37 | 38 | ## Installing git 39 | 40 | ### Windows 41 | 42 | If you have WSL already setup and are using an Ubuntu distribution, you already 43 | have git within linux! If you are using a different distribution you may need to 44 | manually install git. 45 | 46 | While you don't need git installed in Windows, you do need to have the 47 | git-credential-manager-core installed. It comes bundled with git so you can 48 | easily install it in Windows by using the installer found [here][git-win]. 49 | 50 | Once you've downloaded one of the "Git for Windows Setup" distributions (either 51 | 32-bit or more likely 64-bit) you can launch the installer and accept all the 52 | defaults. 53 | 54 | Now that git-credential-manager-core is installed, you can restart your terminal 55 | and continue on working through this guide. 56 | 57 | ### Mac 58 | 59 | Mac comes with some tools by default. git is one that you want to make sure is up 60 | to date so you can run the following in your terminal. 61 | 62 | ```shell 63 | xcode-select --install 64 | ``` 65 | 66 | ## Configuring git 67 | 68 | Once you have installed git, configure the information that gets logged for each 69 | of your commits by updating the default (global) credentials that git uses. (You 70 | could overwrite these credentials temporarily per local repo. While that 71 | shouldn't be necessary when working on App Academy projects, it is helpful to 72 | know that it is an option.) You will also want to set the default branch to 73 | `main`. 74 | 75 | In your terminal (on Mac or WSL), run 76 | 77 | ```shell 78 | git config --global user.name "Your Name" 79 | git config --global user.email "Your Email" 80 | git config --global init.defaultBranch main 81 | ``` 82 | 83 | Check that your name and email have been set up correctly by using the following commands: 84 | 85 | ```shell 86 | git config user.name 87 | git config user.email 88 | ``` 89 | 90 | You should see your name and email address returned. Repeat this step if there 91 | are any errors. 92 | 93 | ## Configuring GitHub 94 | 95 | As previously mentioned, GitHub provides a mechanism to share code with other 96 | developers. Because of the nature of code, there needs to be a way to 97 | authenticate to make sure that someone is authorized to fetch or contribute new 98 | code. 99 | 100 | Thankfully, git handles this authentication flow automatically. But for GitHub, 101 | you can't use your GitHub account password. Instead, you can use a Personal 102 | Access Token (PAT) or an SSH key as a password to authenticate to Github and 103 | save it in a password manager of sorts so you don't have to use the token with 104 | every command that requires authentication. 105 | 106 | __If you have _never_ configured GitHub before, follow the instructions below to 107 | set up your Secrets Manager and Personal Access Token. This is the recommended 108 | approach for App Academy.__ 109 | 110 | If you are already using the SSH approach, then no need to follow the 111 | instructions below! You can reference this [SSH article] instead for 112 | troubleshooting your setup if needed. 113 | 114 | ### Secrets Manager 115 | 116 | Before you get a PAT from Github and use it for auth - you should setup your 117 | Secrets Manager. 118 | 119 | #### Windows 120 | 121 | WSL doesn't have a password manager by default in most distributions so you would 122 | need to install one if you don't want your token saved in plain text or only 123 | temporarily in memory. Thankfully, you can actually tell git to use Windows 124 | Credential Manager. Just run the following command in WSL: 125 | 126 | ```shell 127 | git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager-core.exe" 128 | ``` 129 | 130 | You now have WSL trying to use the git-credential-manager-core to facilitate your 131 | credentials management. 132 | 133 | #### Mac 134 | 135 | MacOS has a built in password/secret manager called keychain. You can tell git 136 | to use keychain with the following line in your terminal: 137 | 138 | ```shell 139 | git config --global credential.helper osxkeychain 140 | ``` 141 | 142 | ### Personal Access Token 143 | Once your secret manager is setup, you want to **restart your terminal/WSL 144 | Shell**. Once restarted, you want to do two things. Generate a token from 145 | Github, and use that as your authentication for a privileged command. 146 | 147 | 1. To get a new token, navigate to [Personal access tokens][PAT] in Github 148 | settings. You can navigate there yourself by going to `settings > Developer 149 | settings > Personal Access Tokens`. 150 | 151 | 2. Once here, click **Generate new token**. 152 | 153 | 3. Give your token a descriptive name. You can name it for the device you will 154 | use the token from. This way, each computer can have their own unique token 155 | and if you ever need to, you can revoke a token. You also want to use this 156 | menu to set when your token expires and give it the allowed permissions. For 157 | your purposes, you want to at least have all the repo permissions. 158 | 159 | > Once you have your token ready to generate, you should try running a 160 | > privileged command in git so you get a password prompt. Once you click 161 | > **Generate token** at the bottom of the *new token form* you will only be able 162 | > to see the token once. 163 | 164 | 4. Now that you have your token, you can use it when git prompts you for a 165 | password. If you are on Windows, you won't receive a password prompt but 166 | instead you will receive a pop-up that asks for you Personal Access Token. 167 | Because you previously configured your password/secret manager, your input 168 | will be saved for you. This way, you don't need to keep track of your PAT. 169 | 170 | [git-win]: https://git-scm.com/download/win 171 | [PAT]: https://github.com/settings/tokens 172 | [SSH article]: https://hackmd.io/@AgDXdHgSSPKsJIhCxlaTuA/BJtNu88fF -------------------------------------------------------------------------------- /13-migrating-to-wsl2.md: -------------------------------------------------------------------------------- 1 | # Migrating from WSL1 to WSL2 2 | 3 | Follow these insttructions if your Windows device is currently set up with WSL1. You will need to use WSL2 for the course. 4 | 5 | > **Note:** There is a WSL Runtime that is distributed through the Windows 6 | > Store. This is still in preview and not reliable. If your terminal window says 7 | > "Windows Subsystem for Linux [Preview]" it likely means that they are using 8 | > the WSL Runtime from the Microsoft Store. Uninstall this before following the 9 | > steps below. (It's treated like a normal Windows Application in settings). 10 | 11 | ## Steps 12 | 1. [Install/Enable WSL2](./migrating-to-wsl2.md/#installenable-wsl2) 13 | 2. [Install new Ubuntu Distro](./migrating-to-wsl2.md/#Install-new-Ubuntu-Distro) 14 | 3. [Configure Software for the new VM](./migrating-to-wsl2.md/#Configure-Software-for-the-new-VM) 15 | 4. [Migrate data to new Distro](./migrating-to-wsl2.md/#Migrate-data-to-new-Distro) 16 | 5. [Change file/folder permissions](./migrating-to-wsl2.md/#change-filefolder-permissions) 17 | 18 | ### Install/Enable WSL2 19 | To install WSL1 you previously ran the following command in Powershell: 20 | ```Powershell 21 | dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart 22 | ``` 23 | 24 | To continue onto the more stable and robust WSL2 we run the following commands 25 | in Powershell to enable virtualization: 26 | 27 | ```Powershell 28 | dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart 29 | ``` 30 | 31 | **Once Virtualization is enabled, we'll want to run/install the Linux Kernal 32 | Update package found [here].** 33 | 34 | WSL2 should now be configured. Now we want to instruct newly installed Distros 35 | to utilize WSL2 instead by running the following Powershell command: 36 | 37 | ```Powershell 38 | wsl --set-default-version 2 39 | ``` 40 | 41 | ### Install new Ubuntu Distro 42 | Distro is shorthand for *distribution*. The preference for this course is the Ubuntu Distribution. There are three versions listed in the Microsoft Store. It doesn't matter which one we use but the preference would be *Ubuntu* or *Ubunutu 20.04*. 43 | 44 | 1. Open the Microsoft Store 45 | 2. Search for "Ubuntu" 46 | 3. Install either "Ubuntu" or "Ubuntu 20.04", whichever one you **do not** have installed as WSL1. 47 | 48 | ### Configure Software for the new VM 49 | 1. Open the new distribution. 50 | 2. Input Username and Password (These credentials do not need to be the same as 51 | the previous Distribution or Windows) 52 | 3. Install [Node.js](./nodejs-setup.md) 53 | 4. Install [Python](./python-setup.md) 54 | 55 | ### Migrate data to new Distro 56 | Because this is a new distribution, it contains none of the data we've created previously in the WSL1 instance. We can migrate the data using Windows Explorer. 57 | 58 | 1. Open both the old and new Ubuntu installations 59 | 2. Open Windows File Explorer and navigate to `\\wsl$` 60 | 3. There should be two folders, one for each distribution. Open each one in a 61 | separate window so we can drag-and-drop files between distributions. 62 | 4. Open the home directory in each distribution followed by the username 63 | directory. 64 | 5. Drag and drop any files that are wanting to be kept. 65 | 66 | ### Change file/folder permissions 67 | By transferring files across distributions, we lose access to read and write 68 | files in the new distribution. To fix this we can take ownership of those files 69 | be running the following command in the new distribution where files were 70 | transferred to. 71 | 72 | ```bash 73 | chown -R $USER DIRECTORY 74 | ``` 75 | 76 | Where `DIRECTORY` is any folders with files you wish to take ownership of. 77 | 78 | 79 | > installation of WSL2 sourced from [this source] 80 | 81 | 82 | [here]: https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi 83 | [this source]: https://docs.microsoft.com/en-us/windows/wsl/install-manual --------------------------------------------------------------------------------