How erikat04/tfg_antivirus_erikat works
Project Type & Purpose
• Type: Full-stack, cross-platform mobile/desktop application.
• Purpose: Provide malware protection via hash-based detection, user account management, and quarantining capabilities.
File Structure
• Top-level “android”, “linux”, “windows” folders: platform-specific Flutter runners.
• “lib/”: Flutter Dart code, subdivided into:
– data_access (DAO interfaces & implementations for local DB)
– model (domain objects: File, User, Hash, Device, ForbiddenFolder)
– utils (isolates, DB utilities, app essentials)
– viewmodels (state & business logic providers)
– views & widgets (UI layer)
• “lib/database.sql”: schema for SQLite.
• “integration_test”: end-to-end UI tests.
• “pubspec.yaml”: dependencies (Flutter, HTTP, SQLite, etc.).
• External repos: FastAPI backend (remote MySQL), hosted on Vercel; local SQLite.
Key Insights from README
• Two data stores:
– Remote MySQL via FastAPI for user accounts & global fingerprint DB.
– Local SQLite for caching scans, quarantines, and settings.
• Core features:
– Account lifecycle (login/logout, profile, password change).
– File scanning (background isolates, recursive traversal, quarantining).
– Permissions management (deny/restore/delete).
• External services: FreeDB (MySQL host), Vercel (API host).
Components & Relationships
a. Main Components
1. Flutter Client (Android/iOS, Linux, Windows):
• UI Layer (Views & Widgets)
• ViewModels (Business logic & state)
• Data Access Layer (DAOs, SQLite)
• Scan Isolate (background file traversal & hash computation)
2. Local SQLite Database
3. FastAPI Backend (hosted on Vercel)
4. Remote MySQL Database (FreeDB)
5. File System (host OS folders & files)
6. External Services (Authentication, Hosting)
b. Relationships & Data Flows
• UI ↔ ViewModels: user actions trigger state updates.
• ViewModels ↔ DAOs: read/write local SQLite (settings, cached scan results, quarantine list).
• Scan Isolate → File System: recursive hashing of files.
• ViewModels ↔ FastAPI API: HTTP calls for user management, remote fingerprint queries, sync quarantine status.
• FastAPI ↔ MySQL: CRUD on users, fingerprints, device records.
c. Architectural Patterns & Principles
• MVVM (Model–View–ViewModel) in Flutter
• Repository/DAO pattern for data access
• Isolate for heavy background compute (scan)
• Clean separation: Presentation / Business Logic / Data
d. Key Technologies & Frameworks
• Flutter & Dart: Client UI & logic
• SQLite (sqflite plugin): local persistence
• FastAPI & Python: backend API
• MySQL: central database
• Vercel: API hosting
• FreeDB: remote MySQL hosting