How adrianbl1/mantenimiento_control works
Main Components
• User Interface Layer: This includes all the Activities and Fragments (such as MainActivity, Autentificacion, Estadisticas, ExportReport, PerfilAdministrador, PerfilUsuario, RealizarReporteIncidente, RegistrarEstadoIncidente, ReporteIncidente, WithoutConnection, and TimePickerFragment) as found in the app/src/main/res/layout and app/src/main/java/… directories.
• Data Models: Represent the Incidencia and Usuario classes from the models package.
• Business Logic / ViewModel Layer: While your file structure might not explicitly contain “ViewModel” classes, it does mention the MVVM pattern. This implies that there is (or should be) a layer that coordinates UI actions with business logic.
• Firebase Backend Services: This comprises Firebase Authentication, Firestore/Realtime Database (for incident data), and Cloud Storage (for saving evidence/media files).
Mapping Relationships and Interactions
• The UI components (Activities, Fragments) interact with the ViewModel (business logic layer) to trigger operations such as user authentication, incident submission, status updates, and report exporting.
• The ViewModel layer then communicates with the Firebase backend services to perform data operations (saving incidents, updating statuses, retrieving reports, managing users, etc.).
• Data Models (Incidencia and Usuario) are used to structure the data transfer between UI, ViewModel, and Firebase.
• There is also a handling mechanism for offline scenarios (“WithoutConnection”), which should be depicted as a fallback UI state in case of network failure.
Architectural Patterns and Technologies
• Architecture: MVVM
• Separation of concerns: View (UI), ViewModel (logic), and Model (data).
• Firebase Integration: Show that Firebase handles authentication (login, reset password), data storage (Firestore and/or Firebase Database), and media storage (Cloud Storage) for evidence.
• Android-Specific Components: Note the use of Android Activities, Fragments (like TimePickerFragment), and resource directories holding layouts, drawables, and strings. This is crucial for understanding the flow from user interaction to backend processing.
• UI Feedback / Connectivity Strategy: “WithoutConnection” view which handles loss of connectivity.
Additional Details
• Since the project uses Kotlin and Gradle, mention that these tools underpin the development process, even though they might not be a part of the runtime architecture.
• User roles: The existence of distinct user profiles—PerfilAdministrador and PerfilUsuario—to indicate role-based access control, especially in the area of managing incidents.
• Reporting/export features: Show how the ExportReport functionality ties into the reporting workflow and possibly outputs a PDF stored locally.
• Then branch into the main dashboard (MainActivity) that displays incidents and provides navigation to different screens (realizar reporte, registrar estado, etc.)
• Side branches for specific flows like “Sin Conexión” and reporting features.