/
Local Development 101

Local Development 101

First Time Setup

Follow these steps to get Freerooms running locally (i.e. on your computer)

  1. Clone the repo

  2. 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)

  3. Follow any necessary/desired instructions to to install Node JS and NPM

  4. Go to the backend folder

    1. Run npm install

      • This should create a new node_modules folder

    2. Run npm start

      • This will start the backend

  5. Go to the frontend folder

    1. Run npm install

    2. 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.

  1. Install the Prettier extension, see instructions here for Editor Integration

  2. 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

  1. 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.

  2. For your assigned issue, go to the “Development” section on the right side of the page

  3. Click “Create a branch”

  4. 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

  5. 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:

  1. Move your issue from “In progress” to “In review” on the board

  2. Create a new pull request on GitHub

    1. The title should be formatted as: ### - Summary of PR

    2. 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

    3. Add Jess and Richard as your reviewers

      • You may optionally assign fellow subcom as reviewers if you have related issues

    4. Assign yourself as the “Assignee”

    5. For “Development”, make sure the relevant ticket that your pull request implements is selected

  3. 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.

 

Related content