Setup
This tutorial prefers using bash using other tools such as source control in vscode , github desktop. In your downloads directory. Not that # is comment in bash, so copy and pasting the text will be completely fine.
Cloning the repository
git clone https://github.com/XBOT-FTC/FTC-Scouting-App.gitcd FTC-Scouting-Appnpm i #Installs the packages using npmbun i #Installs the packages using buncode . #Opens the vscode in the current directorySetting up
First create a .env file in your workspace. DM Jun Jie on slack or Johnny for the password
MONGO_DB_PASSWORD=YOUR_MONGO_DB_PASSWORDThen you run the following command in your terminal
npm run dev # Runs the developer version in localhost:3000bun dev # Runs the developer version in localhost:3000Start coding
The only directory you will be touching is the app folder. In the sub-folders, there should be page.tsx, edit code there and it will reflect to the localhost you are running. Do not touch the api folder and route.ts, they are related to the backend code unless you want to modify the behavior of it.
Creating a new branch
You shouldn't push your code directly to the main branch, instead you would need to make your own branch
git checkout -b your-branch-nameCommitting changes
Before committing your changes, run this command
git stage . #. means to stage all the changed files for gitTo commit your changes quickly without triggering git hooks use a -n flag to your commit, but it is not suggested.
git commit -m "your message" -nNormally you would just do this
git commit -m "your message"Pushing changes
Before pushing changes, it is suggested to do a git pull then run this command
git pushIf this is your new branch, it will prompt something like this
fatal: The current branch test has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin test
To have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.copy the highlighted text, paste it into the terminal. In my case it is this
git push --set-upstream origin test