aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md66
1 files changed, 54 insertions, 12 deletions
diff --git a/README.md b/README.md
index 818b209b..352847b9 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,12 @@
# Frontend
+
## Setup
-Welcome! Before you get coding, there's a few setup-related tasks to complete. Specifically, you'll have to **1) fork the repo**, and **2) install the necessary development tools**. After that, you should be able to get up and running.
+
+Welcome! Before you get coding, there's a few setup-related tasks to complete. Specifically, you'll have to **1) fork the repo**, **2) configure your workflow**, and **3) install necessary development tools**. After that, you should be able to get up and running.
### 1) Git going
-First, you'll need to fork the Frontend repo *and* sync it upstream. If you've already done this, skip to step 2).
+
+First, you'll need to fork the Frontend repo and sync it upstream.
*To fork the repo*, simply click the "Fork" button near the top right of this page. If prompted to select "where" to fork it, click your username.
@@ -23,35 +26,73 @@ Double check that this succeeded by running
in your project directory. If this worked, in addition to the two "origin" remotes, you should see two more "upstream" remotes.
-In order to pull updates from the main repository into to your fork, run the command
+If you've made it here with no errors, congratulations! You now have a local copy of the project. If you had any problems, feel free to consult your teammates.
+
+### 2) Workflow
+
+Next, you'll learn how to pull updates from the main repository, install dependencies, and configure your local git settings.
+
+In order to pull updates from the main repository into to your local project, navigate to your local project and run the command
`git pull upstream master`
-Your local project will then have the up-to-date project code, but your fork on GitHub (remote origin) will be now outdated. To push these local updates to your forked repository, run the command
+Your local project will then have the up-to-date project code from the main repository, but your fork on GitHub ("origin") will be now outdated. To push these local updates to your forked repository's master branch, run the command
`git push origin master`
-In order to build your project in Xcode and Android Studio, your project dependencies, like those in `node_modules/` and `ios/Pods/`, need to be installed. These dependencies are not uploaded to GitHub, so you'll need to navigate into your project directory and run (ensuring the yarn package manager is installed)
+In order to build your project in Xcode and Android Studio, your project dependencies, like those in `node_modules/` and `ios/Pods/`, need to be installed. These dependencies are not uploaded to GitHub, so you'll need to navigate into your project directory and run (ensuring that yarn and cocoapods are installed)
`yarn`
-which will install your node dependencies, then, navigating into the `ios` directory, run the command
+which will install your node dependencies, then, navigating into the `ios/` directory
`pod install`
-which will install your cocoapods dependencies. Make sure to perform these two steps everytime you pull from upstream.
+which will install your cocoapods dependencies. Make sure to perform these two steps each time you pull from upstream, as dependencies may be added and removed throughout the course of the project.
-If you've made it here with no errors, congratulations! You can now start making local project edits. If you had any trouble, feel free to consult your teammates.
-
-To work on a new feature, checkout a new branch in your local repository with the command
+To work on a new feature, checkout a new branch in your local project with the command
`git checkout -b tmaXX-name-of-feature`
where "tmaXX-name-of-feature" refers to the Jira ticket number and feature name (e.g. tma1-setup-mysql-ec2).
-When you finish building and testing a feature with the most recent publicly-available project, merge the *feature branch* of your forked repository into the *master branch* of the main repository through a GitHub pull request.
+To push your changes on your feature branch to your fork, run the command
+
+`git push origin tmaXX-name-of-feature`
+
+To ensure your local feature branch is up-to-date with the main repository, run this command from your local branch
+
+`git pull upstream master`
+
+To view your branches and see which one you're currently on, run
-### 2) Devtools
+`git branch` (exit that view with `q`)
+
+To switch branches, run
+
+`git checkout branch-name` (e.g. `git checkout master`)
+
+Once you finish building and testing a feature with the most up-to-date project code from the main repository, commit and push your local updates to your GitHub fork, then merge the *feature branch* of your forked repository into the *master branch* of the main repository through a GitHub pull request. This can be done in a browser by navigating to your forked repository and the branch to merge on GitHub.
+
+Lastly, your commits need to be signed. [Click here](https://help.github.com/en/github/authenticating-to-github/signing-commits) to learn how to set that up. We'll be using GPG keys for signing commits. The GitHub help site doesn't mention it, but there are a few extra items to configure after creating and uploading your key. Specifically, run the commands
+
+- `git config --global commit.gpgsign true`
+- `git config --global gpg.program gpg`
+- `git config --global user.signingkey XXXXXXXXXXXXXXXX` (replacing `XXXXXXXXXXXXXXXX` with your 16-digit GPG key)
+- `echo 'export GPG_TTY=$(tty)' >> ~/.bash_profile && source ~/.bash_profile` (replacing `~/.bash_profile` with your shell's configuration file. If you are on macOS and using zsh, this is `~/.zshrc`; check your shell with `echo $SHELL`)
+
+Lastly, ensure that you see your full name and GitHub email when running
+
+- `git config --global user.name`
+- `git config --global user.email`
+
+If not, set them by simply running the same command but with your name and email as an argument (enclosed in quotes, e.g. `git config --global user.name "FIRST LAST"`).
+
+In the future, all commits made from the command line should be done with the `-S` flag (e.g. `git commit -S -m "commit message"`). This tells git to sign the commit.
+
+If you've made it here, congratulations! You are one step closer to being fully set up. Again, if this is not the case, feel free to consult your teammates.
+
+### 3) Devtools
Follow the instructions on React Native's docs [here](https://reactnative.dev/docs/environment-setup) under "React Native CLI Quickstart", being sure to follow directions for *your operating system*, for *both target operating systems* (iOS and Android). Stop upon reaching the section "Creating a new application", as our project already exists.
@@ -60,4 +101,5 @@ Windows users wishing to develop on iOS will have spin up a virtual Mac (through
Now that you've forked your repo and installed your developer tools, you are ready to build and run your project.
## Running
+
To build and run your project, open a terminal window, navigate to your project directory, and run `yarn ios` or `yarn android`. This should prompt Xcode / Android Studio, if they have been properly installed and configured, to launch a mobile simulator, where you'll be able to view your code edits in real time (live reload on save). Happy coding!