who-working

Before you start

You’ll need to complete these steps before you can run the Who’s Working service quickstart tasks or tutorial.

Expect this preparation to take about 20 minutes to complete.

Getting ready

The following instructions describe how to set up a system for a Windows machine. To prepare a MacOS machine for the tutorial, visit the MacOS installation guide.

You need the following:

You’ll need the following software on your development system:

TIP: If you’re using a clone of the repo on your desktop, create a working branch for your work. Create a new branch for each task to prevent a mistake in one from affecting your work in another.

Testing your development system

To test your development system, follow these steps:

Create and checkout a working branch of your Who’s Working service clone. Your GitHub repo workspace is the directory that contains the Who's Working clone. The database file that you need to access in the API folder is called shift-db-source.json.

```shell
cd < your GitHub repo workspace >
ls
# (see the who-working service directory in the list)
cd who-working
cd api
json-server -w shift-db-source.json
```

If your development system is installed correctly, you should see the service start and display the URL of the service: http://localhost:3000.

Make a test call to the service.

curl http://localhost:3000/shifts

If the service is running correctly, you should see a list of shifts from the service, such as in this example.

{
    "id": "1",
    "date": "2024-06-01",
    "start_time": "0700",
    "shift_length": "4",
    "warning": "opening",
    "location_detail": "Eatons Centre",
    "status": "open"
},
{
    "id": "2",
    "date": "2024-06-03",
    "start_time": "1030",
    "shift_length": "4",
    "warning": "none",
    "location_detail": "Yorkville Mall",
    "status": "open"
}

If you don’t see the list of shifts, or receive an error in any step of the procedure, investigate and correct the error before continuing. Some common situations that cause errors include:

  1. You mistyped a command.
  2. You aren’t in the correct directory.
  3. A required software component didn’t install correctly.
  4. A required software component isn’t up to date.

If you see the list of shifts from the service, you’re ready to do the quickstart guide or a tutorial.