# Onboarding

## Setting up the environment

### Dependencies

The website is built upon Node, Typescript, and Lerna. The relevant guides at listed below.&#x20;

* [Node.js](https://nodejs.org/en/download/) (v15)
* [Lerna](https://nodejs.org/en/download/)
* Typescript:&#x20;

```bash
# Assuming npm & node are already installed. 
$ npm install -g typescript
```

### Creating a local deployment

Let's first clone [the GitHub repo](https://github.com/CovEducation/Aurora)

```bash
$ git clone git@github.com:CovEducation/Website.git
$ cd Website
```

{% hint style="info" %}
The repository is open-source, but only members of the [CovEducation organization](https://github.com/CovEducation) can make changes. Feel free to message us for an invite.
{% endhint %}

To run the website, we will need the production & test credentials. They can be found [here](https://drive.google.com/drive/folders/1EXjoPii91_eCYbB9R6VlVYsoaks0krA3?usp=sharing), although you might need to request access first. After they are downloaded, place them in the appropriate folder

```bash
$ pwd
> some/path/Website
# Assuming ~/Downloads is where you placed the credentials.
$ cp ~/Downloads/.env* packages/server
$ cp ~/Downloads/service_account.json packages/server

# Verify that the files are there. 
$ ls -al packages/server
>> .env
>> .env-prod
>> .env-test
>> service_account.json
>> ...
```

### Let's build & run

```bash
# Installling dependencies
$ yarn
# --stream allows us to see the console output. 
$ lerna run build --stream 
>> lerna success # this will take 1-2 mins on first run.
# Start the server
$ lerna run start --stream 
# Defaults to port 3000 for the frontend, and 8080 for the backend
```

### Hot Reloading

Hot reloading allows us to make changes to the frontend & backend code without having to recompile or rerun any commands. This should be the de-facto way of making changes to the website.&#x20;

We will use two terminal windows, one for live reloading the server and another for the frontend. If you're developing purely on the backend, you only need to run the live backend server and vice versa.

{% tabs %}
{% tab title="Frontend" %}

```bash
$ lerna run start --scope @coved/client
# Now you can visit localhost:3000
```

{% endtab %}

{% tab title="Backend" %}

```bash
$ lerna run dev --scope @coved/server
# Now you can visit localhost:8080
>> Listening on port 8080 📡
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://coved-dev.gitbook.io/coveducation/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
