Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding documentation on setting up local dev env #38

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 34 additions & 7 deletions dg/setting-up.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,40 @@ This section guides you through the steps required to set up your computer for d

-----------------------------------------------------------------------------------

## Creating your local development environment

1. Set up [Gatekeeper](https://github.com/CATcher-org/gatekeeper), a local server used to enable
client-side applications to perform OAuth with GitHub. Follow the instructions on the repository.
2. Create a new GitHub organization to store all your repositories. More details can be found
[here.](../ug/instructors.md)
3. Create a new GitHub OAuth application under the new GitHub organization. More details can be
found [here.](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app)

Set the homepage URL to your organization's
[default homepage URL.](https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages#types-of-github-pages-sites)

Set the authorization callback's URL to `http://localhost:4200`.

4. Start Gatekeeper with `npm run start` and take note of the local address of the server.

5. Update `environment.gen.ts` with the appropriate base configuration such as:
- `accessTokenUrl`: local Gatekeeper server address
- `clientDataUrl`: `profiles.json` of your local `client_data` folder (see step (2) for more
information)
- `clientId`: client id of your GitHub app

6. Start CATcher locally with `npm run ng:serve:web`, select a profile, and login to grant CATcher
access to your GitHub account to begin.

-----------------------------------------------------------------------------------

## Dev commands

Given below are different commands you can use to run the app locally.

|Command|Description|
|--|--|
|`npm run ng:serve:web`| Start the app from the browser in development mode. |
| Command | Description |
| ---------------------- | --------------------------------------------------- |
| `npm run ng:serve:web` | Start the app from the browser in development mode. |

-----------------------------------------------------------------------------------

Expand Down Expand Up @@ -68,7 +95,7 @@ If you wish to know more about them, you can visit our [tools page](tools.html).
### Backend

<panel header="**Task 1: Add new label**" type="primary">

**Task 1: Add new label `type.UiFlaw`**

Currently, there are only 3 types of bugs in CATcher: `type.DocumentationBug`, `type.FeatureFlaw` and `type.FunctionalityBug`. Let's add a fourth one, `type.UiFlaw` to understand the backend.
Expand Down Expand Up @@ -107,14 +134,14 @@ If you wish to know more about them, you can visit our [tools page](tools.html).
**Task 2: Delete labels that are not in use**

Upon creation of a new repository, Github will automatically create default labels, which we may not use in CATcher. The user might also have added other labels on their own.

**Your task**

Add a feature to delete all labels that are not required by CATcher upon login.

<panel header="Hint 1" type="info">

Similar to the first task, one of the files responsible for this feature is `label.service.ts`. However, we need to interact with the Github API to delete labels. Can you find which service is responsible for handling Github API calls?
Similar to the first task, one of the files responsible for this feature is `label.service.ts`. However, we need to interact with the Github API to delete labels. Can you find which service is responsible for handling Github API calls?

</panel>
<panel header="Hint 2" type="info">
Expand Down