Flutter App

This commit is contained in:
2025-12-14 21:53:46 -05:00
parent 383e2e07bd
commit 7ed7a2470d
108 changed files with 7077 additions and 130 deletions

View File

@@ -18,17 +18,20 @@ This is a monorepo-style project with separate backend and frontend applications
│ ├── Dockerfile
│ └── package.json
├── electron-app/ # Electron + React frontend
│ ├── src/
│ │ ├── main/ # Electron main process
│ │ ├── renderer/ # React UI components
│ │ │ ├── components/
│ │ │ ├── pages/
│ │ │ ├── hooks/
│ │ │ └── store/ # Zustand/Recoil state
│ └── shared/ # IPC types & shared code
│ ├── tests/
│ └── package.json
├── flutter_app/ # Flutter cross-platform app
│ ├── lib/
│ │ ├── models/ # Data models (PriceData, PriceAlert)
│ │ ├── providers/ # State management (Provider)
│ │ ├── services/ # API, WebSocket, Storage services
│ │ ├── screens/ # UI screens (HomeScreen)
│ │ ├── widgets/ # Reusable UI components
│ │ └── main.dart # App entry point
├── assets/ # Images, fonts, etc.
│ ├── .env # Environment configuration
│ └── pubspec.yaml # Dependencies
├── electron-app/ # Legacy Electron app (deprecated)
│ └── ... # Kept for reference
├── shared/ # Shared TypeScript types/interfaces
│ └── types/
@@ -47,10 +50,11 @@ This is a monorepo-style project with separate backend and frontend applications
- API layer is stateless for horizontal scaling
- TimescaleDB handles time-series data efficiently
- **Frontend**: Component-based React architecture
- Sandboxed renderer process for security
- Secure IPC messaging between main and renderer
- **Frontend**: Flutter widget-based architecture
- Provider pattern for state management
- Service layer for API/WebSocket communication
- Client-side alert evaluation logic
- Cross-platform: Windows, macOS, Linux, Android, iOS
- **Database Schema**: Three main tables
- `raw_vendor_prices`: Individual vendor listings
@@ -59,8 +63,9 @@ This is a monorepo-style project with separate backend and frontend applications
## Key Conventions
- All code in TypeScript with strict type checking
- Backend: TypeScript with strict type checking
- Frontend: Dart with null safety
- Scrapers include retry logic (3 attempts) and error handling
- WebSocket auto-reconnect logic in Electron app
- WebSocket auto-reconnect logic in Flutter app
- Signed binaries for all platform distributions
- No remote code evaluation in Electron (security)
- Flutter: No eval or dynamic code execution (security)

View File

@@ -11,15 +11,18 @@
- **WebSockets**: Native `ws` or Fastify WS plugin
- **Deployment**: Docker containers
## Frontend (Electron Desktop App)
## Frontend (Flutter Cross-Platform App)
- **Framework**: Electron 30+
- **UI Library**: NextJS? + TypeScript/TSX
- **Build Tool**: Vite
- **Styling**: TailwindCSS
- **Charts**: Recharts, ECharts, or TradingView Charting Library
- **State Management**: Zustand or Recoil
- **Auto-updates**: electron-updater
- **Framework**: Flutter 3.38+
- **Language**: Dart 3.10+
- **State Management**: Provider
- **Charts**: fl_chart
- **Styling**: Material Design 3
- **WebSocket**: web_socket_channel
- **Storage**: shared_preferences + sqflite
- **Notifications**: flutter_local_notifications
- **Window Management**: window_manager (desktop)
- **Platforms**: Windows, macOS, Linux, Android, iOS
## Testing
@@ -36,11 +39,14 @@ npm run build # Build TypeScript
npm run test # Run Jest tests
npm run scrape # Manual scrape trigger
# Frontend (Electron)
npm run dev # Start Electron in dev mode
npm run build # Build production app
npm run package # Package for distribution
npm run test # Run tests
# Frontend (Flutter)
flutter run -d windows # Run on Windows
flutter run -d android # Run on Android
flutter run -d ios # Run on iOS
flutter build windows # Build Windows release
flutter build apk # Build Android APK
flutter pub get # Install dependencies
flutter doctor # Check setup
# Database
npm run migrate # Run database migrations