CSIT314 Project 2023
Using docker means that you aren't required to install npm, node or MySQL on your machine
- Make sure docker and docker compose plugin is installed
- Enter project root directory
- Build docker images
docker compose build backend
docker compose build frontend
- Run docker containers
docker compose up -d
Note: Any packages added to package.json, means you need to rebuild images and restart containers
Note: Any code changes will auto-update on frontend/backend
- npx create-react-app "proj-name"
- cd "proj-name"
- npm start
From Powershell
PS C:\Windows\System32> node -v
v18.14.0
PS C:\Windows\System32> npm -v
9.6.2
Ensure that version number is displayed. If not node or npm might not be installed/configured properly on your PC.
Disclaimer: The working example only runs on correctly configured/installed MERN (MySQL) stack, it is not a guarantee that it will run on any PC. The code may be correct but may not run due to configuration errors.
Helpful links: https://www.youtube.com/watch?v=fPuLnzSjPLE&t=1332s&ab_channel=LamaDev
Config problems encountered: client -> package.json lines 17 & 18
"start": "react-scripts --openssl-legacy-provider start",
"build": "react-scripts --openssl-legacy-provider build",
fixed to resolve openssl issues
backend -> package.json lines 6
"type": "module",
required when using import
- Create a JIRA ticket for the corresponding feature/bug
- Go to the repos branch area
- Press "new branch" and select branch source as "main"
- Name the branch name after the JIRA ticket code e.g. trad-xxx
- Press create branch
- Now on your local machine, clone the repository to a specific location,
NOTE: This requires git to be installed on your system, follow this guide to install git- Open your systems command prompt and traverse to where you would like to download the repo.
- Run the following command on your machine,
git clone https://github.com/Rankork/CSIT314-Project.git
- Traverse into the project directory
- Run
git fetch
, thengit checkout main
followed bygit pull
then finallygit checkout trad-xxx
- Now you can begin working on the project
- To save your changes on your branch, do the following
- Run
git status
to see the modified files - Run
git add FILENAME
for each modified file you would like to stage - Run
git commit
, begin the commit statement with "[TRAD-XXX]" followed by a brief commit message, to further explain commit, go to the next line and type there - Finally run
git push
- Run
- This is VERY IMPORTANT, follow it carefully
- More info: Squashing commits and rebasing
- Run
git fetch
, thengit checkout main
followed bygit pull
This step is done as to update the main branch on your local machine with main on remote (Github) - Run
git checkout trad-xxx
, to return to your branch - Then you need to run
git log
and count how many commits you have made on your branch - Now with your count of commits say 2, run the following command
git rebase -i HEAD~2
- Now you should see your commits, for each line with a commit EXCEPT the first line, replace all occurrences of "pick" with "s"
- Save the file, and another file should open showing your commit messages, modify if needed (E.g. fix commit spelling errors) then save
- Run
git push -f
to finalize commit squashing - Now run
git rebase -i main
, if merge conflicts appear, resolve them then rungit rebase --continue
- Again run
git push -f
- Run
- Go onto the github repo via the browser
- Select your branch using the drop down on the left hand side
- Press on the contribute drop down and press open a pull request
- Inform other members of merge request and assign person to review it