Skip to content

Commit

Permalink
Merge pull request #69 from line/beta
Browse files Browse the repository at this point in the history
release: 3.2343.14
  • Loading branch information
h4l-yup authored Oct 26, 2023
2 parents e0fef33 + ae9d62b commit ad655d1
Show file tree
Hide file tree
Showing 467 changed files with 10,392 additions and 8,417 deletions.
5 changes: 3 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
**/node_modules
**/.next
**/.turbo
**/dist
**/.env*
!apps/web/.env.build
!apps/web/.env.build
docker
volumes
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

3 changes: 0 additions & 3 deletions .eslintrc.js

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/docker-beta-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
file: ./apps/api/Dockerfile
file: ./docker/api.dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.api-meta.outputs.tags }}
labels: ${{ steps.api-meta.outputs.labels }}
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
file: ./apps/web/Dockerfile
file: ./docker/web.dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.web-meta.outputs.tags }}
labels: ${{ steps.web-meta.outputs.labels }}
4 changes: 2 additions & 2 deletions .github/workflows/docker-dev-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
file: ./apps/api/Dockerfile
file: ./docker/api.dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.api-meta.outputs.tags }}
labels: ${{ steps.api-meta.outputs.labels }}
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
file: ./apps/web/Dockerfile
file: ./docker/web.dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.web-meta.outputs.tags }}
labels: ${{ steps.web-meta.outputs.labels }}
4 changes: 2 additions & 2 deletions .github/workflows/docker-prod-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
file: ./apps/api/Dockerfile
file: ./docker/api.dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.api-meta.outputs.tags }}
labels: ${{ steps.api-meta.outputs.labels }}
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
file: ./apps/web/Dockerfile
file: ./docker/web.dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.web-meta.outputs.tags }}
labels: ${{ steps.web-meta.outputs.labels }}
29 changes: 29 additions & 0 deletions .github/workflows/test-on-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Run Tests On Pull Request

on:
pull_request:
branches: [dev, beta, main]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@v2

- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install Dependencies
run: yarn install --immutable --immutable-cache --check-cache

- name: setup environment variables
run: |
echo "JWT_SECRET=${{ vars.TEST_JWT_SECRET }}" >> ./apps/api/.env.test
echo "OS_USE=${{ vars.TEST_OS_USE }}" >> ./apps/api/.env.test
- name: Run Tests
run: yarn test
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,14 @@ yarn-error.log*
.env.production.local

# turbo
.turbo
!.turbo/.gitkeep
**/.turbo

# .env
.env*
!.env.example
!.env.build


.vscode
volumes

dist
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn typecheck
yarn format
yarn lint
11 changes: 0 additions & 11 deletions .prettierignore

This file was deleted.

8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

Empty file added .turbo/.gitkeep
Empty file.
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"bradlc.vscode-tailwindcss",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"expo.vscode-expo-tools",
"yoavbls.pretty-ts-errors"
]
}
15 changes: 15 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"eslint.rules.customizations": [{ "rule": "*", "severity": "warn" }],
"eslint.workingDirectories": [
{ "pattern": "apps/*/" },
{ "pattern": "packages/*/" },
{ "pattern": "tooling/*/" }
],
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsdk": "node_modules/typescript/lib"
}
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ docker pull line/abc-user-feedback-api

#### Required

- [Node.js v16 or above](https://nodejs.org/en/download/)
- [Node.js v18 or above](https://nodejs.org/en/download/)
- [Docker](https://docs.docker.com/desktop/)
- [MySQL v8](https://www.mysql.com/downloads/)

Expand Down Expand Up @@ -93,6 +93,16 @@ npm run migration:run
yarn dev
```

6. Also, you can run the `dev` target of one of apps in root directory:

```bash
# web
yarn turbo run dev --filter=web

# api
yarn turbo run dev --filter=api
```

You can always find more information in each app/library's respective README.md file.

### Setting Up ABC User Feedback Manually
Expand All @@ -110,7 +120,7 @@ The client is based on React, React Hook Form, React Query, Tailwind css, MUI, a

### Build Docker Image

For your code build, you can buile docker image using docker-compose
For your code build, you can buile docker image using docker-compose. Please 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

```
docker-compose build
Expand Down
18 changes: 11 additions & 7 deletions apps/api/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ JWT_SECRET= # required
MYSQL_PRIMARY_URL= # default: mysql://userfeedback:userfeedback@localhost:13306/userfeedback
MYSQL_SECONDARY_URLS= # default: ["mysql://userfeedback:userfeedback@localhost:13306/userfeedback"]

SMTP_HOST= # default: localhost
SMTP_PORT= # default: 25
SMTP_USERNAME= # default: ''
SMTP_PASSWORD= # default: ''
SMTP_SENDER= # default: [email protected]
SMTP_BASE_URL= # default: http://localhost:3000
SMTP_USE= # default: false
SMTP_HOST= # required if SMTP_USE=true
SMTP_PORT= # required if SMTP_USE=true
SMTP_USERNAME= # required if SMTP_USE=true
SMTP_PASSWORD= # required if SMTP_USE=true
SMTP_SENDER= # required if SMTP_USE=true
SMTP_BASE_URL= # required if SMTP_USE=true

OS_USE= # default: false
OS_NODE= # default: http://localhost:9200
Expand All @@ -21,4 +22,7 @@ APP_ADDRESS= # default: 0.0.0.0
AUTO_MIGRATION= # default: false

MASTER_API_KEY= # default: none
BASE_URL= # default: http://localhost:3000
BASE_URL= # default: http://localhost:3000

ACCESS_TOKEN_EXPIRED_TIME= # default: 10m
REFESH_TOKEN_EXPIRED_TIME= # default: 1h
2 changes: 1 addition & 1 deletion apps/api/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
root: true,
extends: ['ufb'],
extends: ['@ufb/eslint-config/base', '@ufb/eslint-config/nestjs'],
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
Expand Down
35 changes: 0 additions & 35 deletions apps/api/.gitignore

This file was deleted.

46 changes: 27 additions & 19 deletions apps/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,25 +70,33 @@ npm run migration:run

## Environment Variables

| Environment | Description | Default Value |
| -------------------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| JWT_SECRET | JWT secret | # required |
| MYSQL_PRIMARY_URL | mysql url | mysql://userfeedback:userfeedback@localhost:13306/userfeedback |
| MYSQL_SECONDARY_URLS | mysql sub urls (must be json array format) | ["mysql://userfeedback:userfeedback@localhost:13306/userfeedback"] |
| SMTP_HOST | smtp server host | localhost |
| SMTP_PORT | smtp server port | 25 |
| SMTP_USERNAME | smtp auth username | |
| SMTP_PASSWORD | smtp auth password | |
| SMTP_SENDER | mail sender email | [email protected] |
| SMTP_BASE_URL | default UserFeedback URL for mail to be redirected | http://localhost:3000 |
| APP_PORT | the post that the server is running on | 4000 |
| APP_ADDRESS | the address that the server is running on | 0.0.0.0 |
| OS_NODE | opensearch node url | http://localhost:9200 |
| OS_USERNAME | opensearch username if exists | |
| OS_PASSWORD | opensearch password if exists | |
| AUTO_MIGRATION | set 'true' if you want to make the database migration automatically | |
| MASTER_API_KEY | set a key if you want to make a master key for creating feedback | |
| NODE_OPTIONS | set some options if you want to add for node execution (e.g. max_old_space_size) | |
| Environment | Description | Default Value |
| ------------------------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| JWT_SECRET | JWT secret | # required |
| MYSQL_PRIMARY_URL | mysql url | mysql://userfeedback:userfeedback@localhost:13306/userfeedback |
| MYSQL_SECONDARY_URLS | mysql sub urls (must be json array format) | ["mysql://userfeedback:userfeedback@localhost:13306/userfeedback"] |
| SMTP_USE | flag for using smtp server (for email verification on creating user) | false |
| SMTP_HOST | smtp server host | localhost |
| SMTP_PORT | smtp server port | 25 |
| SMTP_USERNAME | smtp auth username | |
| SMTP_PASSWORD | smtp auth password | |
| SMTP_SENDER | mail sender email | [email protected] |
| SMTP_BASE_URL | default UserFeedback URL for mail to be redirected | http://localhost:3000 |
| APP_PORT | the post that the server is running on | 4000 |
| APP_ADDRESS | the address that the server is running on | 0.0.0.0 |
| OS_USE | flag for using opensearch (for better performance on searching feedbacks) | false |
| OS_NODE | opensearch node url | http://localhost:9200 |
| OS_USERNAME | opensearch username if exists | |
| OS_PASSWORD | opensearch password if exists | |
| AUTO_MIGRATION | set 'true' if you want to make the database migration automatically | |
| MASTER_API_KEY | set a key if you want to make a master key for creating feedback | |
| NODE_OPTIONS | set some options if you want to add for node execution (e.g. max_old_space_size) | |
| ACCESS_TOKEN_EXPIRED_TIME | set expired time of access token | 10m |
| REFESH_TOKEN_EXPIRED_TIME | set expired time of refresh token | 1h |

## Swagger

The swagger documentation can be found on the `/docs` endpoint.

## Learn More

Expand Down
Loading

0 comments on commit ad655d1

Please sign in to comment.