diff --git a/docs/backend/env-setup/_dynamodb-offline-setup/index.mdx b/docs/backend/env-setup/_dynamodb-offline-setup/index.mdx new file mode 100644 index 0000000..05e4a7c --- /dev/null +++ b/docs/backend/env-setup/_dynamodb-offline-setup/index.mdx @@ -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)) diff --git a/docs/backend/env-setup/_poetry-setup/_poetry-macos-linux.mdx b/docs/backend/env-setup/_poetry-setup/_poetry-macos-linux.mdx new file mode 100644 index 0000000..dc27d17 --- /dev/null +++ b/docs/backend/env-setup/_poetry-setup/_poetry-macos-linux.mdx @@ -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 +``` diff --git a/docs/backend/env-setup/_poetry-setup/_poetry-windows.mdx b/docs/backend/env-setup/_poetry-setup/_poetry-windows.mdx new file mode 100644 index 0000000..1238914 --- /dev/null +++ b/docs/backend/env-setup/_poetry-setup/_poetry-windows.mdx @@ -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 +``` diff --git a/docs/backend/env-setup/_poetry-setup/index.mdx b/docs/backend/env-setup/_poetry-setup/index.mdx new file mode 100644 index 0000000..ea94ac5 --- /dev/null +++ b/docs/backend/env-setup/_poetry-setup/index.mdx @@ -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" + +} + macos={} + linux={} +/> +``` diff --git a/docs/backend/env-setup/_python-setup/_python-linux.mdx b/docs/backend/env-setup/_python-setup/_python-linux.mdx new file mode 100644 index 0000000..c07571d --- /dev/null +++ b/docs/backend/env-setup/_python-setup/_python-linux.mdx @@ -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 +``` diff --git a/docs/backend/env-setup/_python-setup/_python-macos.mdx b/docs/backend/env-setup/_python-setup/_python-macos.mdx new file mode 100644 index 0000000..888ab61 --- /dev/null +++ b/docs/backend/env-setup/_python-setup/_python-macos.mdx @@ -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 +``` diff --git a/docs/backend/env-setup/_python-setup/_python-windows.mdx b/docs/backend/env-setup/_python-setup/_python-windows.mdx new file mode 100644 index 0000000..28ab7be --- /dev/null +++ b/docs/backend/env-setup/_python-setup/_python-windows.mdx @@ -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. +::: diff --git a/docs/backend/env-setup/_python-setup/index.mdx b/docs/backend/env-setup/_python-setup/index.mdx new file mode 100644 index 0000000..4f9abc5 --- /dev/null +++ b/docs/backend/env-setup/_python-setup/index.mdx @@ -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" + +} + macos={} + linux={} +/> +``` diff --git a/docs/backend/env-setup/_serverless-cli-setup/index.mdx b/docs/backend/env-setup/_serverless-cli-setup/index.mdx new file mode 100644 index 0000000..6db13d8 --- /dev/null +++ b/docs/backend/env-setup/_serverless-cli-setup/index.mdx @@ -0,0 +1,7 @@ +Install the `serverless` CLI via NPM: + +```bash +npm install -g serverless +``` + +That's all! diff --git a/docs/backend/env-setup/index.mdx b/docs/backend/env-setup/index.mdx new file mode 100644 index 0000000..1ce7e72 --- /dev/null +++ b/docs/backend/env-setup/index.mdx @@ -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` + + + +## Install `poetry` + + + +## 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 + + + +## Install `dynamodb` offline + +