-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from aws-samples/feature/i18n-zh-ko
Feature/i18n zh ko
- Loading branch information
Showing
10 changed files
with
259 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Local development | ||
|
||
## Backend Development | ||
|
||
See [backend/README](../backend/README.md). | ||
|
||
## Frontend Development | ||
|
||
In this sample, you can locally modify and launch the frontend using AWS resources (`API Gateway`, `Cognito`, etc.) that have been deployed with `cdk deploy`. | ||
|
||
1. Refer to [Deploy using CDK](../README.md#deploy-using-cdk) for deploying on the AWS environment. | ||
2. Copy the `frontend/.env.template` and save it as `frontend/.env.local`. | ||
3. Fill in the contents of `.env.local` based on the output results of `cdk deploy` (such as `BedrockChatStack.AuthUserPoolClientIdXXXXX`). | ||
4. Execute the following command: | ||
|
||
```zsh | ||
cd frontend && npm ci && npm run dev | ||
``` | ||
|
||
### Using Streaming | ||
|
||
Currently, the environment variable `VITE_APP_USE_STREAMING` is specified on the frontend side. It's recommended to set it to `false` when running the backend locally and `true` when operating on AWS. | ||
When streaming is enabled, text is generated in real-time due to the streaming of content generation results. | ||
|
||
## Using docker compose | ||
|
||
If you prefer to handle all of resources as Docker, [docker-compose.yml](./docker-compose.yml) allows you to run and develop frontend / backend APIs / DynamoDB Local in your local environment. | ||
|
||
```bash | ||
# Build containers | ||
docker compose build | ||
|
||
# Launch containers | ||
docker compose up | ||
|
||
# Stop containers | ||
docker compose down | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# ローカル環境での開発 | ||
|
||
## バックエンド | ||
|
||
[backend/README](../backend/README.md)を参照下さい。 | ||
|
||
## フロントエンド | ||
|
||
現在このサンプルでは、`cdk deploy` された AWS リソース(API Gateway、Cognito など)を使用してローカルでフロントを立ち上げながら改変作業を加えることができます。 | ||
|
||
1. [Deploy using CDK](./README_ja.md#deploy-using-cdk) を参考に AWS 環境上にデプロイを行う | ||
2. `frontend/.env.template` 複製し `frontend/.env.local` という名前で保存する。 | ||
3. `.env.local` の中身を `cdk deploy` の出力結果(`BedrockChatStack.AuthUserPoolClientIdXXXXX` など)を見ながら穴埋めしていく | ||
4. 下記コマンドを実行する | ||
|
||
```zsh | ||
cd frontend && npm ci && npm run dev | ||
``` | ||
|
||
### ストリーミングの利用 | ||
|
||
現在、環境変数として `VITE_APP_USE_STREAMING` というのをフロントエンド側で指定しています。バックエンドをローカルで動かす場合は `false` に指定してただき、AWS で動かす場合は `true` にすることを推奨します。 | ||
Streaming を有効化すると文章生成結果がストリーミングされるためリアルタイムで文字列が生成されていきます。 | ||
|
||
### コンテナを利用したローカルでの開発について | ||
|
||
[docker-compose.yml](../docker-compose.yml) を利用することで、フロントエンド / バックエンド API / DynamoDB Local をローカル環境で動かし開発を行うことができます。 | ||
|
||
```bash | ||
# コンテナのビルド | ||
docker compose build | ||
|
||
# コンテナの起動 | ||
docker compose up | ||
|
||
# コンテナの停止 | ||
docker compose down | ||
``` |
Oops, something went wrong.