Skip to content

Commit 02a6557

Browse files
authored
Development: Webapp Implementation (#14)
* Implement foundation of webapp * Add documentation and introduce config * Update package.json * Fix button props * Fix warnings * Fix linting * Format with prettier and other fixes * Remove console messages * Clean up code, substitute useEffect for tanstack * Fix prettier
1 parent d91c175 commit 02a6557

Some content is hidden

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

45 files changed

+4689
-385
lines changed

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/webapp/README.md

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,42 @@
1-
# React + TypeScript + Vite
1+
# Harmonia Client-Side Docs
22

3-
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
3+
## Local Development
44

5-
Currently, two official plugins are available:
5+
1. Install dependencies:
66

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
7+
```bash
8+
npm install
9+
```
10+
11+
2. Run the development server:
12+
13+
```bash
14+
npm run dev
15+
```
16+
17+
## Project Structure
18+
19+
The important folders and structures of the projects are defined as follows:
20+
21+
```text
22+
webapp/
23+
├─ src/ # Main application source code
24+
│ ├─ assets/ # Static assets (images, fonts, icons, etc.)
25+
│ ├─ components/ # Reusable React components (self-implemented and generated with shadcn)
26+
│ │ └─ ui/ # UI components, generated with shadcn
27+
│ ├─ data/ # Data loaders (API-related utilities) and mock data
28+
│ ├─ hooks/ # Custom React hooks used across the project
29+
│ ├─ lib/ # Utilities
30+
│ ├─ pages/ # Application pages used by the router
31+
│ ├─ types/ # TypeScript types, interfaces, and shared definitions
32+
│ ├─ config.ts # Global configuration (e.g., flags, environment settings)
33+
│ ├─ main.ts # App entry point that initializes React
34+
│ ├─ index.css # Global stylesheet for the application
35+
│ └─ App.tsx # Root component that sets up app structure/layout
36+
├─ package.json # Project dependencies and scripts
37+
└─ README.md # Project documentation
38+
39+
```
940

1041
## React Compiler
1142

@@ -40,15 +71,15 @@ export default defineConfig([
4071
// other options...
4172
},
4273
},
43-
])
74+
]);
4475
```
4576

4677
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:
4778

4879
```js
4980
// eslint.config.js
50-
import reactX from 'eslint-plugin-react-x'
51-
import reactDom from 'eslint-plugin-react-dom'
81+
import reactX from 'eslint-plugin-react-x';
82+
import reactDom from 'eslint-plugin-react-dom';
5283

5384
export default defineConfig([
5485
globalIgnores(['dist']),
@@ -69,5 +100,5 @@ export default defineConfig([
69100
// other options...
70101
},
71102
},
72-
])
103+
]);
73104
```

src/main/webapp/eslint.config.js

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
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'
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';
66

77
export default tseslint.config(
8-
{ ignores: ['dist', '**/generated/**'] },
9-
{
10-
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11-
files: ['**/*.{ts,tsx}'],
12-
languageOptions: {
13-
ecmaVersion: 2020,
14-
globals: globals.browser,
15-
},
16-
plugins: {
17-
'react-hooks': reactHooks,
18-
'react-refresh': reactRefresh,
19-
},
20-
rules: {
21-
...reactHooks.configs.recommended.rules,
22-
'react-refresh/only-export-components': [
23-
'warn',
24-
{ allowConstantExport: true },
25-
],
26-
},
8+
{ ignores: ['dist', '**/generated/**'] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
2715
},
28-
)
16+
plugins: {
17+
'react-hooks': reactHooks,
18+
'react-refresh': reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
23+
},
24+
},
25+
);

0 commit comments

Comments
 (0)