> For the complete documentation index, see [llms.txt](https://coved-dev.gitbook.io/coveducation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://coved-dev.gitbook.io/coveducation/master.md).

# 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 %}
