Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release:2023/8/28 #81

Merged
merged 89 commits into from
Aug 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
becb092
Merge pull request #60 from nkc-ug/main
MinamizonoEno Jul 31, 2023
cd8d69c
init ci
Jul 31, 2023
bc081f3
ciサン怒らないで
Jul 31, 2023
7b1cc75
ci怒んないで?
Jul 31, 2023
045fb1b
ci no angele
Jul 31, 2023
7a4d505
Merge pull request #61 from nkc-ug/futer/ci
hayatosuzuki3228 Jul 31, 2023
bbaac20
init cxi
Jul 31, 2023
cb3fa8f
w
Jul 31, 2023
48ddaf5
わけがわからないよ
Jul 31, 2023
0dce66f
citest
Jul 31, 2023
db1497f
featre/router
Aug 1, 2023
c14c9f9
del/a
Aug 1, 2023
257b9b1
fix/Routes
Aug 1, 2023
53ec212
fix/Branch
Aug 1, 2023
97f24b1
ci test
Aug 4, 2023
95e3ba4
fix/popUpBug
Aug 4, 2023
7ff934f
citest
Aug 4, 2023
97188fa
fix/Branch
Aug 4, 2023
a9793ce
fix/BranchBug
Aug 4, 2023
2db0e7c
fix/componentsFire
Aug 8, 2023
ae0c9fa
ESlint and rome
Aug 8, 2023
f86b0b5
fix/ci
Aug 8, 2023
d395ee0
testEslint
Aug 8, 2023
ff650f6
fix/ci
Aug 8, 2023
fa3f4b4
add/ReadMe
Aug 9, 2023
22474f8
add/ディレクトリ構成説明
Aug 10, 2023
4cd0a4e
add/compositionLink
Aug 10, 2023
654f563
fix/eatLimitName
Aug 10, 2023
22a1298
Merge pull request #63 from nkc-ug/featre/Router
MinamizonoEno Aug 12, 2023
c1239b5
init rome eslint new version
Aug 12, 2023
831f0eb
init battle
Aug 13, 2023
d67ebfe
fix/poziuseState
hayatosuzuki3228 Aug 13, 2023
66f59e5
Merge pull request #66 from nkc-ug/futer/ci
hayatosuzuki3228 Aug 14, 2023
2d730c9
add/labelListObject
Aug 14, 2023
9036d00
fix/tutorial
Aug 14, 2023
3c12919
[update]Tutorial.jsxで使っていない変数の削除
Aug 15, 2023
848c509
Merge pull request #67 from nkc-ug/fix/tutorial
MinamizonoEno Aug 15, 2023
9cffee7
ESlint実行場所変更
Aug 16, 2023
6620522
Merge pull request #69 from nkc-ug/futer/ci
hayatosuzuki3228 Aug 16, 2023
a03fa3c
ばとるの修正とresultの追加
hayatosuzuki3228 Aug 16, 2023
4ddb972
Eslintの実行場所変更
Aug 16, 2023
7c9aace
ESlintの実行位置変更
hayatosuzuki3228 Aug 16, 2023
1379fd8
ESlintの実行位置変更
hayatosuzuki3228 Aug 16, 2023
2174953
ESlintの実行位置変更
hayatosuzuki3228 Aug 16, 2023
28c8ecc
Merge pull request #71 from nkc-ug/futer/ci
hayatosuzuki3228 Aug 16, 2023
75a3042
feat: functionsに新しいエンドポイント実装
Yuma-Satake Aug 17, 2023
f8ec04b
リザルトの追加途中
Aug 21, 2023
217e737
リザルト追加(バグ中)
Aug 21, 2023
1f6a911
fix:無限レンタリングによるエラー解消
Aug 23, 2023
aec184d
fix: レスポンス修正
Yuma-Satake Aug 23, 2023
d6b10e4
Merge pull request #73 from nkc-ug/feature/newEndpoint
Yuma-Satake Aug 23, 2023
7f55136
feat: firebaseInit
Yuma-Satake Aug 23, 2023
d674c3a
Merge pull request #74 from nkc-ug/feature/fireStoreInit
Yuma-Satake Aug 24, 2023
eb54492
feat: firestoreDB設計
Yuma-Satake Aug 25, 2023
0648a21
feat: firestore追加関数
Yuma-Satake Aug 25, 2023
e5d46f2
feat: firestore取得関数
Yuma-Satake Aug 25, 2023
ae3ef57
fix:レイアウトの変更
Aug 25, 2023
cfd35d3
fix/layout
Aug 25, 2023
a7a9680
fix/layout
Aug 25, 2023
c9eb2e9
fix/layout
Aug 25, 2023
e20296b
fix: 無限レンダリングを修正
Yuma-Satake Aug 25, 2023
b220481
fix: 無限レンダリングを修正2
Yuma-Satake Aug 25, 2023
1496837
fix:: 不要なインポート削除
Yuma-Satake Aug 26, 2023
8a439e5
Merge pull request #75 from nkc-ug/feature/getWordEmotions
Yuma-Satake Aug 26, 2023
95747b2
予約語実装/getEmotionApiからansを削除し、emotionDataを使用に変更
Mount-Book Aug 26, 2023
07d3367
console.logなどの消し忘れを削除
Mount-Book Aug 26, 2023
b0ac01e
Object.assignの使用/updateを最後に移動
Mount-Book Aug 27, 2023
fdd7632
Props→ObjectType/-infinity→0
Mount-Book Aug 27, 2023
88fcad3
Merge pull request #77 from nkc-ug/feater/firestore
Mount-Book Aug 27, 2023
8b7b466
feat: useEffectの依存配列エラーを無視するように修正
Yuma-Satake Aug 27, 2023
01dd025
Merge pull request #78 from nkc-ug/fix/eslint
Yuma-Satake Aug 27, 2023
f00e1bf
Merge pull request #76 from nkc-ug/fix/layout
MinamizonoEno Aug 27, 2023
3a02806
battleアニメーション途中
Aug 27, 2023
d53336c
Merge branch 'develop' into feater/battle
hayatosuzuki3228 Aug 27, 2023
09106d1
fix/romeerr
Aug 27, 2023
89b75bd
Merge branch 'feater/battle' of https://github.com/nkc-ug/yagi5108 in…
Aug 27, 2023
13bab60
リザルトの追加ふぉーまっとしてなくてごめんね
Aug 27, 2023
f8d58b5
fix/useEffct
Aug 27, 2023
21380d3
Merge pull request #79 from nkc-ug/feater/battle
hayatosuzuki3228 Aug 27, 2023
af63bf9
fix: byebyeConsole
Yuma-Satake Aug 27, 2023
886d5f0
fix: style殺処分
Yuma-Satake Aug 27, 2023
0205da4
fix: 迫真タイポ部廃部
Yuma-Satake Aug 27, 2023
300b02c
fix: firestoreページ削除
Yuma-Satake Aug 27, 2023
630160c
fix: 不要なプロパティ削除
Yuma-Satake Aug 27, 2023
6d1bf12
fix: 不要なプロパティ削除
Yuma-Satake Aug 27, 2023
2cfc602
feat: useInput追加
Yuma-Satake Aug 27, 2023
682b7c1
fix: 全てをやり直す。
Yuma-Satake Aug 27, 2023
983abfc
Merge pull request #80 from nkc-ug/fix/all
Yuma-Satake Aug 27, 2023
795e3df
fix: ファイル名変更
Yuma-Satake Aug 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
Expand All @@ -10,5 +11,6 @@ module.exports = {
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': 'warn',
'react-hooks/exhaustive-deps': 'off',
},
}
};
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: ci

on:
push:
branches: ['main', 'develop']
pull_request:
branches: ['main', 'develop']

jobs:
eslint:
name: Run eslint scanning
runs-on: ubuntu-latest
steps:
- name: Checkout code #コードを持ってくる
uses: actions/checkout@v3

- name: Install ESLint #ESlintをインストールする
run: |
npm install [email protected]
npm install @microsoft/[email protected]

- name: Run ESLint #ESLintを実行する
run: npx eslint ./src --ext .js,.jsx,.ts,.tsx --format @microsoft/eslint-formatter-sarif
--output-file eslint-results.sarif
continue-on-error: true

- name: Upload analysis results to GitHub #githubに解析結果をアップロード
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: eslint-results.sarif
wait-for-processing: true

rome:
name: Run rome scanning
runs-on: ubuntu-latest
steps:
- name: Checkout code #コードを持ってくる
uses: actions/checkout@v3

- name: Install Rome #romeをインストールする
run: |
npm install [email protected]

- name: Run Rome #romeを実行
run: npx rome check ./src
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,37 @@
# yagi5108
# GijukuCAMP_MonthlyHackathonVol.5_TeamNKC-ヤギ係

【技育 CAMP】マンスリーハッカソン vol.5 チーム"NKC-ヤギ係"制作物

# 制作物名

言の葉を食べるヤギ(ことのはをたべるやぎ)

# ドキュメント

- [ディレクトリ構成](./doc/composition.md)

# 技術スタック

## フロントエンド

- React
- Vite
- MUI

## バックエンド

- Firebaes

## ツール

- Github
- GithubActions ( Eslint / Rome )
- Figma

# 開発メンバー

- [Yuma-Satake](https://github.com/Yuma-Satake)
- [MinamizonoEno](https://github.com/MinamizonoEno)
- [Mount-Book](https://github.com/Mount-Book)
- [suzukihaya](https://github.com/suzukihaya)
- [uchiyamaairi](https://github.com/uchiyamaairi)
5 changes: 5 additions & 0 deletions doc/battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
バトルする
勝つ
ツイートできるようにする
負ける
励ましの言葉をヤギにかける
78 changes: 78 additions & 0 deletions doc/composition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# ディレクトリ構成

## ツリー表示

```
.
├── .github
│ └── workflows
│ ├── ci.yml
│ └── firebase-hosting-merge.yml
├── doc
│ ├── api.md
│ └── composition.md
├── functions
│ ├── lib
│ │ ├── index.js
│ │ └── index.js.map
│ ├── src
│ │ └── index.ts
│ ├── .gitignore
│ ├── package-lock.json
│ ├── package.json
│ ├── README.md
│ └── tsconfig.json
├── public
│ └── favicon.ico
├── src
│ ├── assets
│ ├── Audio
│ ├── components
│ │ ├── Bgm.tsx
│ │ ├── Branch.tsx
│ │ ├── Eat.tsx
│ │ ├── EvolutionPopup.tsx
│ │ ├── EvolutionWalk.tsx
│ │ ├── FlowerPopup.tsx
│ │ ├── Form.tsx
│ │ ├── getEmotionApi.ts
│ │ ├── NavBar.tsx
│ │ ├── NormalWalk.tsx
│ │ ├── Pulse.tsx
│ │ └── Tutorial.tsx
│ ├── hooks
│ │ └── useDiscloser.ts
│ ├── pages
│ │ └── AppView.tsx
│ ├── routes
│ │ └── Routers.tsx
│ ├── theme
│ │ ├── palette.ts
│ │ ├── theme.ts
│ │ └── typography.ts
│ ├── types
│ │ ├── EatLimit.ts
│ │ ├── EmotionDataType.ts
│ │ └── import-image.d.ts
│ ├── App.tsx
│ ├── main.tsx
│ └── vite-env.d.ts
├── .env.template
├── .eslintrc.cjs
├── .firebaserc
├── .gitignore
├── .prettierrc
├── firebase.json
├── index.html
├── package-lock.json
├── package.json
├── README.md
├── tsconfig.json
├── tsconfig.node.json
└── vite.config.ts
```

## ディレクトリの説明

- `src/components`: React コンポーネントを格納するディレクトリ
- `src/pages`: 各ページのコンポーネントを格納するディレクトリ
7 changes: 7 additions & 0 deletions eslint-results.sarif
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"runs": [
{
"results": []
}
]
}
44 changes: 44 additions & 0 deletions functions/lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion functions/lib/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions functions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,53 @@ ${reqText}というワードがどのような場面で利用されるかを"Joy
return;
}
});

exports.gptwrapper = onRequest({ cors: [/firebase\.com$/, 'flutter.com'] }, async (req, res) => {
/**
* 本番環境ではコメントアウトする
*/
res.setHeader('Access-Control-Allow-Origin', '*');

//reqText
const reqText = req.query.text;
if (!reqText) {
res.status(400).send('NoText');
return;
}

//context
const requestContext = reqText as string;

try {
//config
if (!apiKey) {
res.status(500).send('NoApiKey');
return;
}
const config = new Configuration({
apiKey: apiKey,
});

//params
const params: CreateChatCompletionRequest = {
model: 'gpt-3.5-turbo',
messages: [{ role: 'user', content: requestContext }],
};

//OpenAI
const aiInstance = new OpenAIApi(config);
const openAiRes = await aiInstance.createChatCompletion(params);
const aiResText = openAiRes.data.choices[0].message?.content;

if (!aiResText) {
res.status(500).send('GPTError');
return;
}

res.status(200).send(openAiRes.data);
return;
} catch (e) {
res.status(500).send(e);
return;
}
});
Loading