Local Development 101
First Time Setup
Follow these steps to get Freerooms running locally (i.e. on your computer)
Clone the repo
Run this command:
git config --local core.hooksPath .githooks
This command will format on commit by default (meaning that you do not have to follow the steps under the Prettier section if you wish)
Follow any necessary/desired instructions to to install Node JS and NPM
Go to the
backend
folderRun
npm install
This should create a new
node_modules
folder
Run
npm start
This will start the backend
Go to the
frontend
folderRun
npm install
Run
npm run dev
This will start the frontend and provide a url for you to view on localhost
Always run the backend before the frontend so you avoid port issues
ESLint
ESLint is a code linter to ensure that we try to stick to best practices whenever possible.
Install the ESLint extension for VSCode
Frontend: npm run lint
Backend: npx eslint .
Prettier
Prettier is a code formatter that will beautify your code and make sure we all follow the same style.
Install the Prettier extension, see instructions here for Editor Integration
Ensure you have Format on Save configured for Prettier (test this out on your code!)
Alternatively, if you don’t want to follow the above two steps, then you can use: npx prettier . --write
You must ensure you have used Prettier and ESLint before submitting any pull requests.
Working on Issues
View your assigned issues on GitHub
If you need further clarification please do not hesitate to ask a director! However please do update the ticket with the clarifications you asked so that everyone knows what the latest decisions are.
For your assigned issue, go to the “Development” section on the right side of the page
Click “Create a branch”
By default, you should not need to change anything on the modal that appears
Keep the branch name unchanged
Repository destination: devsoc-unsw/freerooms
Branch source: dev (unless you have a reason/dependency to branch off someone else’s work)
What’s next: Checkout locally
Click “Create branch” and copy and paste the commands to start development on your computer
Remember: All changes for an issue should be done on one branch
This year, our goal is to ensure adequate tests are written for all newly implemented features - please remember to do this!
Pull Requests
Once you’re done working on an issue and have added tests, follow these steps to create a pull request:
Move your issue from “In progress” to “In review” on the board
Create a new pull request on GitHub
The title should be formatted as:
### - Summary of PR
The description should contain an overview of:
The changes you’ve made
How to view these changes so people can test it
Frontend only: screenshots of what has been changed
Add Jess and Richard as your reviewers
You may optionally assign fellow subcom as reviewers if you have related issues
Assign yourself as the “Assignee”
For “Development”, make sure the relevant ticket that your pull request implements is selected
Merge your pull request when it has been reviewed and approved by at least one director
Our Extra Repositories
As part of our Freerooms related resources, we share/maintain two different scraper repositories for internal use. These are nss-scraper and libcal-scraper, for CATS rooms and library rooms respectively. We used to use timetable-scraper, which is shared with Notangles and others; but despite the README documentation, we have moved on. If you have any questions relating to the repositories, ask the directors or the platforms team, who are mostly in charge.
The Map
You will not be able to access the Map feature locally due to your IP being unable to access the Google Maps API that we use. If you need access to the map feature, please let Jess know and she can help you to arrange access.