Skip to content
Open
Show file tree
Hide file tree
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
33 changes: 33 additions & 0 deletions docs/backend/env-setup/_dynamodb-offline-setup/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
DynamoDB will be run locally using the `serverless-dynamodb-local` plugin.

The `serverless-dynamodb-local` plugin requires

- `serverless@^1` (installed in the [previous step](#install-serverless-cli))
- `Java Runtime Engine (JRE)` version 6.x

1. Install plugin

```bash
npm install --save serverless-dynamodb-local
```

2. Then in `serverless.yml` add following entry to the plugins array: `serverless-dynamodb-local`

```yaml
plugins:
- serverless-dynamodb-local
```

3. Install `DynamoDB` locally

```bash
sls dynamodb install
```

4. Run `DynamoDB` locally

```bash
sls dynamodb start
```

This starts the DynamoDB Local instance as a local Java program (default: [http://localhost:8000](http://localhost:8000))
24 changes: 24 additions & 0 deletions docs/backend/env-setup/_poetry-setup/_poetry-macos-linux.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
### Step 1. Install Poetry

Run the following with bash

```bash
curl -sSL https://install.python-poetry.org | python3 -
```

### Step 2. Add Poetry to your `PATH`

The installer creates a `poetry` wrapper in

- `$HOME/.local/bin` on Unix
- `$POETRY_HOME/bin` if `$POETRY_HOME` is set.

If this directory is not present in your `$PATH`, you can add it in order to invoke Poetry as `poetry` _(zshrc/bash_profile)_.

### Step 3. Use Poetry

Once Poetry is installed and in your $PATH, you can execute the following

```bash
poetry --version
```
25 changes: 25 additions & 0 deletions docs/backend/env-setup/_poetry-setup/_poetry-windows.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
### Step 1. Install Poetry

Run the following with PowerShell

```powershell
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
```

:::info
If you have installed Python through the Microsoft Store, replace py with python in the command above.
:::

### Step 2. Add Poetry to your `PATH`

The installer creates a `poetry` wrapper in `%APPDATA%\Python\Scripts` on Windows.

If this directory is not present in your `$PATH`, you can add it in order to invoke Poetry as `poetry`.

### Step 3. Use Poetry

Once Poetry is installed and in your $PATH, you can execute the following

```bash
poetry --version
```
16 changes: 16 additions & 0 deletions docs/backend/env-setup/_poetry-setup/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```mdx-code-block
import OsTabs from "@site/src/components/DocsFeatures/OsTabs.tsx"
```

The installer script is available directly at [install.python-poetry.org](https://install.python-poetry.org/). The script can be executed directly (i.e. `curl python`) or downloaded and then executed from disk (e.g. in a CI environment).

```mdx-code-block
import PoetryWindows from "./_poetry-windows.mdx"
import PoetryMacOSLinux from "./_poetry-macos-linux.mdx"

<OsTabs
windows={<PoetryWindows />}
macos={<PoetryMacOSLinux />}
linux={<PoetryMacOSLinux />}
/>
```
33 changes: 33 additions & 0 deletions docs/backend/env-setup/_python-setup/_python-linux.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
### Ubuntu

[deadsnakes PPA](https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa) contains more recent Python versions packaged for Ubuntu.

```bash
$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:deadsnakes/ppa
$ sudo apt-get update
$ sudo apt-get install python3.8
```

### Other Linux distribution

If you are using other Linux distribution, `Python 3` is most likely preinstalled. If not, use your distribution's package manager to install it.

For example, on Fedora, you would use `dnf`:

```bash
$ sudo dnf install python3
```

And on ArchLinux, you would use `pacman`:

```bash
$ sudo pacman -S python
```

To check if it is installed correctly:

```bash
python --version
# Python 3.10.7
```
11 changes: 11 additions & 0 deletions docs/backend/env-setup/_python-setup/_python-macos.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
1. Download the `Python` installer package from the [official Python website](https://www.python.org/downloads/)
1. It should detect your operating system and show a yellow download button. If it doesn’t, click the `macos` link and choose the latest Python release.
1. Once the download is complete, double-click the package to start installing `Python`. Follow the installation steps with the default settings.
1. Once installation is complete, you have python installed on your system!

To check if it is installed correctly:

```bash
python --version
# Python 3.10.7
```
15 changes: 15 additions & 0 deletions docs/backend/env-setup/_python-setup/_python-windows.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
1. Download the `Python` installer package from the [official Python website](https://www.python.org/downloads/)
1. It should detect your operating system and show a yellow download button. If it doesn’t, click the `windows` link and choose the latest Python release.
1. Once the download is complete, double-click the package to start installing `Python`. Follow the installation steps with the default settings.
1. Once installation is complete, you have python installed on your system!

To check if it is installed correctly:

```bash
py --version
# Python 3.10.7
```

:::info
If you have installed Python through the Microsoft Store, replace py with python in the command above.
:::
15 changes: 15 additions & 0 deletions docs/backend/env-setup/_python-setup/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```mdx-code-block
import OsTabs from "@site/src/components/DocsFeatures/OsTabs.tsx"
```

```mdx-code-block
import PythonWindows from "./_python-windows.mdx"
import PythonMacOS from "./_python-macos.mdx"
import PythonLinux from "./_python-linux.mdx"

<OsTabs
windows={<PythonWindows />}
macos={<PythonMacOS />}
linux={<PythonLinux />}
/>
```
7 changes: 7 additions & 0 deletions docs/backend/env-setup/_serverless-cli-setup/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Install the `serverless` CLI via NPM:

```bash
npm install -g serverless
```

That's all!
36 changes: 36 additions & 0 deletions docs/backend/env-setup/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
sidebar_position: 1
---

import PythonSetup from './_python-setup/index.mdx';
import PoetrySetup from './_poetry-setup/index.mdx';
import DynamoDBSetup from './_dynamodb-offline-setup/index.mdx';
import ServerlessCLISetup from './_serverless-cli-setup/index.mdx';

# Environment Setup

Backend devs should have the following installed and configured as described below:

## Install `Python 3.x`

<PythonSetup />

## Install `poetry`

<PoetrySetup />

## Install `nvm` & `node.js`

Follow the instructions to install `nvm` & `node.js` [here](/docs/getting-started/node-nvm)

:::info Reminder
Use nvm to switch between versions of `node.js` across projects
:::

## Install `serverless` cli

<ServerlessCLISetup />

## Install `dynamodb` offline

<DynamoDBSetup />