From a510bb53b1fe528dd4620d888021d5d6f8011ca9 Mon Sep 17 00:00:00 2001 From: LimIvan336 <71662324+LimIvan336@users.noreply.github.com> Date: Mon, 17 Oct 2022 23:21:01 +0800 Subject: [PATCH 1/6] New commit [SCSE-22] --- docs/backend/env-setup.mdx | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 docs/backend/env-setup.mdx diff --git a/docs/backend/env-setup.mdx b/docs/backend/env-setup.mdx new file mode 100644 index 0000000..f498691 --- /dev/null +++ b/docs/backend/env-setup.mdx @@ -0,0 +1,9 @@ +--- +sidebar_position: 1 +--- + +# Environment Setup + +Backend devs should have the following installed and configured as described below: + +## Python 3.x From 4d4eceda8f1626f4ec619c9bae5e203d21a08fec Mon Sep 17 00:00:00 2001 From: Jing Hua Date: Tue, 18 Oct 2022 14:34:54 +0800 Subject: [PATCH 2/6] docs: add python installation instructions This commit adds the python installation instruction for windows, macos, and linux to the backend dev environment setup page. [SCSE-22] --- docs/backend/_python-linux.mdx | 36 ++++++++++++++++++++++++++++++++ docs/backend/_python-macos.mdx | 14 +++++++++++++ docs/backend/_python-windows.mdx | 14 +++++++++++++ docs/backend/env-setup.mdx | 28 ++++++++++++++++++++++++- 4 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 docs/backend/_python-linux.mdx create mode 100644 docs/backend/_python-macos.mdx create mode 100644 docs/backend/_python-windows.mdx diff --git a/docs/backend/_python-linux.mdx b/docs/backend/_python-linux.mdx new file mode 100644 index 0000000..dab3c9e --- /dev/null +++ b/docs/backend/_python-linux.mdx @@ -0,0 +1,36 @@ +### 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 +# OR +py --version +#Python 3.10.7 +``` diff --git a/docs/backend/_python-macos.mdx b/docs/backend/_python-macos.mdx new file mode 100644 index 0000000..55ec1dd --- /dev/null +++ b/docs/backend/_python-macos.mdx @@ -0,0 +1,14 @@ +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 +python --version +# Python 3.10.7 +# OR +py --version +#Python 3.10.7 +``` diff --git a/docs/backend/_python-windows.mdx b/docs/backend/_python-windows.mdx new file mode 100644 index 0000000..55ec1dd --- /dev/null +++ b/docs/backend/_python-windows.mdx @@ -0,0 +1,14 @@ +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 +python --version +# Python 3.10.7 +# OR +py --version +#Python 3.10.7 +``` diff --git a/docs/backend/env-setup.mdx b/docs/backend/env-setup.mdx index f498691..c4410a9 100644 --- a/docs/backend/env-setup.mdx +++ b/docs/backend/env-setup.mdx @@ -4,6 +4,32 @@ sidebar_position: 1 # Environment Setup +```mdx-code-block +import OsTabs from "@site/src/components/DocsFeatures/OsTabs.tsx" +``` + Backend devs should have the following installed and configured as described below: -## Python 3.x +## Install `Python 3.x` + +```mdx-code-block +import PythonWindows from "./_python-windows.mdx" +import PythonMacOS from "./_python-macos.mdx" +import PythonLinux from "./_python-linux.mdx" + +} + macos={} + linux={} +/> +``` + +## Install `poetry` + +## Install `nvm` & `node.js` + +Follow the instructions to install `nvm` & `node.js` [here](/docs/getting-started/node-nvm) + +## Install serverless cli + +## Install dynamodb offline From 543f903048c40c76cf9e236d88ef6282eb5d9764 Mon Sep 17 00:00:00 2001 From: Jing Hua Date: Wed, 19 Oct 2022 14:16:05 +0800 Subject: [PATCH 3/6] docs: add peotry instruction + restructure docs This commits adds the peotry instruction for windows, macos, and linus to the backend dev environment setup page. It also restructures the backend dev environment setup page. [SCSE-22] --- .../_peotry-setup/_poetry-macos-linux.mdx | 24 ++++++++++++++++++ .../_peotry-setup/_poetry-windows.mdx | 25 +++++++++++++++++++ .../backend/env-setup/_peotry-setup/index.mdx | 18 +++++++++++++ .../_python-setup}/_python-linux.mdx | 3 --- .../_python-setup}/_python-macos.mdx | 5 +--- .../_python-setup}/_python-windows.mdx | 9 ++++--- .../_python-setup/index.mdx} | 18 ------------- docs/backend/env-setup/index.mdx | 23 +++++++++++++++++ 8 files changed, 96 insertions(+), 29 deletions(-) create mode 100644 docs/backend/env-setup/_peotry-setup/_poetry-macos-linux.mdx create mode 100644 docs/backend/env-setup/_peotry-setup/_poetry-windows.mdx create mode 100644 docs/backend/env-setup/_peotry-setup/index.mdx rename docs/backend/{ => env-setup/_python-setup}/_python-linux.mdx (95%) rename docs/backend/{ => env-setup/_python-setup}/_python-macos.mdx (79%) rename docs/backend/{ => env-setup/_python-setup}/_python-windows.mdx (83%) rename docs/backend/{env-setup.mdx => env-setup/_python-setup/index.mdx} (53%) create mode 100644 docs/backend/env-setup/index.mdx diff --git a/docs/backend/env-setup/_peotry-setup/_poetry-macos-linux.mdx b/docs/backend/env-setup/_peotry-setup/_poetry-macos-linux.mdx new file mode 100644 index 0000000..136dad3 --- /dev/null +++ b/docs/backend/env-setup/_peotry-setup/_poetry-macos-linux.mdx @@ -0,0 +1,24 @@ +### Step 1. Install Peotry + +Run the following with bash + +```bash +curl -sSL https://install.python-poetry.org | python3 - +``` + +### Step 2. Add Peotry 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`. + +### 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/_peotry-setup/_poetry-windows.mdx b/docs/backend/env-setup/_peotry-setup/_poetry-windows.mdx new file mode 100644 index 0000000..656f87a --- /dev/null +++ b/docs/backend/env-setup/_peotry-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 Peotry 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/_peotry-setup/index.mdx b/docs/backend/env-setup/_peotry-setup/index.mdx new file mode 100644 index 0000000..f8e276f --- /dev/null +++ b/docs/backend/env-setup/_peotry-setup/index.mdx @@ -0,0 +1,18 @@ +```mdx-code-block +import OsTabs from "@site/src/components/DocsFeatures/OsTabs.tsx" +``` + +## Install `poetry` + +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 PeotryWindows from "./_poetry-windows.mdx" +import PeotryMacOSLinux from "./_poetry-macos-linux.mdx" + +} + macos={} + linux={} +/> +``` diff --git a/docs/backend/_python-linux.mdx b/docs/backend/env-setup/_python-setup/_python-linux.mdx similarity index 95% rename from docs/backend/_python-linux.mdx rename to docs/backend/env-setup/_python-setup/_python-linux.mdx index dab3c9e..c07571d 100644 --- a/docs/backend/_python-linux.mdx +++ b/docs/backend/env-setup/_python-setup/_python-linux.mdx @@ -30,7 +30,4 @@ To check if it is installed correctly: ```bash python --version # Python 3.10.7 -# OR -py --version -#Python 3.10.7 ``` diff --git a/docs/backend/_python-macos.mdx b/docs/backend/env-setup/_python-setup/_python-macos.mdx similarity index 79% rename from docs/backend/_python-macos.mdx rename to docs/backend/env-setup/_python-setup/_python-macos.mdx index 55ec1dd..888ab61 100644 --- a/docs/backend/_python-macos.mdx +++ b/docs/backend/env-setup/_python-setup/_python-macos.mdx @@ -1,5 +1,5 @@ 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. 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! @@ -8,7 +8,4 @@ To check if it is installed correctly: ```bash python --version # Python 3.10.7 -# OR -py --version -#Python 3.10.7 ``` diff --git a/docs/backend/_python-windows.mdx b/docs/backend/env-setup/_python-setup/_python-windows.mdx similarity index 83% rename from docs/backend/_python-windows.mdx rename to docs/backend/env-setup/_python-setup/_python-windows.mdx index 55ec1dd..28ab7be 100644 --- a/docs/backend/_python-windows.mdx +++ b/docs/backend/env-setup/_python-setup/_python-windows.mdx @@ -6,9 +6,10 @@ To check if it is installed correctly: ```bash -python --version -# Python 3.10.7 -# OR py --version -#Python 3.10.7 +# 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.mdx b/docs/backend/env-setup/_python-setup/index.mdx similarity index 53% rename from docs/backend/env-setup.mdx rename to docs/backend/env-setup/_python-setup/index.mdx index c4410a9..e5c324f 100644 --- a/docs/backend/env-setup.mdx +++ b/docs/backend/env-setup/_python-setup/index.mdx @@ -1,15 +1,7 @@ ---- -sidebar_position: 1 ---- - -# Environment Setup - ```mdx-code-block import OsTabs from "@site/src/components/DocsFeatures/OsTabs.tsx" ``` -Backend devs should have the following installed and configured as described below: - ## Install `Python 3.x` ```mdx-code-block @@ -23,13 +15,3 @@ import PythonLinux from "./_python-linux.mdx" linux={} /> ``` - -## Install `poetry` - -## Install `nvm` & `node.js` - -Follow the instructions to install `nvm` & `node.js` [here](/docs/getting-started/node-nvm) - -## Install serverless cli - -## Install dynamodb offline diff --git a/docs/backend/env-setup/index.mdx b/docs/backend/env-setup/index.mdx new file mode 100644 index 0000000..334830b --- /dev/null +++ b/docs/backend/env-setup/index.mdx @@ -0,0 +1,23 @@ +--- +sidebar_position: 1 +--- + +# Environment Setup + +Backend devs should have the following installed and configured as described below: + +```mdx-code-block +import PythonSetup from './_python-setup/index.mdx' +import PeotrySetup from './_peotry-setup/index.mdx' + + + +``` + +## Install `nvm` & `node.js` + +Follow the instructions to install `nvm` & `node.js` [here](/docs/getting-started/node-nvm) + +## Install serverless cli + +## Install dynamodb offline From 11e2dbaa212e1a923f499fdd9eb54e21dda53868 Mon Sep 17 00:00:00 2001 From: Jing Hua Date: Thu, 20 Oct 2022 22:59:37 +0800 Subject: [PATCH 4/6] docs: add serverless cli and dynamodb offline This commit adds documentation for installing serverless cli and dynamodb offline [SCSE-22] --- .../_dynamodb-offline-setup/index.mdx | 20 +++++++++++++++ .../_peotry-setup/_poetry-macos-linux.mdx | 2 +- .../backend/env-setup/_peotry-setup/index.mdx | 2 -- .../backend/env-setup/_python-setup/index.mdx | 2 -- .../env-setup/_serverless-cli-setup/index.mdx | 7 ++++++ docs/backend/env-setup/index.mdx | 25 ++++++++++++++----- 6 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 docs/backend/env-setup/_dynamodb-offline-setup/index.mdx create mode 100644 docs/backend/env-setup/_serverless-cli-setup/index.mdx 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..e5276b7 --- /dev/null +++ b/docs/backend/env-setup/_dynamodb-offline-setup/index.mdx @@ -0,0 +1,20 @@ +1. Download DynamoDB [here](https://s3.ap-southeast-1.amazonaws.com/dynamodb-local-singapore/dynamodb_local_latest.zip) (you can view other download links [here](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.DownloadingAndRunning.html)) + :::caution + To run DynamoDB on your computer, you must have the Java Runtime Environment (JRE) version 8.x or newer. The application doesn't run on earlier JRE versions. + ::: + +2. Extract the archive and copy its content to a location of your choice. + +3. Open a terminal in the location where you've extracted your files and enter the following command: + + ```bash + java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb + ``` + + :::info + If you're using Windows PowerShell, be sure to enclose the parameter name or the entire name and value like this: + + `java -D"java.library.path=./DynamoDBLocal_lib" -jar DynamoDBLocal.jar` + ::: + +4. DynamoDB is now running on port `8000`. To stop it, press `Ctrl+C` in the terminal. diff --git a/docs/backend/env-setup/_peotry-setup/_poetry-macos-linux.mdx b/docs/backend/env-setup/_peotry-setup/_poetry-macos-linux.mdx index 136dad3..ad9e887 100644 --- a/docs/backend/env-setup/_peotry-setup/_poetry-macos-linux.mdx +++ b/docs/backend/env-setup/_peotry-setup/_poetry-macos-linux.mdx @@ -13,7 +13,7 @@ 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`. +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 diff --git a/docs/backend/env-setup/_peotry-setup/index.mdx b/docs/backend/env-setup/_peotry-setup/index.mdx index f8e276f..bca8401 100644 --- a/docs/backend/env-setup/_peotry-setup/index.mdx +++ b/docs/backend/env-setup/_peotry-setup/index.mdx @@ -2,8 +2,6 @@ import OsTabs from "@site/src/components/DocsFeatures/OsTabs.tsx" ``` -## Install `poetry` - 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 diff --git a/docs/backend/env-setup/_python-setup/index.mdx b/docs/backend/env-setup/_python-setup/index.mdx index e5c324f..4f9abc5 100644 --- a/docs/backend/env-setup/_python-setup/index.mdx +++ b/docs/backend/env-setup/_python-setup/index.mdx @@ -2,8 +2,6 @@ import OsTabs from "@site/src/components/DocsFeatures/OsTabs.tsx" ``` -## Install `Python 3.x` - ```mdx-code-block import PythonWindows from "./_python-windows.mdx" import PythonMacOS from "./_python-macos.mdx" 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 index 334830b..50a9bf3 100644 --- a/docs/backend/env-setup/index.mdx +++ b/docs/backend/env-setup/index.mdx @@ -2,22 +2,35 @@ sidebar_position: 1 --- +import PythonSetup from './_python-setup/index.mdx'; +import PeotrySetup from './_peotry-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: -```mdx-code-block -import PythonSetup from './_python-setup/index.mdx' -import PeotrySetup from './_peotry-setup/index.mdx' +## Install `Python 3.x` + +## Install `poetry` + -``` ## Install `nvm` & `node.js` Follow the instructions to install `nvm` & `node.js` [here](/docs/getting-started/node-nvm) -## Install serverless cli +:::info Reminder +Use nvm to switch between versions of `node.js` across projects +::: + +## Install `serverless` cli + + + +## Install `dynamodb` offline -## Install dynamodb offline + From 31cba151936da36af6ec2c4c9bef70d6b57c649e Mon Sep 17 00:00:00 2001 From: Jing Hua Date: Tue, 25 Oct 2022 09:13:28 +0800 Subject: [PATCH 5/6] docs: fix typo from peotry to poetry This commit renames all instances (in file names and file content) of peotry to poetry [SCSE-22] --- .../_poetry-macos-linux.mdx | 4 ++-- .../_poetry-windows.mdx | 2 +- .../{_peotry-setup => _poetry-setup}/index.mdx | 10 +++++----- docs/backend/env-setup/index.mdx | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) rename docs/backend/env-setup/{_peotry-setup => _poetry-setup}/_poetry-macos-linux.mdx (88%) rename docs/backend/env-setup/{_peotry-setup => _poetry-setup}/_poetry-windows.mdx (94%) rename docs/backend/env-setup/{_peotry-setup => _poetry-setup}/index.mdx (63%) diff --git a/docs/backend/env-setup/_peotry-setup/_poetry-macos-linux.mdx b/docs/backend/env-setup/_poetry-setup/_poetry-macos-linux.mdx similarity index 88% rename from docs/backend/env-setup/_peotry-setup/_poetry-macos-linux.mdx rename to docs/backend/env-setup/_poetry-setup/_poetry-macos-linux.mdx index ad9e887..dc27d17 100644 --- a/docs/backend/env-setup/_peotry-setup/_poetry-macos-linux.mdx +++ b/docs/backend/env-setup/_poetry-setup/_poetry-macos-linux.mdx @@ -1,4 +1,4 @@ -### Step 1. Install Peotry +### Step 1. Install Poetry Run the following with bash @@ -6,7 +6,7 @@ Run the following with bash curl -sSL https://install.python-poetry.org | python3 - ``` -### Step 2. Add Peotry to your `PATH` +### Step 2. Add Poetry to your `PATH` The installer creates a `poetry` wrapper in diff --git a/docs/backend/env-setup/_peotry-setup/_poetry-windows.mdx b/docs/backend/env-setup/_poetry-setup/_poetry-windows.mdx similarity index 94% rename from docs/backend/env-setup/_peotry-setup/_poetry-windows.mdx rename to docs/backend/env-setup/_poetry-setup/_poetry-windows.mdx index 656f87a..1238914 100644 --- a/docs/backend/env-setup/_peotry-setup/_poetry-windows.mdx +++ b/docs/backend/env-setup/_poetry-setup/_poetry-windows.mdx @@ -10,7 +10,7 @@ Run the following with PowerShell If you have installed Python through the Microsoft Store, replace py with python in the command above. ::: -### Step 2. Add Peotry to your `PATH` +### Step 2. Add Poetry to your `PATH` The installer creates a `poetry` wrapper in `%APPDATA%\Python\Scripts` on Windows. diff --git a/docs/backend/env-setup/_peotry-setup/index.mdx b/docs/backend/env-setup/_poetry-setup/index.mdx similarity index 63% rename from docs/backend/env-setup/_peotry-setup/index.mdx rename to docs/backend/env-setup/_poetry-setup/index.mdx index bca8401..ea94ac5 100644 --- a/docs/backend/env-setup/_peotry-setup/index.mdx +++ b/docs/backend/env-setup/_poetry-setup/index.mdx @@ -5,12 +5,12 @@ 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 PeotryWindows from "./_poetry-windows.mdx" -import PeotryMacOSLinux from "./_poetry-macos-linux.mdx" +import PoetryWindows from "./_poetry-windows.mdx" +import PoetryMacOSLinux from "./_poetry-macos-linux.mdx" } - macos={} - linux={} + windows={} + macos={} + linux={} /> ``` diff --git a/docs/backend/env-setup/index.mdx b/docs/backend/env-setup/index.mdx index 50a9bf3..1ce7e72 100644 --- a/docs/backend/env-setup/index.mdx +++ b/docs/backend/env-setup/index.mdx @@ -3,7 +3,7 @@ sidebar_position: 1 --- import PythonSetup from './_python-setup/index.mdx'; -import PeotrySetup from './_peotry-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'; @@ -17,7 +17,7 @@ Backend devs should have the following installed and configured as described bel ## Install `poetry` - + ## Install `nvm` & `node.js` From 9c94a49dd8d3740d75851651fb543d599e231318 Mon Sep 17 00:00:00 2001 From: Jing Hua Date: Tue, 25 Oct 2022 09:33:10 +0800 Subject: [PATCH 6/6] docs: update DynamoDB installation instruction This commit updates the DynamoDB installation instruction from running it locally inside Java to running it with the serverless-dynamodb-local plugin [SCSE-22] --- .../_dynamodb-offline-setup/index.mdx | 37 +++++++++++++------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/docs/backend/env-setup/_dynamodb-offline-setup/index.mdx b/docs/backend/env-setup/_dynamodb-offline-setup/index.mdx index e5276b7..05e4a7c 100644 --- a/docs/backend/env-setup/_dynamodb-offline-setup/index.mdx +++ b/docs/backend/env-setup/_dynamodb-offline-setup/index.mdx @@ -1,20 +1,33 @@ -1. Download DynamoDB [here](https://s3.ap-southeast-1.amazonaws.com/dynamodb-local-singapore/dynamodb_local_latest.zip) (you can view other download links [here](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.DownloadingAndRunning.html)) - :::caution - To run DynamoDB on your computer, you must have the Java Runtime Environment (JRE) version 8.x or newer. The application doesn't run on earlier JRE versions. - ::: +DynamoDB will be run locally using the `serverless-dynamodb-local` plugin. -2. Extract the archive and copy its content to a location of your choice. +The `serverless-dynamodb-local` plugin requires -3. Open a terminal in the location where you've extracted your files and enter the following command: +- `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 - java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb + sls dynamodb install ``` - :::info - If you're using Windows PowerShell, be sure to enclose the parameter name or the entire name and value like this: +4. Run `DynamoDB` locally - `java -D"java.library.path=./DynamoDBLocal_lib" -jar DynamoDBLocal.jar` - ::: + ```bash + sls dynamodb start + ``` -4. DynamoDB is now running on port `8000`. To stop it, press `Ctrl+C` in the terminal. + This starts the DynamoDB Local instance as a local Java program (default: [http://localhost:8000](http://localhost:8000))