|
| 1 | +# OnTrack Development Environment Setup Guide |
| 2 | + |
| 3 | +Use this guide to correctly clone, configure, and set up the development environment for OnTrack using your GitHub fork and the correct remotes. Copy the commands and change `<your-username>` to your actual GitHub username. |
| 4 | + |
| 5 | +## Tutorial Video |
| 6 | + |
| 7 | +You can watch the full step-by-step setup tutorial here: |
| 8 | + |
| 9 | +[Click to open the video in SharePoint](https://deakin365.sharepoint.com/:v:/s/ThothTech2/EYtXd8ztAdpKgI5Ki8jF7lMBC4ixVvhTzqqlDX3kmvBn4A?e=wK4v8n) |
| 10 | + |
| 11 | +## Understanding the Repository Structure |
| 12 | + |
| 13 | +Before starting, it's important to understand the different repository organizations: |
| 14 | + |
| 15 | +- **doubtfirelms** - The "upstream" organization that maintains the live versions of OnTrack used by several universities |
| 16 | +- **thoth-tech** - Used internally at Deakin for the capstone unit (this is where you'll contribute) |
| 17 | +- **Your fork** - Your personal copy where you'll push your changes |
| 18 | + |
| 19 | +## Branch Strategy |
| 20 | + |
| 21 | +**Critical:** All repositories (`doubtfire-deploy`, `doubtfire-web`, and `doubtfire-api`) must be on the **same branch** to ensure compatibility: |
| 22 | + |
| 23 | +- If working on **9.x** → all repos should be on `9.x` |
| 24 | + |
| 25 | +**For the next few semesters, we have agreed to use branch 9.x for all development work.** |
| 26 | + |
| 27 | +This is essential because different branches use different Docker builds with specific Node.js and Ruby versions that are only compatible within the same branch family. |
| 28 | + |
| 29 | +> **Avoid the `development` branch entirely** - it is outdated and unsupported. Switch to the appropriate version branch (e.g., `9.x`) immediately. |
| 30 | +
|
| 31 | +## Step 1: Create or Navigate to the Dev Directory |
| 32 | + |
| 33 | +- Create the directory if it doesn't exist: |
| 34 | + |
| 35 | + ```bash |
| 36 | + mkdir ~/dev |
| 37 | + ``` |
| 38 | + |
| 39 | +- Navigate to it: |
| 40 | + |
| 41 | + ```bash |
| 42 | + cd ~/dev |
| 43 | + ``` |
| 44 | + |
| 45 | +## Step 2: Clone the `doubtfire-deploy` Repository with Submodules |
| 46 | + |
| 47 | +Replace `<your-username>` with your GitHub username: |
| 48 | + |
| 49 | +```bash |
| 50 | +git clone --recurse-submodules https://github.com/<your-username>/doubtfire-deploy.git |
| 51 | +cd doubtfire-deploy |
| 52 | +``` |
| 53 | + |
| 54 | +## Step 3: Set Up Remotes for `doubtfire-deploy` |
| 55 | + |
| 56 | +```bash |
| 57 | +git remote set-url origin https://github.com/<your-username>/doubtfire-deploy.git |
| 58 | +git remote add upstream https://github.com/thoth-tech/doubtfire-deploy.git |
| 59 | +git fetch upstream |
| 60 | +git checkout 9.x |
| 61 | +``` |
| 62 | + |
| 63 | +## Remote Configuration Explained |
| 64 | + |
| 65 | +- **origin** → Points to your personal fork (where you push your changes) |
| 66 | +- **upstream** → Points to thoth-tech repository (where you pull updates from) |
| 67 | +- **doubtfirelms** → Can only be added later if needed for advanced merging (points to the live upstream repository) |
| 68 | + |
| 69 | +## Step 4: Configure `doubtfire-web` |
| 70 | + |
| 71 | +```bash |
| 72 | +cd doubtfire-web |
| 73 | +git remote set-url origin https://github.com/<your-username>/doubtfire-web.git |
| 74 | +git remote add upstream https://github.com/thoth-tech/doubtfire-web.git |
| 75 | +git fetch upstream |
| 76 | +git checkout 9.x |
| 77 | +``` |
| 78 | + |
| 79 | +## Step 5: Configure `doubtfire-api` |
| 80 | + |
| 81 | +```bash |
| 82 | +cd .. |
| 83 | +cd doubtfire-api |
| 84 | +git remote set-url origin https://github.com/<your-username>/doubtfire-api.git |
| 85 | +git remote add upstream https://github.com/thoth-tech/doubtfire-api.git |
| 86 | +git fetch upstream |
| 87 | +git checkout 9.x |
| 88 | +``` |
| 89 | + |
| 90 | +## Critical Notes and Best Practices |
| 91 | + |
| 92 | +### Remote Configuration |
| 93 | + |
| 94 | +- **origin** should point to your fork — this is where you push your code |
| 95 | +- **upstream** should point to the thoth-tech repo — pull updates from here |
| 96 | +- **doubtfirelms** can be added later for advanced merging scenarios |
| 97 | + |
| 98 | +### Branch Management |
| 99 | + |
| 100 | +- **Never use the `development` branch** — it is outdated and unsupported |
| 101 | +- **Always use matching branches** across all three repositories (deploy, web, api) |
| 102 | +- **Stick to version branches** like `9.x`, `8.0.x`, or `10.0.x` |
| 103 | + |
| 104 | +### Before Opening Pull Requests |
| 105 | + |
| 106 | +- **Verify your last commit** before opening a pull request: |
| 107 | + |
| 108 | + ```bash |
| 109 | + git log |
| 110 | + ``` |
| 111 | + |
| 112 | +- **Compare your commit** with the one shown on `github.com/thoth-tech/doubtfire-xxx` for that repository |
| 113 | +- **Avoid extra commits** from doubtfirelms repo that make PRs hard to review |
| 114 | + |
| 115 | +### Repository Understanding |
| 116 | + |
| 117 | +- **doubtfirelms** = Live upstream used by universities |
| 118 | +- **thoth-tech** = Internal Deakin capstone development |
| 119 | +- **Your fork** = Your personal development space |
| 120 | + |
| 121 | +> **Pro Tip:** If you've accidentally fetched branches from doubtfirelms, your PRs may contain extra commits. Always verify your latest commit matches the thoth-tech repository before submitting. |
0 commit comments