diff options
author | Leon Jiang <leon.jiangy@gmail.com> | 2020-06-24 18:02:26 -0700 |
---|---|---|
committer | Leon Jiang <35908040+leonyjiang@users.noreply.github.com> | 2020-06-24 18:53:15 -0700 |
commit | a77baacec6f8d6fdfb5e969228ad736bc02f5deb (patch) | |
tree | 3fe5c5b9aff5c480f2e146e41cec73abe7e04264 /README.md | |
parent | c301252081ef31fe24160713d801722fc73e703b (diff) |
Add build & forking workflow instructions to README
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 44 |
1 files changed, 34 insertions, 10 deletions
@@ -1,39 +1,63 @@ # 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. There's no way (that I currently know of) for Windows users to develop on iOS, but I am positive workarounds exist and will include those later. +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. ### 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). *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. -*To clone your forked repo* to your local file system, first, navigate to the forked repo in your browser (**not** the original repository) if you aren't already there. Click the large green "Clone" button, and copy the URL onto your clipboard. Then, open a terminal window, navigate to where you want the project to live on your local file system (my recommendation is in a directory named "tagg" where you store both your frontend & backend projects), and run the following command, replacing the dummy URL with your clipboard: +*To clone your forked repo* to your local file system, first, navigate to the forked repo in your browser (**not** the original repository). Click the large green "Clone" button, and copy the URL onto your clipboard. Then, in a terminal window, navigate to where you want the project to live on your local file system (my recommendation is in a directory named "tagg" where you can store both your frontend & backend projects), and run the following command, replacing the dummy URL with your clipboard contents: `git clone https://github.com/your-username/Frontend.git` You'll be prompted for your GitHub username & password, which you should enter. If, when working with GitHub in the future, you don't want to enter your credentials each time, check out [this guide](https://help.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh). -Now you have a local copy of the project on your computer, but it's not synced up with the original repository, so it won't detect changes in the main project. To sync your fork upstream, navigate to your project in a terminal window if you're not already there. Inside your project directory, run the command +Now you have a local copy of your forked project on your computer, but it's not yet synced with the original repository. To sync your fork upstream, navigate to your repository in a terminal window. Inside the project directory, run the command `git remote add upstream https://github.com/TaggiD-Inc/Frontend.git` -Double check that this worked by running +Double check that this succeeded by running `git remote -v` -in your project directory. In addition to the two "origin" remotes, you should see two more "upstream" remotes. +in your project directory. If this worked, in addition to the two "origin" remotes, you should see two more "upstream" remotes. -If you've made it here with no errors, congratulations! A forked version of the frontend project directory now lives on your local file system, which you can begin editing. If not, feel free to consult your teammates. This process should be executed whenever you intend to work on a new feature (for the time being). +In order to pull updates from the main repository into to your fork, run the command -Original instructions [here](https://help.github.com/en/github/getting-started-with-github/fork-a-repo). +`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 + +`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) + +`yarn` + +which will install your node dependencies, then, navigating into the `ios` directory, run the command + +`pod install` + +which will install your cocoapods dependencies. Make sure to perform these two steps everytime you pull from upstream. + +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 + +`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. ### 2) Devtools -Follow the instructions on React Native's docs [here](https://reactnative.dev/docs/environment-setup) under "React Native CLI Quickstart", making 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 is already set uyp. +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. -*\<insert iOS instructions for Windows users here\>* +Windows users wishing to develop on iOS will have spin up a virtual Mac (through something like VirtualBox, free, or VMWare Workstation, paid). An alternative solution is to build a "Hackintosh". Unfortunately, none of these solutions are particularly ideal. If this is a major concern, please voice it to the team! 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 are properly configured, to launch a simulator, where you'll be able to view your code changes in real time (live reload on save). Happy coding! +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! |