Modern ERP Reports Application with microservices architecture Tech Stack: - Backend: FastAPI + python-oracledb (Oracle DB integration) - Frontend: Vue.js 3 + PrimeVue + Vite - Telegram Bot: python-telegram-bot + SQLite - Infrastructure: Shared database pool, JWT authentication, SSH tunnel Features: - FastAPI backend with async Oracle connection pool - Vue.js 3 responsive frontend with PrimeVue components - Telegram bot alternative interface - Microservices architecture with shared components - Complete deployment support (Linux Docker + Windows IIS) - Comprehensive testing (Playwright E2E + pytest) Repository Structure: - reports-app/ - Main application (backend, frontend, telegram-bot) - shared/ - Shared components (database pool, auth, utils) - deployment/ - Deployment scripts (Linux & Windows) - docs/ - Project documentation - security/ - Security scanning and git hooks
267 lines
7.9 KiB
PowerShell
267 lines
7.9 KiB
PowerShell
# ROA2WEB - Android Testing Setup Script (PowerShell)
|
|
# Configureaza conexiunea la telefon Android pentru testare
|
|
|
|
param(
|
|
[switch]$Help
|
|
)
|
|
|
|
if ($Help) {
|
|
Write-Host @"
|
|
ROA2WEB - Android Testing Setup
|
|
|
|
Acest script configureaza conexiunea ADB Wireless pentru testare pe Android.
|
|
|
|
Usage:
|
|
.\android-test-setup.ps1
|
|
|
|
Prerequisites:
|
|
- ADB instalat (winget install Google.PlatformTools)
|
|
- Telefon Android cu Wireless Debugging activat
|
|
- Telefon si calculator in aceeasi retea WiFi
|
|
|
|
"@
|
|
exit 0
|
|
}
|
|
|
|
# Colors
|
|
function Write-Header($message) {
|
|
Write-Host "`n================================" -ForegroundColor Blue
|
|
Write-Host $message -ForegroundColor Blue
|
|
Write-Host "================================`n" -ForegroundColor Blue
|
|
}
|
|
|
|
function Write-Success($message) {
|
|
Write-Host "[OK] $message" -ForegroundColor Green
|
|
}
|
|
|
|
function Write-Error($message) {
|
|
Write-Host "[ERROR] $message" -ForegroundColor Red
|
|
}
|
|
|
|
function Write-Warning($message) {
|
|
Write-Host "[WARN] $message" -ForegroundColor Yellow
|
|
}
|
|
|
|
function Write-Info($message) {
|
|
Write-Host "[INFO] $message" -ForegroundColor Cyan
|
|
}
|
|
|
|
# Check ADB is installed
|
|
function Check-ADB {
|
|
Write-Header "Verificare ADB (Android Debug Bridge)"
|
|
|
|
$adb = Get-Command adb -ErrorAction SilentlyContinue
|
|
if (-not $adb) {
|
|
Write-Error "ADB nu este instalat sau nu este in PATH!"
|
|
Write-Host ""
|
|
Write-Info "Pentru a instala ADB:"
|
|
Write-Host " winget install Google.PlatformTools"
|
|
Write-Host ""
|
|
exit 1
|
|
}
|
|
|
|
Write-Success "ADB este instalat"
|
|
adb version | Select-Object -First 1
|
|
Write-Host ""
|
|
}
|
|
|
|
# Check device connection
|
|
function Check-Device {
|
|
Write-Header "Verificare Conexiune Telefon"
|
|
|
|
$devices = adb devices | Select-String "device$" | Measure-Object | Select-Object -ExpandProperty Count
|
|
|
|
if ($devices -eq 0) {
|
|
Write-Error "Niciun telefon Android conectat!"
|
|
Write-Host ""
|
|
Write-Info "Pasi de conectare ADB Wireless:"
|
|
Write-Host " 1. Pe telefon: Setari → Developer options → Wireless debugging → ON"
|
|
Write-Host " 2. Apasa pe 'Wireless debugging' → 'Pair device with pairing code'"
|
|
Write-Host " 3. In PowerShell: adb pair IP:PORT"
|
|
Write-Host " 4. Introdu codul de pe telefon"
|
|
Write-Host " 5. In PowerShell: adb connect IP:PORT_WIRELESS"
|
|
Write-Host ""
|
|
Write-Info "Dispozitive detectate:"
|
|
adb devices
|
|
Write-Host ""
|
|
exit 1
|
|
}
|
|
|
|
Write-Success "Telefon Android conectat: $devices dispozitiv(e)"
|
|
adb devices | Select-String "device$"
|
|
Write-Host ""
|
|
}
|
|
|
|
# Setup port forwarding for Chrome DevTools
|
|
function Setup-ChromeDevTools {
|
|
Write-Header "Configurare Chrome DevTools Port Forwarding"
|
|
|
|
# Remove existing forwarding
|
|
adb forward --remove-all | Out-Null
|
|
|
|
# Setup new forwarding
|
|
adb forward tcp:9222 localabstract:chrome_devtools_remote | Out-Null
|
|
|
|
if ($LASTEXITCODE -eq 0) {
|
|
Write-Success "Port forwarding configurat: localhost:9222 -> Chrome pe telefon"
|
|
} else {
|
|
Write-Error "Eroare la configurarea port forwarding!"
|
|
exit 1
|
|
}
|
|
|
|
# Verify forwarding
|
|
Write-Info "Port forwarding activ:"
|
|
adb forward --list
|
|
Write-Host ""
|
|
}
|
|
|
|
# Setup reverse port forwarding for app access
|
|
function Setup-AppAccess {
|
|
Write-Header "Configurare Acces la Aplicatie de pe Telefon"
|
|
|
|
# Remove existing reverse forwarding
|
|
adb reverse --remove-all 2>$null | Out-Null
|
|
|
|
# Setup reverse forwarding for frontend and backend
|
|
adb reverse tcp:3000 tcp:3000 | Out-Null
|
|
adb reverse tcp:8001 tcp:8001 | Out-Null
|
|
|
|
if ($LASTEXITCODE -eq 0) {
|
|
Write-Success "Reverse port forwarding configurat"
|
|
Write-Info "Pe telefon poti accesa:"
|
|
Write-Host " Frontend: http://localhost:3000"
|
|
Write-Host " Backend: http://localhost:8001/api"
|
|
} else {
|
|
Write-Warning "Reverse port forwarding a esuat (optional)"
|
|
Write-Info "Alternativ, foloseste IP-ul calculatorului:"
|
|
$localIP = (Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias "Wi-Fi*","Ethernet*" | Select-Object -First 1).IPAddress
|
|
Write-Host " Frontend: http://${localIP}:3000"
|
|
Write-Host " Backend: http://${localIP}:8001/api"
|
|
}
|
|
Write-Host ""
|
|
}
|
|
|
|
# Test Chrome DevTools connection
|
|
function Test-ChromeConnection {
|
|
Write-Header "Testare Conexiune Chrome DevTools"
|
|
|
|
Write-Info "Asigura-te ca Chrome este deschis pe telefon!"
|
|
Write-Host ""
|
|
Read-Host "Apasa Enter cand Chrome este deschis pe telefon"
|
|
|
|
try {
|
|
$response = Invoke-WebRequest -Uri "http://localhost:9222/json/version" -ErrorAction Stop
|
|
Write-Success "Conexiune reusita la Chrome pe telefon!"
|
|
Write-Host ""
|
|
Write-Info "Detalii Chrome:"
|
|
$response.Content | ConvertFrom-Json | ConvertTo-Json -Depth 10
|
|
} catch {
|
|
Write-Error "Nu se poate conecta la Chrome pe telefon!"
|
|
Write-Host ""
|
|
Write-Info "Verifica ca:"
|
|
Write-Host " 1. Chrome este deschis pe telefon"
|
|
Write-Host " 2. Port forwarding este activ: adb forward --list"
|
|
Write-Host " 3. Wireless debugging este activat"
|
|
Write-Host ""
|
|
Write-Info "Pentru debugging manual:"
|
|
Write-Host " Invoke-WebRequest http://localhost:9222/json/version"
|
|
}
|
|
Write-Host ""
|
|
}
|
|
|
|
# Display network info
|
|
function Display-NetworkInfo {
|
|
Write-Header "Informatii Retea pentru Acces Remote"
|
|
|
|
$localIP = (Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias "Wi-Fi*","Ethernet*" | Select-Object -First 1).IPAddress
|
|
|
|
Write-Info "IP-ul calculatorului: $localIP"
|
|
Write-Host ""
|
|
Write-Info "Pentru acces de pe telefon (daca reverse port forwarding nu functioneaza):"
|
|
Write-Host " Frontend: http://${localIP}:3000"
|
|
Write-Host " Backend: http://${localIP}:8001/api"
|
|
Write-Host ""
|
|
Write-Warning "Asigura-te ca telefonul si calculatorul sunt in aceeasi retea WiFi!"
|
|
Write-Host ""
|
|
}
|
|
|
|
# Display MCP configuration
|
|
function Display-MCPConfig {
|
|
Write-Header "Configurare Chrome DevTools MCP pentru Claude Code"
|
|
|
|
Write-Info "Instalare chrome-devtools-mcp:"
|
|
Write-Host " npm install -g chrome-devtools-mcp"
|
|
Write-Host ""
|
|
|
|
Write-Info "Configurare in Claude Desktop (claude_desktop_config.json):"
|
|
Write-Host ""
|
|
Write-Host @'
|
|
{
|
|
"mcpServers": {
|
|
"chrome-devtools": {
|
|
"command": "npx",
|
|
"args": [
|
|
"-y",
|
|
"chrome-devtools-mcp",
|
|
"--browser-url",
|
|
"http://localhost:9222"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
'@
|
|
Write-Host ""
|
|
Write-Warning "Dupa configurare, restart Claude Desktop!"
|
|
Write-Host ""
|
|
}
|
|
|
|
# Display useful commands
|
|
function Display-UsefulCommands {
|
|
Write-Header "Comenzi Utile"
|
|
|
|
Write-Host "Verificare dispozitive:"
|
|
Write-Host " adb devices"
|
|
Write-Host ""
|
|
Write-Host "Restart ADB server:"
|
|
Write-Host " adb kill-server; adb start-server"
|
|
Write-Host ""
|
|
Write-Host "Screenshot de pe telefon:"
|
|
Write-Host " adb shell screencap -p /sdcard/screenshot.png"
|
|
Write-Host " adb pull /sdcard/screenshot.png .\screenshot.png"
|
|
Write-Host ""
|
|
Write-Host "Verificare Chrome DevTools:"
|
|
Write-Host " Invoke-WebRequest http://localhost:9222/json/version"
|
|
Write-Host ""
|
|
Write-Host "Deschide Chrome DevTools in browser:"
|
|
Write-Host " Start-Process chrome://inspect#devices"
|
|
Write-Host ""
|
|
}
|
|
|
|
# Main
|
|
function Main {
|
|
Clear-Host
|
|
Write-Header " ROA2WEB - Android Testing Setup"
|
|
|
|
Check-ADB
|
|
Check-Device
|
|
Setup-ChromeDevTools
|
|
Setup-AppAccess
|
|
Test-ChromeConnection
|
|
Display-NetworkInfo
|
|
Display-MCPConfig
|
|
Display-UsefulCommands
|
|
|
|
Write-Header "[OK] Setup Complet!"
|
|
|
|
Write-Success "Telefonul Android este configurat pentru testare!"
|
|
Write-Host ""
|
|
Write-Info "Next steps:"
|
|
Write-Host " 1. Deschide Chrome pe telefon"
|
|
Write-Host " 2. Navigheaza la aplicatia ROA2WEB (vezi IP-ul de mai sus)"
|
|
Write-Host " 3. In Claude Code, cere: 'Fa un screenshot al aplicatiei de pe telefonul meu Android'"
|
|
Write-Host ""
|
|
}
|
|
|
|
# Run main
|
|
Main
|