Skip to content

Commit

Permalink
release: 6.2435.68 (#703)
Browse files Browse the repository at this point in the history
* chore(deps): update pnpm to v9.7.0 (#604)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency framer-motion to v11.3.22 (#587)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency @floating-ui/react to v0.26.22 (#608)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency tailwindcss to v3.4.8 (#609)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency framer-motion to v11.3.23 (#610)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency @tanstack/react-table to v8.20.1 (#607)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update opensearchproject/opensearch-dashboards docker tag to v2.16.0 (#464)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: oauth sign in (#614)

* fix(deps): update dependency react-i18next to v15.0.1 (#611)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update opensearchproject/opensearch docker tag to v2.16.0 (#463)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency framer-motion to v11.3.24 (#618)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update aws-sdk-js-v3 monorepo to v3.626.0 (#605)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: issue cell (#623)

* fix: pagination and packages (#624)

* fix(deps): update dependency luxon to v3.5.0 (#613)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: minor bugs in web (#625)

* fix: minor bugs in web

* fix: remove console.log

* chore(deps): update dependency @nestjs/cli to v10.4.4 (#626)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @swc/core to v1.7.10 (#628)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @types/node to v20.14.15 (#629)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency tailwindcss to v3.4.10 (#619)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency i18next to v23.12.3 (#632)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @swc/core to v1.7.11 (#633)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency axios to v1.7.4 (#631)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency postcss-nesting to v13 (#616)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency nuqs to v1.17.8 (#620)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency turbo to v2.0.13 (#635)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update pnpm to v9.7.1 (#636)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency eslint-config-turbo to v2.0.13 (#637)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency @nestjs/axios to v3.0.3 (#634)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency framer-motion to v11.3.28 (#638)

fix(deps): update dependency framer-motion to v11.3.27

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update tanstack-query monorepo to v5.51.23 (#642)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency prettier-plugin-tailwindcss to v0.6.6 (#639)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency turbo to v2.0.14 (#643)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency eslint-config-turbo to v2.0.14 (#644)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency zustand to v4.5.5 (#640)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency i18next to v23.12.7 (#645)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency aws-sdk to v2.1676.0 (#612)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update aws-sdk-js-v3 monorepo to v3.632.0 (#646)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency sharp to v0.33.5 (#650)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @types/node to v20.16.0 (#651)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @playwright/test to v1.46.1 (#652)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency i18next to v23.13.0 (#649)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update aws-sdk-js-v3 monorepo to v3.633.0 (#653)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @swc/core to v1.7.12 (#655)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency tailwind-merge to v2.5.2 (#647)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update tanstack-query monorepo to v5.51.24 (#657)

fix(deps): update dependency @tanstack/react-query to v5.51.24

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @types/node to v20.16.1 (#656)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @swc/core to v1.7.14 (#659)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency iron-session to v8.0.3 (#660)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @tanstack/react-query-devtools to v5.51.24 (#658)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency aws-sdk to v2.1678.0 (#654)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: feedback fixture in api (#617)

* fix mysql version to 8.0.39 (#662)

* fix(deps): update dependency i18next to v23.14.0 (#661)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update nest monorepo (#648)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @types/react to v18.3.4 (#666)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update aws-sdk-js-v3 monorepo to v3.635.0 (#667)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix renovate settings for test (#665)

* fix renovate settings for test

* modifiy renovate.json

* modify renovate.json

* fix(deps): update dependency aws-sdk to v2.1679.0 (#668)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update tanstack-query monorepo to v5.52.0 (#669)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency framer-motion to v11.3.29 (#641)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency node to v20.17.0 (#670)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency aws-sdk to v2.1680.0 (#671)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update nextjs monorepo to v14.2.6 (#672)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update pnpm to v9.8.0 (#673)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update tanstack-query monorepo to v5.52.1 (#674)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency aws-sdk to v2.1681.0 (#675)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update aws-sdk-js-v3 monorepo to v3.637.0 (#676)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency @headlessui/react to v2.1.3 (#678)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency ts-jest to v29.2.5 (#677)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency axios to v1.7.5 (#679)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency framer-motion to v11.3.30 (#680)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @testing-library/jest-dom to v6.5.0 (#681)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency react-hook-form to v7.53.0 (#683)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @swc/core to v1.7.18 (#684)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency aws-sdk to v2.1682.0 (#682)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency @tanstack/react-table to v8.20.5 (#685)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency @t3-oss/env-nextjs to v0.11.1 (#687)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update tanstack-query monorepo to v5.52.2 (#689)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update pnpm to v9.9.0 (#688)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update nextjs monorepo to v14.2.7 (#691)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency turbo to v2.1.0 (#692)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency aws-sdk to v2.1684.0 (#690)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @types/node to v20.16.2 (#694)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency eslint-config-turbo to v2.1.0 (#695)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* implement auf-cli (#621)

* implement ufb-cli

* remove test for ufb-cli

* fix: package structure (#622)

* fix: package structure

* modify ufb-cli to run with npx

---------

Co-authored-by: jeehoon.choi <[email protected]>

* update pnpm-lock file

* fix format, lint

* fix ufb-cli init to not copy compose file

* update ufb-cli package version

* fix pnpm lock file

* fix ufb-cli script

* fix ufb-cli to version 1.0.18

* update ufb-cli to version 1.0.19

* fix ufb-cli to version 1.0.20

* fix ufb-cli to version 1.0.21

* supplement ufb-cli logic and README

* rename ufb-cli to auf-cli

* modify README

* fix pnpm-lock.yaml

* fix lint error

* fix test

* update auf-cli to version

* update auf-cli to version 1.0.5

* fix e2e test

* fix e2e test

* update auf-cli to version 1.0.6

* update auf-cli to version 1.0.7

* add README for clean command

* fix pnpm lock file

* update auf-cli to version 1.0.8

---------

Co-authored-by: Chiyoung Jeong <[email protected]>

* chore(deps): update dependency @swc/core to v1.7.19 (#696)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @swc/core to v1.7.21 (#700)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency aws-sdk to v2.1685.0 (#702)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: sign up bug (#697)

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Chiyoung Jeong <[email protected]>
Co-authored-by: chiol <[email protected]>
  • Loading branch information
4 people authored Aug 29, 2024
1 parent 7c00528 commit 6eb6631
Show file tree
Hide file tree
Showing 24 changed files with 1,579 additions and 904 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

services:
mysql:
image: mysql:9.0.1
image: mysql:8.0.39
env:
MYSQL_ROOT_PASSWORD: userfeedback
MYSQL_DATABASE: e2e
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.16.0
20.17.0
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,21 @@ You can configure the frontend for session password, maximum time span to query,

You can configure the backend for MySQL, SMTP for email verification, OpenSearch-powered improved search experience, etc.

## Setup Dev Environment (Local)
## Setup Dev Environment using Command Line Tool without Dependencies

ABC User Feedback supports a command line tool(`auf-cli`) that easily runs both the frontend and backend.

With this command line tool, you can initialize the infrastructure and run the app powered by a pre-configured Docker image. Since the CLI is executable with `npx`, only an `npm` environment is required, and no other dependencies are necessary.

```bash
npx auf-cli init # initialize infrastructure
npx auf-cli start # start app
npx auf-cli stop # stop app
```

Please refer to the following npm package site: https://www.npmjs.com/package/auf-cli

## Setup Dev Environment Manually (Local)

ABC User Feedback is using a monorepo (powered by [TurboRepo](https://turbo.build/)) with multiple apps and packages.

Expand Down
2 changes: 1 addition & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"@types/express": "^4.17.21",
"@types/jest": "^29.5.12",
"@types/luxon": "^3.4.2",
"@types/node": "20.14.15",
"@types/node": "20.16.2",
"@types/nodemailer": "^6.4.15",
"@types/passport-jwt": "*",
"@types/supertest": "^6.0.2",
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/test-utils/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ export const getRandomValue = (
};

const getRandomOptionEntities = () => {
const length = faker.number.int(10);
const length = faker.number.int({ min: 1, max: 10 });
return Array.from({ length }).map(() => ({
id: faker.number.int(),
name: faker.string.sample(),
}));
};
const getRandomOptionDtos = () => {
const length = faker.number.int(10);
const length = faker.number.int({ min: 1, max: 10 });
return Array.from({ length }).map(() => {
const randomValue = faker.string.sample();
return {
Expand Down
49 changes: 49 additions & 0 deletions apps/cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# ABC User Feedback CLI

The ABC User Feedback CLI helps you easily run web frontends and servers.

[ABC User Feedback](https://github.com/line/abc-user-feedback) is a standalone web application that manages Voice of Customer (VoC) data, allowing you to gather and organize feedback from your customers.

## Prerequisites

- [Node.js v20 or above](https://nodejs.org/en/download/)
- [Docker](https://docs.docker.com/desktop/)

## Running without dependency

You can run this cli with [npx](https://docs.npmjs.com/cli/v8/commands/npx), so there's no need to install additional dependencies or clone the repository. Regardless of your operating system or environment, you can run servers with just the prerequisites mentioned above.

There are `npx` commands for setting up the infrastructure, starting servers, and stopping servers.

## Initialization

The following command sets up the infrastructure(MySQL, SMTP, OpenSearch) based on your architecture(ARM/AMD).
It also creates a `config.toml` file where you can configure environment variables to start the servers.

```sh
npx auf-cli init
```

## Start Servers

Based on `config.toml` file created during the initialization phase, this command generates a Docker Compose file. Using this Docker Compose file, the following command starts the API and web servers.

```sh
npx auf-cli start
```

## Stop Servers

The following command stops the API and web servers.

```sh
npx auf-cli stop
```

## Clean Mounted Volumes

The following command clean the mounted docker volumes created during initialization.

```sh
npx auf-cli clean
```
226 changes: 226 additions & 0 deletions apps/cli/bin/auf-cli.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
#!/usr/bin/env node
/**
* Copyright 2023 LINE Corporation
*
* LINE Corporation licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
import { execSync } from 'child_process';
import * as fs from 'fs';
import os from 'os';
import * as path from 'path';
import { Command } from 'commander';
import { load } from 'js-toml';

const program = new Command();

program.description(
'ABC User Feedback CLI that helps to run web frontend and server easily.',
);

function getArchitectureType() {
const arch = os.arch();

switch (arch) {
case 'arm':
case 'arm64':
return 'arm';
case 'ia32':
case 'x32':
case 'x64':
return 'amd';
default:
return 'arm';
}
}

program
.command('init')
.description(
'Start the appropriate Docker Compose file based on architecture to setup the ABC User Feedback infrastructure.',
)
.action(() => {
const architecture = getArchitectureType();
console.log(`Your system architecture is detected as: ${architecture}`);

const composeFile =
architecture === 'amd' ?
'docker-compose.infra-amd64.yml'
: 'docker-compose.infra-arm64.yml';

const composeFilePath = path.join(__dirname + '/../', composeFile);
console.log(
`Terminates existing Docker Compose with auf-cli project name...`,
);
execSync(`docker compose -p auf-cli down`);

console.log(`Running Docker Compose with ${composeFilePath.toString()}...`);
execSync(
`docker compose -p auf-cli -f ${composeFilePath.toString()} up -d`,
{
stdio: 'inherit',
},
);

const sourceConfigPath = path.join(__dirname + '/../config.toml');
const destinationConfigPath = path.join(process.cwd(), 'config.toml');
fs.copyFileSync(sourceConfigPath, destinationConfigPath);
console.log(
'config.toml has been created. Please fill in the required environment variables.',
);
});

program
.command('start')
.description(
'Pull ABC User Feedback Docker image and run container with environment variables',
)
.action(() => {
if (fs.existsSync(path.join(process.cwd(), 'config.toml')) === false) {
console.error(
'config.toml file is missing. Please run "npx auf-cli init" first.',
);
return;
}

const destinationConfigPath = path.join(process.cwd(), 'config.toml');

const templatePath = path.join(
__dirname + '/../docker-compose.template.yml',
);

interface TomlConfig {
web: Record<string, string>;
api: Record<string, string>;
}

const tomlContent = fs.readFileSync(destinationConfigPath, 'utf-8');
const tomlConfig = load(tomlContent) as TomlConfig;

const webEnvVars = [
'NEXT_PUBLIC_API_BASE_URL',
'NEXT_PUBLIC_MAX_DAYS',
'API_BASE_URL',
'SESSION_PASSWORD',
];

const apiEnvVars = [
'JWT_SECRET',
'MYSQL_PRIMARY_URL',
'BASE_URL',
'SMTP_HOST',
'SMTP_PORT',
'SMTP_SENDER',
'SMTP_BASE_URL',
'AUTO_MIGRATION',
'MASTER_API_KEY',
'NODE_OPTIONS',
];

const missingWebEnvVars = webEnvVars.filter(
(varName) => !tomlConfig.web[varName],
);
const missingApiEnvVars = apiEnvVars.filter(
(varName) => !tomlConfig.api[varName],
);

if (missingWebEnvVars.length > 0) {
console.error(
`Missing required environment variables for web service: ${missingWebEnvVars.join(', ')}`,
);
process.exit(1);
}

if (missingApiEnvVars.length > 0) {
console.error(
`Missing required environment variables for api service: ${missingApiEnvVars.join(', ')}`,
);
process.exit(1);
}

let dockerComposeTemplate = fs.readFileSync(templatePath, 'utf-8');

webEnvVars.forEach((varName) => {
const regex = new RegExp(`\\$\\{${varName}\\}`, 'g');
dockerComposeTemplate = dockerComposeTemplate.replace(
regex,
tomlConfig.web[varName],
);
});
apiEnvVars.forEach((varName) => {
const regex = new RegExp(`\\$\\{${varName}\\}`, 'g');
dockerComposeTemplate = dockerComposeTemplate.replace(
regex,
tomlConfig.api[varName],
);
});

const dockerComposePath = path.resolve(
process.cwd(),
'docker-compose.generated.yml',
);
fs.writeFileSync(dockerComposePath, dockerComposeTemplate);

console.log('docker-compose.generated.yml has been created');

const apiDockerImage = 'line/abc-user-feedback-api';
const webDockerImage = 'line/abc-user-feedback-web';

console.log(`Pulling Docker image ${apiDockerImage}, ${webDockerImage}...`);
execSync(`docker pull ${apiDockerImage}`);
execSync(`docker pull ${webDockerImage}`);

const dockerComposeCommand = `docker compose -p auf-cli -f ${dockerComposePath} up -d`;
console.log(`Running Docker Compose with command: ${dockerComposeCommand}`);
execSync(dockerComposeCommand);

console.log(
'\x1b[32m',
'\nStarted ABC User Feedback services.\n',
'\x1b[0m',
);
const serviceInfos = {
'API URL': 'http://localhost:4000',
'WEB URL': 'http://localhost:3000',
'DB URL': 'http://localhost:13306',
'OPENSEARCH URL': 'http://localhost:9200',
'OPENSEARCH ADMIN URL': 'http://localhost:5601',
'WEB ACCOUNT ID': '[email protected]',
'WEB ACCOUNT PASSWORD': '12345678',
JWT_SECRET: tomlConfig.api.JWT_SECRET,
};

for (const [key, value] of Object.entries(serviceInfos)) {
console.log(`${key.padStart(20)}: ${value}`);
}
});

program
.command('stop')
.description('Stop the running Docker containers for app and web services')
.action(() => {
const dockerComposeCommand = `docker compose -p auf-cli down`;
console.log(
`Stopping Docker Compose with command: ${dockerComposeCommand}`,
);
execSync(dockerComposeCommand);
});

program
.command('clean')
.description('Delete existing mounted docker volumes')
.action(() => {
console.log('Deletes existing mounted docker volumes...');
execSync(`rm -rf ${path.join(__dirname, '../volumes')}`);
});

program.parse(process.argv);
22 changes: 22 additions & 0 deletions apps/cli/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[api]
MYSQL_PRIMARY_URL="mysql://root:[email protected]:13306/userfeedback"
# MYSQL_SECONDARY_URLS= ["mysql://root:[email protected]:13306/userfeedback"]
OPENSEARCH_USE=true
OPENSEARCH_NODE="http://localhost:9200"
OPENSEARCH_USERNAME="UserFeedback123!@#"
SMTP_HOST="localhost"
SMTP_PORT=25
SMTP_SENDER="[email protected]"
SMTP_BASE_URL="http://localhost:3000"
AUTO_MIGRATION=true
NODE_OPTIONS="--max_old_space_size=3072"
BASE_URL="http://localhost:3000"
JWT_SECRET="secret"
OPENSEARCH_PASSWORD="UserFeedback123!@#"
MASTER_API_KEY="MASTER_API_KEY"

[web]
NEXT_PUBLIC_API_BASE_URL="http://localhost:4000"
API_BASE_URL="http://host.docker.internal:4000"
NEXT_PUBLIC_MAX_DAYS=90
SESSION_PASSWORD="sessionpasswordsessionpasswordsessionpassword"
Loading

0 comments on commit 6eb6631

Please sign in to comment.