Skip to content

Commit b40632f

Browse files
committed
Add electron-angular app
1 parent 5feb1c7 commit b40632f

Some content is hidden

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

43 files changed

+22377
-0
lines changed

electron-angular/.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# === FRONTEND ===
2+
MODE=html # angular | html
3+
4+
DEVTOOLS=false

electron-angular/.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
2+
3+
# Compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
/bazel-out
8+
9+
# Node
10+
/node_modules
11+
npm-debug.log
12+
yarn-error.log
13+
14+
# IDEs and editors
15+
.idea/
16+
.project
17+
.classpath
18+
.c9/
19+
*.launch
20+
.settings/
21+
*.sublime-workspace
22+
23+
# Visual Studio Code
24+
.vscode/*
25+
!.vscode/settings.json
26+
!.vscode/tasks.json
27+
!.vscode/launch.json
28+
!.vscode/extensions.json
29+
.history/*
30+
31+
# Miscellaneous
32+
/.angular/cache
33+
.sass-cache/
34+
/connect.lock
35+
/coverage
36+
/libpeerconnection.log
37+
testem.log
38+
/typings
39+
40+
# System files
41+
.DS_Store
42+
Thumbs.db

electron-angular/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) 2017-2025 Ganatan
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

electron-angular/README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
2+
# electron-angular
3+
4+
> **Electron + Angular + WebSocket**
5+
> Exemple de connecteur conversationnel, avec une version HTML statique et une version Angular, piloté via Electron.
6+
7+
---
8+
9+
## 🟦 Objectifs
10+
11+
- Lancer une application Electron avec Angular en frontend
12+
- Tester en mode HTML pur ou Angular via la variable d’environnement `MODE`
13+
- Support d’un petit serveur WebSocket local pour les tests
14+
- Gestion de données simulées via `useMock`
15+
16+
---
17+
18+
---
19+
20+
## 🟦 Installation
21+
22+
```bash
23+
npm install
24+
```
25+
26+
puis dans le dossier `src/renderer/angular` :
27+
28+
```bash
29+
cd src/renderer/angular
30+
npm install
31+
```
32+
33+
---
34+
35+
## 🟦 Développement
36+
37+
### Démarrer Angular seul
38+
39+
```bash
40+
cd src/renderer/angular
41+
npm start
42+
```
43+
44+
### Démarrer Electron (mode dev)
45+
46+
```bash
47+
npm run dev
48+
```
49+
50+
> cela utilise `NODE_ENV=development`
51+
52+
---
53+
54+
## 🟦 Build de production
55+
56+
- **build en mode Angular (prod)**
57+
58+
```bash
59+
npm run build
60+
```
61+
62+
---
63+
64+
## 🟦 Variables d’environnement
65+
66+
```
67+
# .env
68+
MODE=angular
69+
```
70+
71+
---
72+
73+
## 🟦 Tests
74+
75+
```bash
76+
npm test
77+
```
78+
79+
---
80+

electron-angular/eslint.config.mjs

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import js from "@eslint/js"
2+
import globals from "globals"
3+
import { defineConfig } from "eslint/config"
4+
5+
export default defineConfig([
6+
{
7+
ignores: ['dist/**', 'jest.config.js', 'eslint.config.mjs', 'src/renderer/**',],
8+
},
9+
{
10+
files: ["**/*.{js,mjs,cjs}"],
11+
plugins: { js },
12+
extends: ["js/recommended"],
13+
rules: {
14+
indent: "off",
15+
quotes: ["error", "single", { avoidEscape: true }],
16+
"no-unused-vars": ["error", { args: "none", ignoreRestSiblings: true }],
17+
"no-console": "off",
18+
eqeqeq: "error",
19+
curly: "error",
20+
"no-undef": "error",
21+
"no-redeclare": "error",
22+
"consistent-return": "error",
23+
"no-shadow": "error",
24+
"object-curly-spacing": ["error", "always"],
25+
"callback-return": "error",
26+
"handle-callback-err": ["error", "^.*(e|E)rr"],
27+
"no-new-require": "error",
28+
"no-path-concat": "error",
29+
"no-process-exit": "off",
30+
"no-eval": "error",
31+
"no-implied-eval": "error",
32+
strict: "error",
33+
"no-var": "error",
34+
"prefer-const": "error",
35+
"no-empty": "error",
36+
"no-mixed-operators": "error",
37+
"no-trailing-spaces": "error",
38+
"linebreak-style": "off",
39+
"max-len": "off",
40+
"no-param-reassign": "off",
41+
"prefer-destructuring": "off",
42+
"prefer-arrow-callback": "off",
43+
"func-names": "error",
44+
"arrow-parens": "off",
45+
"dot-notation": "off",
46+
"import/prefer-default-export": "off",
47+
"import/first": "off",
48+
"no-template-curly-in-string": "off",
49+
"new-cap": ["error", { capIsNew: false }],
50+
"array-callback-return": "error",
51+
"object-shorthand": ["error", "consistent"],
52+
"function-paren-newline": ["error", "consistent"],
53+
"quote-props": ["error", "as-needed"],
54+
"operator-linebreak": ["error", "before"],
55+
"prefer-template": "error",
56+
"id-length": "error",
57+
"newline-before-return": "error",
58+
"space-before-blocks": "error",
59+
"eol-last": ["error", "always"],
60+
"no-multiple-empty-lines": ["error", { max: 1, maxEOF: 1 }]
61+
}
62+
},
63+
{
64+
files: ["**/*.js"],
65+
languageOptions: { sourceType: "commonjs" }
66+
},
67+
{
68+
files: ["**/*.{js,mjs,cjs}"],
69+
languageOptions: {
70+
globals: {
71+
...globals.browser,
72+
...globals.node,
73+
...globals.jest
74+
}
75+
}
76+
}
77+
])

electron-angular/jest.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/** @type {import('jest').Config} */
2+
const config = {
3+
collectCoverage: true,
4+
coverageDirectory: "coverage",
5+
coverageProvider: "v8",
6+
testEnvironment: "node",
7+
testPathIgnorePatterns: ["\\\\node_modules\\\\", "src/renderer"]
8+
}
9+
10+
module.exports = config

0 commit comments

Comments
 (0)