Skip to content

Latest commit

 

History

History
83 lines (53 loc) · 2.94 KB

File metadata and controls

83 lines (53 loc) · 2.94 KB

Saleor App Payment NP Atobarai (NP 後払い)

Local development setup

Prerequisites

Running app locally in development containers

Important

You can use the devcontainer Dockerfile and docker-compose.yaml directly - but remember to run pnpm install manually

The easiest way to run Saleor for local development is to use development containers. If you have Visual Studio Code, follow their guide on how to open an existing folder in a container.

The development container only creates a container; you still need to start the server.

The development container will have two ports opened:

  1. 3000 - where the app dev server will listen for requests

Running app in development mode

  1. Install the dependencies by running the following command in the shell:
pnpm install
  1. Create a file named .env and use the contents of the .env.example file as a reference.

  2. Start the development server by running the following command in the shell:

pnpm dev
  1. The app will be available under http://localhost:3000.

Note

To install app in Saleor Cloud, you need to expose your local server to the internet (tunnel). You can use Saleor CLI to do that. See this guide for more details.

  1. Install app on the Saleor dashboard.

Bruno

Bruno is an open source tool for exploring and testing APIs. It's similar to Postman or Insomnia.

This app has a collection of requests to Saleor that allows to pay for checkout with NP Atobarai app.

To get started create .env file based on .env.example inside apps/np-atobarai/bruno folder.

DynamoDB

DynamoDB is used to store app's configuration. To develop this feature locally use development containers or use docker-compose from .devcontainer:

  1. Run docker compose up dynamodb for local DynamoDB instance
  2. Run pnpm run setup-dynamodb to describe DynamoDB table

Ensure following env variables are set:

TABLE_NAME=np-atobarai-main-table # must match scripts/setup-dynamodb.ts
AWS_REGION=localhost
AWS_ENDPOINT_URL=http://localhost:8000
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

Alternatively, you can connect to AWS-based DynamoDB:

  1. Create table in your AWS, based on parameters in scripts/setup-dynamodb.ts
  2. Set AWS-specific env variables