Skip to content

Commit 2433d4d

Browse files
authored
Merge pull request #4 from jphacks/naminamina_frontend
Naminamina frontend
2 parents 7d25236 + 6babd89 commit 2433d4d

Some content is hidden

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

92 files changed

+13154
-0
lines changed

frontend/4dathome-app/.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Env files
16+
.env*
17+
!.env.example
18+
19+
# Editor directories and files
20+
.vscode/*
21+
!.vscode/extensions.json
22+
.idea
23+
.DS_Store
24+
*.suo
25+
*.ntvs*
26+
*.njsproj
27+
*.sln
28+
*.sw?

frontend/4dathome-app/README.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# React + TypeScript + Vite
2+
3+
フロントエンドは Vite + React + TypeScript で構成されています。バックエンドやデバイスハブとの通信は環境変数から URL を取得します。
4+
5+
Currently, two official plugins are available:
6+
7+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9+
10+
## 環境変数
11+
12+
Vite 形式のキーを使用します(Next.js の NEXT_PUBLIC_* は使用しません)。
13+
14+
```
15+
VITE_BACKEND_API_URL="https://fdx-home-backend-api-47te6uxkwa-an.a.run.app"
16+
VITE_BACKEND_WS_URL="wss://fdx-home-backend-api-47te6uxkwa-an.a.run.app"
17+
```
18+
19+
未設定の場合は上記のデフォルト URL にフォールバックします(`src/config/backend.ts`)。
20+
21+
## React Compiler
22+
23+
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
24+
25+
## Expanding the ESLint configuration
26+
27+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
28+
29+
```js
30+
export default defineConfig([
31+
globalIgnores(['dist']),
32+
{
33+
files: ['**/*.{ts,tsx}'],
34+
extends: [
35+
// Other configs...
36+
37+
// Remove tseslint.configs.recommended and replace with this
38+
tseslint.configs.recommendedTypeChecked,
39+
// Alternatively, use this for stricter rules
40+
tseslint.configs.strictTypeChecked,
41+
// Optionally, add this for stylistic rules
42+
tseslint.configs.stylisticTypeChecked,
43+
44+
// Other configs...
45+
],
46+
languageOptions: {
47+
parserOptions: {
48+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
49+
tsconfigRootDir: import.meta.dirname,
50+
},
51+
// other options...
52+
},
53+
},
54+
])
55+
```
56+
57+
## タイムライン送信(概要)
58+
59+
`public/json/{videoId}.json` を読み込み、`POST /api/preparation/upload-timeline/{session_id}` に送信します。
60+
61+
- 実装: `src/utils/timeline.ts`
62+
- UI ボタン: `src/components/TimelineUploadButton.tsx`
63+
64+
開発中は `public/json/demo1.json``public/video/demo1.mp4` を利用できます。
65+
66+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
67+
68+
```js
69+
// eslint.config.js
70+
import reactX from 'eslint-plugin-react-x'
71+
import reactDom from 'eslint-plugin-react-dom'
72+
73+
export default defineConfig([
74+
globalIgnores(['dist']),
75+
{
76+
files: ['**/*.{ts,tsx}'],
77+
extends: [
78+
// Other configs...
79+
// Enable lint rules for React
80+
reactX.configs['recommended-typescript'],
81+
// Enable lint rules for React DOM
82+
reactDom.configs.recommended,
83+
],
84+
languageOptions: {
85+
parserOptions: {
86+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
87+
tsconfigRootDir: import.meta.dirname,
88+
},
89+
// other options...
90+
},
91+
},
92+
])
93+
```
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
import { defineConfig, globalIgnores } from 'eslint/config'
7+
8+
export default defineConfig([
9+
globalIgnores(['dist']),
10+
{
11+
files: ['**/*.{ts,tsx}'],
12+
extends: [
13+
js.configs.recommended,
14+
tseslint.configs.recommended,
15+
reactHooks.configs['recommended-latest'],
16+
reactRefresh.configs.vite,
17+
],
18+
languageOptions: {
19+
ecmaVersion: 2020,
20+
globals: globals.browser,
21+
},
22+
},
23+
])

frontend/4dathome-app/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>4dathome-app</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)