diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..3a06bb9c --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,20 @@ +name: Deploy to GitHub Pages +on: + push: + branches: [ deploy-v2, main ] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: subosito/flutter-action@v2 + with: + channel: 'stable' + - run: flutter build web --release --no-tree-shake-icons + - name: GitHub Pages + uses: crazy-max/ghaction-github-pages@v4 + with: + target_branch: gh-pages + build_dir: build/web + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/analysis_report.txt b/analysis_report.txt deleted file mode 100644 index c6da040b..00000000 --- a/analysis_report.txt +++ /dev/null @@ -1,57 +0,0 @@ -Analyzing projet_banques... - -warning • Unused import: 'package:projet_queue_bancaire/components/agency_card.dart' • integration_test/app_test.dart:5:8 • unused_import - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/components/agency_card.dart:39:33 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/components/agency_card.dart:68:54 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/components/agency_card.dart:128:59 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/components/agency_card.dart:258:22 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/components/glass_container.dart:31:51 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/components/pulse_bar_widget.dart:41:50 • deprecated_member_use - info • The import of 'dart:ui' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/material.dart' • lib/components/soloba_assistant.dart:2:8 • unnecessary_import - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/components/soloba_assistant.dart:91:46 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/components/soloba_assistant.dart:125:48 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/components/soloba_assistant.dart:136:64 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/components/soloba_assistant.dart:181:60 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/components/soloba_assistant.dart:201:59 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/components/soloba_assistant.dart:210:50 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/components/soloba_assistant.dart:247:73 • deprecated_member_use - info • The import of 'package:flutter/services.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/material.dart' • lib/pages/analytics_page.dart:3:8 • unnecessary_import -warning • The value of the local variable 'stats' isn't used • lib/pages/analytics_page.dart:14:11 • unused_local_variable - error • The method 'getAnalytics' isn't defined for the type 'FirebaseService' • lib/pages/analytics_page.dart:14:35 • undefined_method - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/analytics_page.dart:116:42 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/analytics_page.dart:131:41 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/analytics_page.dart:171:46 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/analytics_page.dart:211:41 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/backoffice_page.dart:50:39 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/backoffice_page.dart:85:55 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/backoffice_page.dart:108:88 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/backoffice_page.dart:137:49 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/backoffice_page.dart:149:73 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/backoffice_page.dart:149:110 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/backoffice_page.dart:220:22 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/home_page.dart:66:49 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/home_page.dart:67:49 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/home_page.dart:82:53 • deprecated_member_use - info • Don't use 'BuildContext's across async gaps • lib/pages/home_page.dart:94:39 • use_build_context_synchronously - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/home_page.dart:111:53 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/home_page.dart:142:51 • deprecated_member_use - info • Don't use 'BuildContext's across async gaps • lib/pages/home_page.dart:222:19 • use_build_context_synchronously -warning • Unused import: '../models/ticket.dart' • lib/pages/take_ticket_page.dart:7:8 • unused_import -warning • Unused import: '../components/pulse_bar_widget.dart' • lib/pages/take_ticket_page.dart:8:8 • unused_import - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/take_ticket_page.dart:103:48 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/take_ticket_page.dart:159:63 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/take_ticket_page.dart:252:69 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/take_ticket_page.dart:252:109 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/take_ticket_page.dart:267:97 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/take_ticket_page.dart:280:112 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/take_ticket_page.dart:332:55 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/take_ticket_page.dart:357:38 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/ticket_page.dart:90:78 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/ticket_page.dart:106:63 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/ticket_page.dart:111:72 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/ticket_page.dart:147:33 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pages/ticket_page.dart:163:46 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/theme/app_theme.dart:45:56 • deprecated_member_use - info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/theme/app_theme.dart:69:42 • deprecated_member_use - -53 issues found. (ran in 12.7s) diff --git a/build_error.txt b/build_error.txt deleted file mode 100644 index a9c227d0..00000000 --- a/build_error.txt +++ /dev/null @@ -1,53 +0,0 @@ -Wasm dry run succeeded. Consider building and testing your application with the `--wasm` flag. See docs for more info: https://docs.flutter.dev/platform-integration/web/wasm -Use --no-wasm-dry-run to disable these warnings. -Target dart2js failed: ProcessException: Process exited abnormally with exit code 1: -lib/pages/take_ticket_page.dart:380:15: -Error: The setter 'selectedService' isn't defined for the type '_TakeTicketPageState'. - - '_TakeTicketPageState' is from 'package:projet_queue_bancaire/pages/take_ticket_page.dart' ('lib/pages/take_ticket_page.dart'). - selectedService = serviceId; - ^^^^^^^^^^^^^^^ -Error: Compilation failed. - Command: C:\src\flutter\bin\cache\dart-sdk\bin\dart.exe compile js --platform-binaries=C:\src\flutter\bin\cache\flutter_web_sdk\kernel --invoker=flutter_tool -Ddart.vm.product=true -DFLUTTER_VERSION=3.41.6 -DFLUTTER_CHANNEL=stable -DFLUTTER_GIT_URL=https://github.com/flutter/flutter.git -DFLUTTER_FRAMEWORK_REVISION=db50e20168 -DFLUTTER_ENGINE_REVISION=425cfb54d0 -DFLUTTER_DART_VERSION=3.11.4 -DFLUTTER_WEB_USE_SKIA=true -DFLUTTER_WEB_USE_SKWASM=false -DFLUTTER_WEB_CANVASKIT_URL=https://www.gstatic.com/flutter-canvaskit/425cfb54d01a9472b3e81d9e76fd63a4a44cfbcb/ --native-null-assertions --no-source-maps -O4 --minify -o C:\Users\USER\queue-buddy\.dart_tool\flutter_build\67fd616a33aa640c9f0ac05a1b64b2eb\app.dill --packages=C:\Users\USER\queue-buddy\.dart_tool\package_config.json --cfe-only C:\Users\USER\queue-buddy\.dart_tool\flutter_build\67fd616a33aa640c9f0ac05a1b64b2eb\main.dart -#0 RunResult.throwException (package:flutter_tools/src/base/process.dart:153:5) -#1 _DefaultProcessUtils.run (package:flutter_tools/src/base/process.dart:379:19) - -#2 Dart2JSTarget.build (package:flutter_tools/src/build_system/targets/web.dart:208:5) - -#3 _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:937:9) - -#4 Future.wait. (dart:async/future.dart:546:21) - -#5 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:875:32) - -#6 Future.wait. (dart:async/future.dart:546:21) - -#7 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:875:32) - -#8 FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:684:16) - -#9 WebBuilder.buildWeb (package:flutter_tools/src/web/compile.dart:107:34) - -#10 BuildWebCommand.runCommand (package:flutter_tools/src/commands/build_web.dart:300:5) - -#11 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1590:27) - -#12 AppContext.run. (package:flutter_tools/src/base/context.dart:154:19) - -#13 CommandRunner.runCommand (package:args/command_runner.dart:212:13) - -#14 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:496:9) - -#15 AppContext.run. (package:flutter_tools/src/base/context.dart:154:19) - -#16 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:431:5) - -#17 FlutterCommandRunner.run. (package:flutter_tools/src/runner/flutter_command_runner.dart:307:33) - -#18 run.. (package:flutter_tools/runner.dart:104:11) - -#19 AppContext.run. (package:flutter_tools/src/base/context.dart:154:19) - -#20 main (package:flutter_tools/executable.dart:103:3) - - -Error: Failed to compile application for the Web. diff --git a/hf_sync b/hf_sync deleted file mode 160000 index 23e4ec84..00000000 --- a/hf_sync +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 23e4ec84dccd26f61140c3a6825b3e96e351a3c5 diff --git a/netlify.toml b/netlify.toml index e6b9c1ea..fa468a42 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,3 +1,3 @@ [build] - command = "bash netlify_build.sh" + command = "bash scripts/netlify_build.sh" publish = "build/web" diff --git a/render.yaml b/render.yaml index f1b2c90e..6d1b417d 100644 --- a/render.yaml +++ b/render.yaml @@ -2,9 +2,8 @@ services: - type: web name: sira-web runtime: static - buildCommand: bash render_build.sh - staticPublishPath: deploy/web - # Les variables d'environnement suivantes peuvent être ajoutées via l'UI de Render si besoin + buildCommand: "bash scripts/render_build.sh" + staticPublishPath: build/web envVars: - key: HF_TOKEN sync: false diff --git a/render_build.sh b/render_build.sh deleted file mode 100644 index 958e26f8..00000000 --- a/render_build.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# Les fichiers web sont pré-compilés et disponibles dans le dossier deploy/web -# Render sert directement ce dossier - pas besoin de recompiler -echo "==> Fichiers web pré-compilés détectés dans deploy/web" -echo "==> Publication directe sans recompilation Flutter" -ls -la deploy/web/ | head -20 -echo "==> Prêt à servir !" diff --git a/deploy.ps1 b/scripts/deploy.ps1 similarity index 100% rename from deploy.ps1 rename to scripts/deploy.ps1 diff --git a/netlify_build.sh b/scripts/netlify_build.sh similarity index 100% rename from netlify_build.sh rename to scripts/netlify_build.sh diff --git a/scripts/render_build.sh b/scripts/render_build.sh new file mode 100644 index 00000000..783374e7 --- /dev/null +++ b/scripts/render_build.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +# Arrêter le script en cas d'erreur +set -e + +echo "--- 🚀 Démarrage du build pour Render (Mode Verbeux Actif) ---" + +# --- 📊 Diagnostic Système --- +echo "--- 🖥️ Infos Système ---" +free -h || echo "Commande 'free' non disponible" +df -h . +echo "Utilisateur actuel : $(whoami)" +echo "Dossier actuel : $(pwd)" + +# --- ⚙️ Optimisation de la mémoire --- +export MALLOC_ARENA_MAX=2 +export NODE_OPTIONS="--max-old-space-size=2048" +echo "MALLOC_ARENA_MAX réglé sur $MALLOC_ARENA_MAX" + +# --- 🐦 Configuration de Flutter --- +FLUTTER_CHANNEL="stable" + +if [ ! -d "flutter" ]; then + echo "--- 📥 Téléchargement de Flutter ($FLUTTER_CHANNEL) ---" + git clone https://github.com/flutter/flutter.git -b $FLUTTER_CHANNEL --depth 1 +else + echo "--- ✨ Flutter déjà présent, mise à jour (pull)... ---" + cd flutter && git pull && cd .. +fi + +# Ajouter Flutter au PATH +export PATH="$(pwd)/flutter/bin:$PATH" + +# --- 🛠️ Préparation de Flutter --- +echo "--- 🛠️ Diagnostic Flutter ---" +flutter doctor -v + +echo "--- 🌐 Activation du Web ---" +flutter config --enable-web + +# --- 📦 Dépendances --- +echo "--- 📦 Récupération des dépendances (Verbeux) ---" +flutter pub get -v + +# --- 🏗️ Build Web --- +echo "--- 🏗️ Construction de l'application Web (Mode Verbeux) ---" +# On ajoute le flag -v à flutter build pour un maximum de détails si ça plante +flutter build web --release -v \ + --web-renderer html \ + --no-tree-shake-icons \ + --dart2js-optimization=O1 \ + --dart-define=HF_TOKEN=$HF_TOKEN \ + --dart-define=ASR_SPACE_URL=$ASR_SPACE_URL + +echo "--- 📂 Vérification du dossier de sortie ---" +ls -lah build/web + +echo "--- ✅ Build terminé avec succès ! ---" diff --git a/setup_android.ps1 b/scripts/setup_android.ps1 similarity index 100% rename from setup_android.ps1 rename to scripts/setup_android.ps1 diff --git a/test_hf.dart b/test_hf.dart deleted file mode 100644 index d7eeb86f..00000000 --- a/test_hf.dart +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:http/http.dart' as http; - -void main() async { - final url = "https://router.huggingface.co/hf-inference/models/openai/whisper-tiny"; - final token = "YOUR_HF_TOKEN_HERE"; - - final dummyWav = [82, 73, 70, 70, 36, 0, 0, 0, 87, 65, 86, 69, 102, 109, 116, 32, 16, 0, 0, 0, 1, 0, 1, 0, 64, 31, 0, 0, 64, 31, 0, 0, 1, 0, 8, 0, 100, 97, 116, 97, 0, 0, 0, 0]; - - try { - final response = await http.post( - Uri.parse(url), - headers: { - 'Content-Type': 'application/octet-stream', - 'Authorization': 'Bearer $token', - }, - body: dummyWav, - ); - print("Status: ${response.statusCode}"); - print("Body: ${response.body.length > 200 ? response.body.substring(0, 200) : response.body}"); - } catch (e) { - print("Exception: $e"); - } -}