Skip to content

Commit 8ca54b0

Browse files
authored
Merge pull request #1561 from line/feat/docs
docs
2 parents c97f639 + 0dd7fbc commit 8ca54b0

File tree

175 files changed

+26530
-2979
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+26530
-2979
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,17 @@ name: CI
22

33
on:
44
pull_request:
5-
branches: ["*"]
5+
branches: ['*']
66
push:
7-
branches: ["main"]
7+
branches: ['main']
88
merge_group:
99

1010
concurrency:
1111
group: ${{ github.workflow }}-${{ github.ref }}
1212
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
1313

14-
# You can leverage Vercel Remote Caching with Turbo to speed up your builds
15-
# @link https://turborepo.org/docs/core-concepts/remote-caching#remote-caching-on-vercel-builds
1614
env:
1715
FORCE_COLOR: 3
18-
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
19-
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
2016
CI: true
2117

2218
jobs:
@@ -66,12 +62,9 @@ jobs:
6662
echo "JWT_SECRET=${{ vars.TEST_JWT_SECRET }}" >> ./apps/api/.env.test
6763
echo "OPENSEARCH_USE=true" >> ./apps/api/.env.test
6864
echo "OPENSEARCH_NODE=http://localhost:9200" >> ./apps/api/.env.test
69-
echo "OPENSEARCH_USERNAME=''" >> ./apps/api/.env.test
70-
echo "OPENSEARCH_PASSWORD=''" >> ./apps/api/.env.test
7165
echo "SMTP_HOST='localhost'" >> ./apps/api/.env.test
7266
echo "SMTP_PORT=25" >> ./apps/api/.env.test
7367
echo "SMTP_SENDER='[email protected]'" >> ./apps/api/.env.test
74-
echo "SMTP_BASE_URL='http://localhost:3000'" >> ./apps/api/.env.test
7568
7669
- name: Run Tests
7770
run: pnpm test
@@ -84,7 +77,6 @@ jobs:
8477
echo "SMTP_HOST='localhost'" >> ./apps/api/.env.test
8578
echo "SMTP_PORT=25" >> ./apps/api/.env.test
8679
echo "SMTP_SENDER='[email protected]'" >> ./apps/api/.env.test
87-
echo "SMTP_BASE_URL='http://localhost:3000'" >> ./apps/api/.env.test
8880
8981
- name: Run Tests
9082
run: pnpm test

.github/workflows/docker-dev-image.yml

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@ on:
66
- '**-dev'
77

88
jobs:
9-
api-build:
9+
build:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout repo
1313
uses: actions/checkout@v5
1414

15-
- name: Docker meta
15+
- name: Set up Docker Buildx
16+
uses: docker/setup-buildx-action@v3
17+
with:
18+
driver: docker-container
19+
20+
- name: Docker meta for API
1621
id: api-meta
1722
uses: docker/metadata-action@v5
1823
with:
@@ -23,29 +28,7 @@ jobs:
2328
type=semver,pattern={{version}}
2429
type=semver,pattern={{major}}.{{minor}}
2530
26-
- name: Login to DockerHub
27-
if: github.event_name != 'pull_request'
28-
uses: docker/login-action@v3
29-
with:
30-
username: ${{ secrets.DOCKERHUB_USERNAME }}
31-
password: ${{ secrets.DOCKERHUB_TOKEN }}
32-
33-
- name: Build and push API
34-
uses: docker/build-push-action@v6
35-
with:
36-
context: .
37-
file: ./docker/api.dockerfile
38-
push: ${{ github.event_name != 'pull_request' }}
39-
tags: ${{ steps.api-meta.outputs.tags }}
40-
labels: ${{ steps.api-meta.outputs.labels }}
41-
42-
web-build:
43-
runs-on: ubuntu-latest
44-
steps:
45-
- name: Checkout repo
46-
uses: actions/checkout@v5
47-
48-
- name: Docker meta
31+
- name: Docker meta for Web
4932
id: web-meta
5033
uses: docker/metadata-action@v5
5134
with:
@@ -63,11 +46,12 @@ jobs:
6346
username: ${{ secrets.DOCKERHUB_USERNAME }}
6447
password: ${{ secrets.DOCKERHUB_TOKEN }}
6548

66-
- name: Build and push Web
67-
uses: docker/build-push-action@v6
49+
- name: Bake and push multi-platform Docker images
50+
uses: docker/bake-action@v4
6851
with:
69-
context: .
70-
file: ./docker/web.dockerfile
71-
push: ${{ github.event_name != 'pull_request' }}
72-
tags: ${{ steps.web-meta.outputs.tags }}
73-
labels: ${{ steps.web-meta.outputs.labels }}
52+
files: |
53+
./docker/docker-bake.hcl
54+
push: true
55+
set: |
56+
api.tags=${{ steps.api-meta.outputs.tags }}
57+
web.tags=${{ steps.web-meta.outputs.tags }}

.github/workflows/docker-prod-image.yml

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,18 @@ on:
88
- '!**-dev'
99

1010
jobs:
11-
api-build:
11+
build:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout repo
1515
uses: actions/checkout@v5
1616

17-
- name: Docker meta
17+
- name: Set up Docker Buildx
18+
uses: docker/setup-buildx-action@v3
19+
with:
20+
driver: docker-container
21+
22+
- name: Docker meta for API
1823
id: api-meta
1924
uses: docker/metadata-action@v5
2025
with:
@@ -25,29 +30,7 @@ jobs:
2530
type=semver,pattern={{version}}
2631
type=semver,pattern={{major}}.{{minor}}
2732
28-
- name: Login to DockerHub
29-
if: github.event_name != 'pull_request'
30-
uses: docker/login-action@v3
31-
with:
32-
username: ${{ secrets.DOCKERHUB_USERNAME }}
33-
password: ${{ secrets.DOCKERHUB_TOKEN }}
34-
35-
- name: Build and push API
36-
uses: docker/build-push-action@v6
37-
with:
38-
context: .
39-
file: ./docker/api.dockerfile
40-
push: ${{ github.event_name != 'pull_request' }}
41-
tags: ${{ steps.api-meta.outputs.tags }}
42-
labels: ${{ steps.api-meta.outputs.labels }}
43-
44-
web-build:
45-
runs-on: ubuntu-latest
46-
steps:
47-
- name: Checkout repo
48-
uses: actions/checkout@v5
49-
50-
- name: Docker meta
33+
- name: Docker meta for Web
5134
id: web-meta
5235
uses: docker/metadata-action@v5
5336
with:
@@ -65,11 +48,12 @@ jobs:
6548
username: ${{ secrets.DOCKERHUB_USERNAME }}
6649
password: ${{ secrets.DOCKERHUB_TOKEN }}
6750

68-
- name: Build and push Web
69-
uses: docker/build-push-action@v6
51+
- name: Bake and push multi-platform Docker images
52+
uses: docker/bake-action@v4
7053
with:
71-
context: .
72-
file: ./docker/web.dockerfile
73-
push: ${{ github.event_name != 'pull_request' }}
74-
tags: ${{ steps.web-meta.outputs.tags }}
75-
labels: ${{ steps.web-meta.outputs.labels }}
54+
files: |
55+
./docker/docker-bake.hcl
56+
push: true
57+
set: |
58+
api.tags=${{ steps.api-meta.outputs.tags }}
59+
web.tags=${{ steps.web-meta.outputs.tags }}

.github/workflows/e2e-test.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,29 @@ jobs:
3939
ports:
4040
- 9200:9200
4141
steps:
42-
- name: Check out repository code
43-
uses: actions/checkout@v4
42+
- uses: actions/checkout@v5
4443

45-
- name: Setup e2e test
46-
run: |
47-
npm install -g corepack@latest
48-
corepack enable
49-
pnpm install --frozen-lockfile
50-
pnpm playwright install
44+
- name: Setup
45+
uses: ./tooling/github/setup
46+
47+
- name: Cache Playwright browsers
48+
uses: actions/cache@v3
49+
id: playwright-cache
50+
with:
51+
path: ~/.cache/ms-playwright
52+
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
53+
54+
- name: Install Playwright Browsers
55+
if: steps.playwright-cache.outputs.cache-hit != 'true'
56+
run: pnpm exec playwright install --with-deps chromium
5157

5258
- name: Run e2e tests
5359
run: |
5460
CI=true pnpm test:e2e
61+
62+
- uses: actions/upload-artifact@v4
63+
if: always() && !cancelled()
64+
with:
65+
name: playwright-report
66+
path: apps/e2e/playwright-report/
67+
retention-days: 7

.github/workflows/integration-test.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
services:
1212
mysql:
13-
image: mysql:8.0.39
13+
image: mysql:8.0
1414
env:
1515
MYSQL_ROOT_PASSWORD: userfeedback
1616
MYSQL_DATABASE: e2e
@@ -49,24 +49,20 @@ jobs:
4949

5050
steps:
5151
- name: Check out repository code
52-
uses: actions/checkout@v4
52+
uses: actions/checkout@v5
5353

5454
- name: Setup integration test (with opensearch)
5555
run: |
5656
npm install -g corepack@latest
5757
corepack enable
5858
pnpm install --frozen-lockfile
5959
pnpm build
60-
echo "BASE_URL=http://localhost:3000" >> ./apps/api/.env
6160
echo "JWT_SECRET=DEV" >> ./apps/api/.env
6261
echo "OPENSEARCH_USE=true" >> ./apps/api/.env
6362
echo "OPENSEARCH_NODE=http://localhost:9200" >> ./apps/api/.env
64-
echo "OPENSEARCH_USERNAME=''" >> ./apps/api/.env
65-
echo "OPENSEARCH_PASSWORD=''" >> ./apps/api/.env
6663
echo "SMTP_HOST='localhost'" >> ./apps/api/.env
6764
echo "SMTP_PORT=25" >> ./apps/api/.env
6865
echo "SMTP_SENDER='[email protected]'" >> ./apps/api/.env
69-
echo "SMTP_BASE_URL='http://localhost:3000'" >> ./apps/api/.env
7066
7167
- name: Run integration tests (with opensearch)
7268
run: |

.github/workflows/publish-api-docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
services:
1212
mysql:
13-
image: mysql:8.0.39
13+
image: mysql:8.0
1414
env:
1515
MYSQL_ROOT_PASSWORD: userfeedback
1616
MYSQL_DATABASE: userfeedback
@@ -22,7 +22,7 @@ jobs:
2222

2323
steps:
2424
- name: Check out repository code
25-
uses: actions/checkout@v4
25+
uses: actions/checkout@v5
2626

2727
- name: Build app and swagger docs
2828
run: |
@@ -36,7 +36,7 @@ jobs:
3636
- name: Run Redocly CLI
3737
uses: fluximus-prime/redocly-cli-github-action@v1
3838
with:
39-
args: "build-docs apps/api/swagger.json --output docs/index.html"
39+
args: 'build-docs apps/api/swagger.json --output docs/index.html'
4040

4141
- name: Deploy to GitHub Pages
4242
uses: peaceiris/actions-gh-pages@v3

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@ volumes
4444
.cache
4545

4646
# playwright
47-
playwright-report
48-
test-results
49-
user.json
47+
48+
test-results/
49+
playwright-report/
50+
blob-report/
51+
playwright/
5052

5153
# JetBrains
5254
.idea

README.md

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,7 @@
22

33
![cover image](./assets/cover.png)
44

5-
ABC User Feedback is a standalone web application designed to manage Voice of Customer (VOC) data. It enables you to efficiently gather and categorize customer feedback. With AI-powered insights, you can manage feedback more effectively. The application is currently utilized in services reaching 10 million monthly active users (MAU).
6-
## Quick Start
7-
8-
To quickly set up and run the application locally, follow these steps:
9-
10-
1. **Clone the Repository**:
11-
12-
```bash
13-
git clone https://github.com/line/abc-user-feedback
14-
cd abc-user-feedback
15-
```
16-
17-
2. **Install Dependencies**:
18-
19-
```bash
20-
pnpm install
21-
```
22-
23-
3. **Start the Application**:
24-
```bash
25-
npx auf-cli init
26-
npx auf-cli start
27-
```
28-
29-
For more detailed setup instructions, refer to the [Getting Started](#getting-started) section.
5+
ABC User Feedback is a standalone web application designed to manage Voice of Customer (VoC) data. It enables you to efficiently gather and categorize customer feedback. The application is currently utilized in services with a reach of 10 million MAU.
306

317
<p align="center">
328
<video src="https://github.com/user-attachments/assets/a2ef7a1a-41ec-4cec-b7d1-bda5fbd7d48b" width="100%" />
@@ -78,9 +54,7 @@ Before you begin, ensure you have the following installed:
7854
- SMTP - for mail verification during making accounts
7955
- [OpenSearch v2.16](https://opensearch.org/) - for performance on searching feedback
8056

81-
You can use the [docker-compose.infra-amd64.yml](/docker/docker-compose.infra-amd64.yml) file for requirements.
82-
83-
For ARM architecture, use the [docker-compose.infra-arm64.yml](/docker/docker-compose.infra-arm64.yml) file.
57+
You can use the [docker-compose.infra.yml](/docker/docker-compose.infra.yml) file for requirements.
8458

8559
### Docker Hub Images
8660

@@ -149,7 +123,7 @@ npm run migration:run
149123
pnpm dev
150124
```
151125

152-
### Build Docker Image
126+
### Option3. Build Docker Image
153127

154128
For your code build, you can build a Docker image using Docker Compose. Refer to [remote caching](https://turbo.build/repo/docs/core-concepts/remote-caching) and [deploying with Docker](https://turbo.build/repo/docs/handbook/deploying-with-docker) using `turborepo`.
155129

apps/api/.env.example

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ JWT_SECRET=DEV
33

44
MYSQL_PRIMARY_URL=mysql://userfeedback:userfeedback@localhost:13306/userfeedback # required
55

6-
BASE_URL=http://localhost:3000 # default: http://localhost:3000
7-
86
ACCESS_TOKEN_EXPIRED_TIME=10m # default: 10m
9-
REFESH_TOKEN_EXPIRED_TIME=1h # default: 1h
7+
REFRESH_TOKEN_EXPIRED_TIME=1h # default: 1h
108

119
# Optional enviroment variables
1210

@@ -17,22 +15,21 @@ REFESH_TOKEN_EXPIRED_TIME=1h # default: 1h
1715

1816
SMTP_HOST=localhost # required
1917
SMTP_PORT=25 # required
18+
SMTP_SENDER=[email protected] # required
2019
# SMTP_USERNAME= # optional
2120
# SMTP_PASSWORD= # optional
22-
SMTP_SENDER=[email protected] # required
23-
SMTP_BASE_URL=http://localhost:3000 # required
2421
# SMTP_TLS= # default: false
2522
# SMTP_CIPHER_SPEC= # default: TLSv1.2 if SMTP_TLS=true
2623
# SMTP_OPPORTUNISTIC_TLS= # default: true if SMTP_TLS=true
2724

2825
# OPENSEARCH_USE=false # default: false
2926
# OPENSEARCH_NODE= # required if OPENSEARCH_USE=true
30-
# OPENSEARCH_USERNAME= # required if OPENSEARCH_USE=true
31-
# OPENSEARCH_PASSWORD= # required if OPENSEARCH_USE=true
27+
# OPENSEARCH_USERNAME= # optional
28+
# OPENSEARCH_PASSWORD= # optional
3229

3330
# AUTO_MIGRATION=true # default: true
3431

3532
# MASTER_API_KEY= # default: none
3633

37-
# ENABLE_AUTO_FEEDBACK_DELETION=false # default: false
34+
# AUTO_FEEDBACK_DELETION_ENABLED=false # default: false
3835
# AUTO_FEEDBACK_DELETION_PERIOD_DAYS=365*5

0 commit comments

Comments
 (0)