Skip to content

Conversation

@vollereiseelee
Copy link
Collaborator

@vollereiseelee vollereiseelee commented Jun 6, 2025

PR Type

Enhancement, Tests, Bug fix


Description

  • Major frontend implementation for a project management app, including:

    • Dashboard, project, task, document, notification, external tools, and profile screens.
    • Comprehensive routing with GoRouter and navigation shell.
    • CRUD services and data models for projects, tasks, documents, notifications, and external tools.
    • Authentication and user profile management with secure storage.
    • Theming support with light/dark modes and persistent theme provider.
    • Reusable UI components (buttons, text fields, status badges, navigation utilities).
    • Integration with external tools (OAuth, calendar, analytics, chat placeholder).
    • Notification preferences and account settings management.
  • Backend enhancements:

    • FastAPI services for project, document, notification, and external tools management.
    • Document and project services with CRUD, permissions, versioning, and activity logging.
    • Twilio SMS sending utility for external tools.
  • Dependency updates:

    • Registration of flutter_secure_storage and other plugins for Linux, Windows, and macOS builds.
  • Extensive test coverage:

    • Added test screens for profile, projects, documents, notifications, external tools, and account settings.
    • Backend test output and coverage report included.
  • Refactored main entry point and removed default Flutter counter app.


Changes walkthrough 📝

Relevant files
Dependencies
5 files
generated_plugin_registrant.cc
Register flutter_secure_storage_linux plugin in Linux build

frontend/linux/flutter/generated_plugin_registrant.cc

  • Added registration code for the flutter_secure_storage_linux plugin.
  • Included the plugin's header and registered it in the
    fl_register_plugins function.
  • +4/-0     
    generated_plugin_registrant.cc
    Register flutter_secure_storage_windows plugin in Windows build

    frontend/windows/flutter/generated_plugin_registrant.cc

  • Added registration code for the flutter_secure_storage_windows plugin.
  • Included the plugin's header and registered it in the RegisterPlugins
    function.
  • +3/-0     
    generated_plugins.cmake
    Add flutter_secure_storage_linux to CMake plugin list       

    frontend/linux/flutter/generated_plugins.cmake

  • Added flutter_secure_storage_linux to the list of Flutter plugins.
  • +1/-0     
    generated_plugins.cmake
    Add flutter_secure_storage_windows to CMake plugin list   

    frontend/windows/flutter/generated_plugins.cmake

  • Added flutter_secure_storage_windows to the list of Flutter plugins.
  • +1/-0     
    GeneratedPluginRegistrant.swift
    Register additional Flutter plugins for macOS support       

    frontend/macos/Flutter/GeneratedPluginRegistrant.swift

  • Registered new Flutter plugins: flutter_secure_storage_macos,
    path_provider_foundation, and shared_preferences_foundation.
  • Ensures these plugins are available for macOS builds.
  • +6/-0     
    Enhancement
    53 files
    project_detail_screen.dart
    Add simulated ProjectDetailPage UI for project details and tabs

    frontend/test/project_detail_screen.dart

  • Added a new file implementing a simulated ProjectDetailPage widget.
  • Provides a detailed UI for project information, tasks, documents, and
    activity tabs.
  • Includes simulated data and UI logic for loading, error handling, and
    tab navigation.
  • Implements dialogs, floating action buttons, and various helper
    methods for UI rendering.
  • +479/-0 
    dashboard_screen.dart
    Add DashboardScreen for project/task/notification overview

    frontend/lib/features/home/screens/dashboard_screen.dart

  • Added a new dashboard screen widget for the home page.
  • Fetches and displays projects, urgent tasks, notifications, and quick
    actions.
  • Uses FutureBuilders for async data and provides summary cards and
    lists.
  • Integrates navigation and UI feedback for user actions.
  • +335/-0 
    app_router.dart
    Implement GoRouter-based app routing with navigation shell

    frontend/lib/routes/app_router.dart

  • Added a comprehensive routing setup using GoRouter.
  • Implements a MainShell widget with a persistent navigation rail.
  • Defines routes for authentication, dashboard, projects, tasks,
    documents, notifications, tools, and profile.
  • Includes route guards and custom transitions for various pages.
  • +361/-0 
    project_service.dart
    Add ProjectService for project/task/member/activity API operations

    frontend/lib/features/home/data/project_service.dart

  • Added a service class for project-related API operations.
  • Implements methods for CRUD operations on projects, tasks, members,
    activities, and comments.
  • Handles authentication via secure storage and HTTP requests.
  • +326/-0 
    project_detail_screen.dart
    Add ProjectDetailPage with backend integration and tabs   

    frontend/lib/features/home/screens/project_detail_screen.dart

  • Added a new ProjectDetailPage widget for displaying project details.
  • Fetches real project, member, task, and activity data from the
    backend.
  • Provides tabs for summary, tasks, documents (placeholder), and
    activity.
  • Implements member management, task navigation, and project deletion
    dialog.
  • +316/-0 
    create_task_screen.dart
    Add CreateTaskScreen for task creation with form                 

    frontend/lib/features/home/screens/create_task_screen.dart

  • Added a screen for creating new tasks within a project.
  • Implements a form for task details, including title, description, due
    date, assignee, priority, status, tags, and metadata.
  • Handles form validation, submission, and error display.
  • +265/-0 
    task_detail_screen.dart
    Add TaskDetailScreen for viewing and commenting on tasks 

    frontend/lib/features/home/screens/task_detail_screen.dart

  • Added a screen for viewing task details and comments.
  • Fetches task and comment data, displays details, and allows adding
    comments.
  • Provides UI for editing tasks and error handling.
  • +268/-0 
    project_edit_screen.dart
    Add ProjectEditScreen for editing project details               

    frontend/lib/features/home/screens/project_edit_screen.dart

  • Added a screen for editing project details.
  • Implements a form for editing name, description, dates, and members.
  • Handles form submission, validation, and error display.
  • +238/-0 
    main.dart
    Refactor main entry for providers, theme, routing, and error logging

    frontend/lib/main.dart

  • Refactored the main entry point to use providers, theme, and error
    logging.
  • Integrated app routing and localization.
  • Removed the default Flutter counter app and replaced with the main
    TaskHub app structure.
  • +65/-108
    notifications_preferences_screen.dart
    Add NotificationsPreferencesScreen for notification settings

    frontend/lib/features/home/screens/notifications_preferences_screen.dart

  • Added a screen for managing notification preferences.
  • Fetches and updates notification settings for the user.
  • Provides UI for toggling notification types, digest frequency, and
    quiet hours.
  • +221/-0 
    project_create_screen.dart
    Add CreateProjectPage for new project creation                     

    frontend/lib/features/home/screens/project_create_screen.dart

  • Added a screen for creating new projects.
  • Implements a form for project name, description, dates, and initial
    members.
  • Handles form validation, submission, and error display.
  • +230/-0 
    auth_service.dart
    Add AuthService for authentication and user profile management

    frontend/lib/features/auth/data/auth_service.dart

  • Added an authentication service class for user login, registration,
    and profile management.
  • Handles secure storage of tokens and provides mock user data for
    development.
  • Implements API calls for authentication and user profile endpoints.
  • +188/-0 
    project_models.dart
    Add project, task, member, activity, and comment models   

    frontend/lib/features/home/data/project_models.dart

  • Added data models for projects, members, tasks, activities, and task
    comments.
  • Provides JSON serialization/deserialization for API integration.
  • +176/-0 
    colors.dart
    Add AppColors constants for consistent color usage             

    frontend/lib/core/constants/colors.dart

  • Added a constants file defining the app's color palette.
  • Includes brand, semantic, text, notification, status, and common
    colors.
  • +33/-0   
    document_create_screen.dart
    Add document creation screen with form and service integration

    frontend/lib/features/home/screens/document_create_screen.dart

  • Added a new stateful widget DocumentCreateScreen for creating
    documents.
  • Includes a form with fields for name, project ID, type, parent ID,
    content type, URL, description, tags, and metadata.
  • Handles form validation, submission, and error display.
  • Integrates with DocumentService to create a document and provides user
    feedback.
  • +150/-0 
    externaltools_screen.dart
    Add external tools management screen with connection listing

    frontend/lib/features/home/screens/externaltools_screen.dart

  • Introduced ExternalToolsScreen to display and manage external tool
    connections.
  • Fetches user connections from ExternalToolsService and displays them
    in a list.
  • Allows disconnecting external tools and provides user feedback.
  • Includes a floating action button for connecting new tools.
  • +160/-0 
    external_tools_models.dart
    Add models for external tools and OAuth integration           

    frontend/lib/features/home/data/external_tools_models.dart

  • Added data models for OAuth providers, external tool connections,
    external resources, and resource syncs.
  • Each model includes a constructor and a fromJson factory for parsing
    API responses.
  • +152/-0 
    tool_calendar_screen.dart
    Add external calendar integration screen with event creation

    frontend/lib/features/home/screens/tool_calendar_screen.dart

  • Added ToolCalendarScreen for viewing and creating external calendar
    events.
  • Integrates with ExternalToolsService to fetch and create events.
  • Provides a form for event creation and displays a list of events.
  • Handles loading and error states.
  • +160/-0 
    task_edit_screen.dart
    Add task editing screen with form and update logic             

    frontend/lib/features/home/screens/task_edit_screen.dart

  • Introduced TaskEditScreen for editing project tasks.
  • Provides a form to edit task details such as title, description,
    assignee, due date, priority, and status.
  • Integrates with ProjectService to update tasks and shows user
    feedback.
  • +146/-0 
    notifications_screen.dart
    Add notifications screen with mark-as-read functionality 

    frontend/lib/features/home/screens/notifications_screen.dart

  • Added NotificationsScreen to display user notifications.
  • Fetches notifications from NotificationService and displays them in a
    list.
  • Allows marking notifications as read and provides visual feedback.
  • Handles loading and error states.
  • +152/-0 
    document_edit_screen.dart
    Add document editing screen with form and update logic     

    frontend/lib/features/home/screens/document_edit_screen.dart

  • Added DocumentEditScreen for editing document details.
  • Provides a form to edit name, parent folder, description, tags, and
    metadata.
  • Integrates with DocumentService to update documents and shows user
    feedback.
  • +142/-0 
    projects_screen.dart
    Add projects listing screen with search and navigation     

    frontend/lib/features/home/screens/projects_screen.dart

  • Added ProjectsPage for listing and searching projects.
  • Fetches projects from ProjectService and displays them in a list.
  • Supports search, refresh, and navigation to project details.
  • Includes a floating action button for project creation.
  • +154/-0 
    tool_analytics_screen.dart
    Add analytics integration screen for Metabase cards           

    frontend/lib/features/home/screens/tool_analytics_screen.dart

  • Added ToolAnalyticsScreen for querying analytics data from Metabase.
  • Provides a form to input card ID and fetches analytics data via
    ExternalToolsService.
  • Displays analytics results or errors.
  • +140/-0 
    documents_screen.dart
    Add documents listing screen with navigation and creation

    frontend/lib/features/home/screens/documents_screen.dart

  • Added DocumentsPage for listing project documents.
  • Fetches documents from DocumentService and displays them in a list.
  • Supports navigation to document details and document creation.
  • Handles loading and error states.
  • +143/-0 
    change_password_screen.dart
    Add change password screen with validation and feedback   

    frontend/lib/features/home/screens/change_password_screen.dart

  • Added ChangePasswordScreen for changing user password.
  • Provides a form for old password, new password, and confirmation.
  • Validates password match and shows success feedback.
  • +134/-0 
    user_edit_screen.dart
    Add user profile editing screen with form and update         

    frontend/lib/features/home/screens/user_edit_screen.dart

  • Added UserEditScreen for editing user profile information.
  • Provides a form to edit name and email, and integrates with
    AuthService.
  • Shows feedback on successful update or error.
  • +140/-0 
    notification_models.dart
    Add notification and preferences data models                         

    frontend/lib/features/home/data/notification_models.dart

  • Added models for notifications and notification preferences.
  • Includes constructors, fromJson factories, and a toJson method for
    preferences.
  • +112/-0 
    document_detail_screen.dart
    Add document detail screen with fetch and edit navigation

    frontend/lib/features/home/screens/document_detail_screen.dart

  • Added DocumentDetailScreen for viewing detailed information about a
    document.
  • Fetches document details from DocumentService and displays all fields.
  • Provides navigation to edit the document.
  • +120/-0 
    document_service.dart
    Add document service for CRUD operations with API               

    frontend/lib/features/home/data/document_service.dart

  • Added DocumentService for interacting with the backend document API.
  • Provides methods for listing, creating, fetching, updating, and
    deleting documents.
  • Handles authorization and JSON serialization.
  • +116/-0 
    theme.dart
    Add application-wide light and dark theme definitions       

    frontend/lib/theme/theme.dart

  • Added AppTheme class with light and dark theme definitions.
  • Specifies colors, typography, and widget theming for the app.
  • +120/-0 
    register_screen.dart
    Add registration screen with validation and navigation     

    frontend/lib/features/auth/screens/register_screen.dart

  • Added a registration screen with form fields for name, email,
    password, and confirmation.
  • Validates password match and navigates to login on success.
  • Uses custom widgets for text fields and buttons.
  • +120/-0 
    login_screen.dart
    Add login screen with authentication simulation                   

    frontend/lib/features/auth/screens/login_screen.dart

  • Added a login screen with email and password fields.
  • Simulates authentication and navigates to dashboard on success.
  • Handles error display for invalid credentials.
  • +115/-0 
    external_tools_service.dart
    Add service for external tools and integrations API           

    frontend/lib/features/home/data/external_tools_service.dart

  • Added ExternalToolsService for interacting with external tools APIs.
  • Includes methods for OAuth providers, user connections, calendar
    events, and analytics data.
  • Handles authorization and JSON serialization.
  • +98/-0   
    register_screen.dart
    Add registration screen with AuthService integration         

    frontend/lib/features/auth/presentation/register_screen.dart

  • Added a registration screen that integrates with AuthService for user
    registration.
  • Handles form validation, error display, and navigation to dashboard on
    success.
  • +99/-0   
    notification_service.dart
    Add notification service for user notifications and preferences

    frontend/lib/features/home/data/notification_service.dart

  • Added NotificationService for managing notifications and preferences.
  • Provides methods for fetching, marking as read, deleting
    notifications, and managing preferences.
  • Handles authorization and JSON serialization.
  • +85/-0   
    profile_screen.dart
    Add profile screen with navigation to edit and settings   

    frontend/lib/features/home/screens/profile_screen.dart

  • Added ProfilePage for displaying user profile information.
  • Includes navigation to edit profile and account settings.
  • Uses themed UI elements and navigation.
  • +93/-0   
    login_screen.dart
    Add login screen with AuthService authentication                 

    frontend/lib/features/auth/presentation/login_screen.dart

  • Added a login screen that uses AuthService for authentication.
  • Handles loading, error display, and navigation to dashboard on
    success.
  • +89/-0   
    home_screen.dart
    Add main home screen with navigation rail and sections     

    frontend/lib/features/home/screens/home_screen.dart

  • Added HomeScreen with a navigation rail for main app sections.
  • Integrates dashboard, projects, documents, notifications, external
    tools, and profile screens.
  • Handles navigation and UI state for selected section.
  • +90/-0   
    account_settings_screen.dart
    Add account settings screen with password and theme options

    frontend/lib/features/home/screens/account_settings_screen.dart

  • Added AccountSettingsPage for managing account settings.
  • Includes options for changing password, logging out, and toggling dark
    theme.
  • Integrates with theme provider for theme switching.
  • +78/-0   
    document_models.dart
    Add document data model for API integration                           

    frontend/lib/features/home/data/document_models.dart

  • Added DocumentDTO model for representing document data.
  • Includes fields for document properties and a fromJson factory.
  • +53/-0   
    auth_models.dart
    Add authentication token and user profile models                 

    frontend/lib/features/auth/data/auth_models.dart

  • Added models for authentication tokens and user profiles.
  • Includes constructors and fromJson factories for both models.
  • +50/-0   
    strings.dart
    Add application-wide string constants for UI                         

    frontend/lib/core/constants/strings.dart

  • Added AppStrings class with static string constants for UI text.
  • Includes labels, button texts, error messages, and section titles.
  • +32/-0   
    tool_chat_screen.dart
    Add placeholder screen for external chat integration         

    frontend/lib/features/home/screens/tool_chat_screen.dart

  • Added ToolChatScreen as a placeholder for external chat integration.
  • Displays a message indicating the feature is not yet implemented.
  • +37/-0   
    section_card.dart
    Add StatusBadge widget for status display with color         

    frontend/lib/core/widgets/section_card.dart

  • Added a new StatusBadge widget for displaying status with color
    coding.
  • Implements logic to determine badge color based on status string.
  • Uses custom colors and styles for visual consistency.
  • +39/-0   
    theme_provider.dart
    Add ThemeProvider for app-wide theme management and persistence

    frontend/lib/theme/theme_provider.dart

  • Introduced a ThemeProvider class for managing dark/light theme state.
  • Handles theme persistence using SharedPreferences.
  • Provides methods to toggle and load/save theme preference.
  • +33/-0   
    custom_textfield.dart
    Add reusable CustomTextField widget for styled input         

    frontend/lib/core/widgets/custom_textfield.dart

  • Added a CustomTextField widget for reusable styled text input.
  • Supports label, controller, optional obscuring, and prefix icon.
  • Applies consistent theming and input decoration.
  • +33/-0   
    primary_button.dart
    Add PrimaryButton widget for consistent primary actions   

    frontend/lib/core/widgets/primary_button.dart

  • Added a PrimaryButton widget for consistent primary action buttons.
  • Applies custom color, padding, and text style.
  • Supports full-width and disabled state.
  • +32/-0   
    navigation_utils.dart
    Add smartPop navigation utility for flexible back navigation

    frontend/lib/core/widgets/navigation_utils.dart

  • Added a smartPop utility function for navigation.
  • Pops the navigation stack if possible, otherwise navigates to a
    fallback route.
  • Integrates with go_router for flexible navigation handling.
  • +10/-0   
    document_service.py
    Add DocumentService with CRUD, permissions, and versioning logic

    backend/api/document_service/app/services/document_service.py

  • Added a comprehensive DocumentService class for document management.
  • Implements CRUD operations, permission checks, versioning, and
    integration with Supabase for storage.
  • Handles permission logic, error handling, and DTO conversions.
  • Provides methods for uploading, versioning, and managing document
    permissions.
  • +1025/-0
    main.py
    Add FastAPI app for project management endpoints and logic

    backend/api/project_service/app/main.py

  • Added FastAPI application for project management service.
  • Implements endpoints for projects, members, tasks, comments,
    activities, and command pattern actions.
  • Integrates authentication, dependency injection, and CORS.
  • Exports utilities for integration testing.
  • +796/-0 
    project_service.py
    Add ProjectService for project and member management logic

    backend/api/project_service/app/services/project_service.py

  • Added ProjectService class for project and member management.
  • Implements CRUD operations, member role checks, and activity logging.
  • Handles permission logic for project actions.
  • Provides DTO conversion methods for API responses.
  • +641/-0 
    main.py
    Add FastAPI app for external tools and integrations           

    backend/api/external_tools_service/app/main.py

  • Added FastAPI application for external tools integration.
  • Implements endpoints for OAuth providers, connections, analytics, AI,
    and calendar features.
  • Integrates authentication, dependency injection, and CORS.
  • Exports utilities for integration testing.
  • +344/-0 
    sms_tools.py
    Add Twilio SMS sending utility for external tools               

    backend/api/external_tools_service/app/services/sms_tools.py

  • Added send_sms_twilio function for sending SMS using Twilio.
  • Handles environment variable checks and error reporting.
  • Provides fallback if Twilio library is missing.
  • +26/-0   
    Tests
    10 files
    profile_screen.dart
    Add test profile screen with settings and logout                 

    frontend/test/profile_screen.dart

  • Added a test ProfilePage widget for displaying and editing user
    profile information.
  • Includes theme switching, notification/account settings navigation,
    and logout functionality.
  • Uses provider for theme and authentication state.
  • +165/-0 
    project_create_screen.dart
    Add test project creation screen with form                             

    frontend/test/project_create_screen.dart

  • Added a test page for creating a new project with a form.
  • Handles form validation and navigation on submission.
  • +77/-0   
    home_screen.dart
    Add test home screen with bottom navigation                           

    frontend/test/home_screen.dart

  • Added a test HomeScreen with bottom navigation for main app sections.
  • Integrates test pages for projects, documents, notifications, external
    tools, and profile.
  • +66/-0   
    externaltools_screen.dart
    Add test external tools listing screen                                     

    frontend/test/externaltools_screen.dart

  • Added a test page for listing external tools with icons and
    descriptions.
  • Provides navigation feedback on tool selection.
  • +54/-0   
    projects_screen.dart
    Add test projects listing screen with navigation                 

    frontend/test/projects_screen.dart

  • Added a test projects listing page with navigation to project details
    and creation.
  • Displays a list of sample projects with creation dates.
  • +46/-0   
    account_settings_screen.dart
    Add test account settings screen with actions                       

    frontend/test/account_settings_screen.dart

  • Added a test account settings page with user info and actions.
  • Includes buttons for editing information and deleting the account.
  • +39/-0   
    documents_screen.dart
    Add test documents listing screen with actions                     

    frontend/test/documents_screen.dart

  • Added a test documents listing page with sample documents.
  • Displays document icons, related projects, and action icons.
  • +39/-0   
    notifications_screen.dart
    Add NotificationsPage widget for notification display       

    frontend/test/notifications_screen.dart

  • Added a NotificationsPage widget for displaying notifications.
  • Uses ExpansionTile to show notification details.
  • Provides a mock list of notifications for demonstration/testing.
  • +29/-0   
    notifications_preferences_screen.dart
    Add NotificationPreferencesPage for notification settings UI

    frontend/test/notifications_preferences_screen.dart

  • Added a NotificationPreferencesPage widget for notification settings.
  • Implements toggles for different notification preferences.
  • Provides a mock UI for user notification preferences.
  • +32/-0   
    out.txt
    Add or update backend test output and coverage report       

    backend/out.txt

  • Added/updated test output log with detailed pytest results.
  • Shows test session summary, failures, and coverage report.
  • Useful for debugging and CI visibility.
  • [link]   
    Additional files
    101 files
    flake8.yml +22/-0   
    sonar.yml +76/-0   
    README.md +273/-1 
    .coveragerc [link]   
    .dockerignore +85/-0   
    Dockerfile +35/-0   
    go.mod [link]   
    go.mod [link]   
    main.go [link]   
    requirements.txt [link]   
    __init__.py +3/-0     
    __init__.py +1/-0     
    main.py +145/-0 
    __init__.py +1/-0     
    auth_middleware.py +157/-0 
    circuit_breaker.py +209/-0 
    __init__.py +1/-0     
    __init__.py +1/-0     
    service_registry.py +267/-0 
    __init__.py +1/-0     
    __init__.py +1/-0     
    __init__.py +1/-0     
    main.py +133/-0 
    __init__.py +1/-0     
    __init__.py +1/-0     
    supabase_client.py +15/-0   
    __init__.py +1/-0     
    user.py +54/-0   
    __init__.py +1/-0     
    auth_service.py +267/-0 
    __init__.py +1/-0     
    __init__.py +1/-0     
    __init__.py +1/-0     
    document_decorators.py +147/-0 
    __init__.py +1/-0     
    document_factory.py +205/-0 
    main.py +457/-0 
    __init__.py +1/-0     
    __init__.py +1/-0     
    document.py +113/-0 
    __init__.py +1/-0     
    __init__.py +1/-0     
    __init__.py +1/-0     
    __init__.py +1/-0     
    oauth_adapter.py +463/-0 
    __init__.py +1/-0     
    __init__.py +1/-0     
    external_tools.py +108/-0 
    __init__.py +1/-0     
    ai_tools.py +25/-0   
    analytics_tools.py +23/-0   
    calendar_tools.py +66/-0   
    document_tools.py +27/-0   
    email_tools.py +28/-0   
    external_tools_service.py +607/-0 
    push_tools.py +20/-0   
    __init__.py +1/-0     
    __init__.py +1/-0     
    main.py +311/-0 
    __init__.py +1/-0     
    __init__.py +1/-0     
    notification_observer.py +153/-0 
    __init__.py +1/-0     
    notification.py +126/-0 
    __init__.py +1/-0     
    notification_service.py +545/-0 
    __init__.py +1/-0     
    __init__.py +1/-0     
    __init__.py +1/-0     
    task_commands.py +287/-0 
    __init__.py +1/-0     
    __init__.py +1/-0     
    activity.py +26/-0   
    project.py +78/-0   
    task.py +86/-0   
    __init__.py +1/-0     
    activity_service.py +169/-0 
    task_service.py +605/-0 
    __init__.py +1/-0     
    __init__.py +1/-0     
    auth_dtos.py +48/-0   
    document_dtos.py +93/-0   
    external_tools_dtos.py +109/-0 
    notification_dtos.py +111/-0 
    project_dtos.py +155/-0 
    __init__.py +1/-0     
    auth_exceptions.py +91/-0   
    base_exceptions.py +161/-0 
    document_exceptions.py +103/-0 
    project_exceptions.py +103/-0 
    __init__.py +1/-0     
    auth_middleware.py +157/-0 
    __init__.py +1/-0     
    base.py +32/-0   
    document.py +65/-0   
    external_tools.py +85/-0   
    notification.py +55/-0   
    project.py +114/-0 
    user.py +69/-0   
    __init__.py +1/-0     
    Additional files not shown

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Oyhs-co and others added 30 commits April 6, 2025 13:20
    - se eliminaron archivos go.mod y main.go de algunos microservicios
    - se migra todo el backend a python
    - se añadio flake8.yml y su configuracion
    - se añadio .flake8
    …gration
    
    - se agrego los esquemas, modelos y la logica crud al microservicio
    - se genero la api que comprende al microservicio
    - se cambiaron los nombres de ciertos archivos para que vaya de acuerdo a la notacion
    - se agregaron cambios en projects_routes.py para implementar de manera correcta CRUD
    - se agrgaron camios en schemas para hacer los esquemas mas adaptables
    - se agrego la verificacion con auth.py
    - se agrego auth.py al modulo `src` de projects-service
    - notification_controller.py: defines endpoints for email and push notifications
    - notification_service.py: contains core logic for sending notifications
    - utils/email_sender.py: handles email sending via SMTP
    - utils/push_sender.py: handles push notifications via Firebase
    - utils/mq_listener.py: listens to events from RabbitMQ and triggers notifications
    - utils/__init__.py: marks utils as a Python package
    …greSQL and MongoDB support
    
    - Se agregaron las conexiones para MongoDB, PostgreSQL y archivos JSON.
    - Se creó el archivo `config.py` para la configuración general del microservicio.
    - Se agregó el archivo provisional `DBselect.py` para seleccionar la base de datos a utilizar.
    - Se renombraron o eliminaron archivos según la nueva estructura del servicio.
    … operations.
    
    - Se eliminó la carpeta `routes/`.
    - Se movió `projects_routes.py` desde `routes/` a la raíz del microservicio.
    - Se reestructuró `src/__init__.py` para mejorar la importación y ejecución de rutas.
    …ers and main service for ExternalTools to correct directory
    
    - se movio toda la logica del microservicio a su directorio correspondiente
    Oyhs-co and others added 26 commits May 5, 2025 11:19
    …rror handling; update CI workflow and dependencies
    …ce with static logout method and register placeholder; modify tests to use PostgreSQLDB
    …t definitive
    
    - se actualizo los `.gitignore` para que evitar mandar los  `.env` de cada microservicio.
    - se modificaron diferentes rutas de importacion para poder poner en funcionamiento los microservicios.
    - se reajustaron algunas bases de datos.
    - Includes setup for auth, projects, documents, notifications, externaltools, and gateway services.
    …edit, and task detail functionalities
    
    - Added ProjectDetailPage to display project information, tasks, documents, and activities.
    - Created ProjectEditScreen for editing project details with form validation.
    - Developed ProjectsPage for listing projects with search functionality.
    - Introduced TaskDetailScreen to show task details and allow status updates.
    - Added ToolAnalyticsScreen, ToolCalendarScreen, and ToolChatScreen as placeholders for future features.
    
    Co-authored-by: vollereiseelee
    Co-authored-by: andreztxt
    …ement
    
    - Deleted `projects.json`, `pytest.ini`, `requirements.txt`, and `run-backend.ps1` as part of the cleanup.
    - Introduced `pyproject.toml` for managing dependencies and project configuration using Poetry.
    - Updated dependencies to their respective versions for better compatibility and maintenance.
    …on screens
    
    - Added `pyproject.toml` for backend dependencies and configuration.
    - Created `login_screen.dart` for user authentication.
    - Implemented `register_screen.dart` for user registration.
    - Developed `account_settings_screen.dart` for user account management.
    - Added `documents_screen.dart` to display user documents.
    - Created `externaltools_screen.dart` for external tools integration.
    - Implemented `home_screen.dart` with bottom navigation for different sections.
    - Developed `notifications_preferences_screen.dart` for notification settings.
    - Added `notifications_screen.dart` to display user notifications.
    - Created `profile_screen.dart` for user profile management.
    - Implemented `project_create_screen.dart` for creating new projects.
    - Developed `project_detail_screen.dart` to show project details and activities.
    - Added `projects_screen.dart` to list user projects.
    … UI screens
    
    - Implemented ProjectDTO, ProjectMemberDTO, TaskDTO, and ActivityDTO models for data representation.
    - Created ProjectService for handling API interactions related to projects, tasks, and activities.
    - Developed UI screens for account settings, documents, external tools, home, notifications, profile, project creation, project details, and project listing.
    - Integrated navigation and state management for a seamless user experience.
    - Added functionality for creating, updating, and deleting projects and tasks.
    - Included notification preferences and user profile management features.
    @vollereiseelee vollereiseelee merged commit 7f38986 into main Jun 6, 2025
    0 of 3 checks passed
    @qodo-code-review
    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 5 🔵🔵🔵🔵🔵
    🧪 PR contains tests
    🔒 Security concerns

    CORS configuration vulnerability:
    The API services (project_service, document_service) use CORS middleware with "allow_origins=["*"]" which allows any website to make requests to your API. This should be replaced with specific origins in production to prevent cross-site request forgery attacks.

    File upload security: The document conversion endpoint in document_service/main.py (lines 423-441) accepts arbitrary file uploads without proper validation and allows user-controlled paths for storage. This could lead to server-side request forgery, path traversal, or execution of malicious files if the LibreOffice converter has vulnerabilities.

    Hardcoded secrets: The code appears to use Supabase for storage but doesn't show how credentials are managed. If credentials are hardcoded in the SupabaseManager class (referenced but not shown), this would be a security concern.

    ⚡ Recommended focus areas for review

    Undefined Variable

    The update_task method references an undefined 'command_invoker' variable when executing the ChangeTaskStatusCommand. This will cause a runtime error when updating a task's status.

    command = ChangeTaskStatusCommand(self.db, task_id, task_data.status.value)
    task = command_invoker.execute_command(command)
    Security Concern

    The convert_document endpoint allows arbitrary file uploads without proper validation, which could lead to processing malicious files. Additionally, the supabase_path parameter can be controlled by users.

    async def convert_document(
        file: UploadFile = File(...),
        output_format: str = "pdf",
        supabase_bucket: str = "documents",
        supabase_path: str = None,
        user_id: str = Depends(get_current_user),
    ):
        """
        Convierte un documento usando LibreOffice Online y lo sube a Supabase Storage.
        """
        import tempfile
        import shutil
        if not supabase_path:
            supabase_path = f"converted/{file.filename}.{output_format}"
        with tempfile.NamedTemporaryFile(delete=False) as tmp:
            shutil.copyfileobj(file.file, tmp)
            tmp_path = tmp.name
        url = process_document_with_libreoffice(tmp_path, output_format, supabase_bucket, supabase_path)
        return {"url": url}
    CORS Configuration

    The CORS middleware is configured to allow all origins ("*") which is not recommended for production environments as it may lead to cross-origin security vulnerabilities.

    app.add_middleware(
        CORSMiddleware,
        allow_origins=["*"],  # In production, replace with specific origins
        allow_credentials=True,
        allow_methods=["*"],
        allow_headers=["*"],
    )

    @qodo-code-review
    Copy link

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Fix incorrect entity ID

    The code incorrectly logs the ID of the current user's project membership
    (project_member.id) instead of the ID of the member being removed
    (member_to_remove.id). This will cause incorrect activity tracking.

    backend/api/project_service/app/services/project_service.py [537-545]

     # Log activity before deletion
     self.activity_service.log_activity(
         project_id=project_id,
         user_id=user_id,
         action="remove_member",
         entity_type="project_member",
    -    entity_id=str(project_member.id),
    +    entity_id=str(member_to_remove.id),
         details=None,
     )

    [To ensure code accuracy, apply this suggestion manually]

    Suggestion importance[1-10]: 8

    __

    Why: This fixes a clear bug where the wrong entity ID (project_member.id instead of member_to_remove.id) is being logged, affecting data integrity and audit trails.

    Medium
    Fix authentication header conflict

    The GitHub token revocation endpoint requires both authorization header and
    basic auth, but the way they're combined here is problematic. GitHub's API
    expects the client credentials in the basic auth header, not the access token in
    both places. Remove the access token from the Authorization header.

    backend/api/external_tools_service/app/adapters/oauth_adapter.py [244-247]

     def revoke_token(self, provider: OAuthProvider, access_token: str) -> bool:
         """
         Revoke GitHub access token.
     
         Args:
             provider (OAuthProvider): OAuth provider
             access_token (str): Access token
     
         Returns:
             bool: True if token was revoked, False otherwise
         """
         # Make request
         headers = {
    -        "Authorization": f"token {access_token}",
             "Accept": "application/json",
         }
         response = requests.delete(
             f"https://api.github.com/applications/{provider.client_id}/token",
             auth=(provider.client_id, provider.client_secret),
             json={"access_token": access_token},
             headers=headers,
         )

    [To ensure code accuracy, apply this suggestion manually]

    Suggestion importance[1-10]: 8

    __

    Why: The GitHub API token revocation endpoint expects basic auth with client credentials, not both basic auth and authorization header. This authentication conflict could cause the token revocation to fail.

    Medium
    Prevent circular document references

    The code uses setattr() to update document attributes but doesn't handle the
    case where a parent document might reference itself, creating a circular
    reference. Add validation to prevent a document from setting its own ID as its
    parent_id.

    backend/api/document_service/app/services/document_service.py [244-257]

     # Update document
     if document_data.name is not None:
         setattr(document, 'name', document_data.name)
     
     if document_data.parent_id is not None:
    +    # Prevent circular reference
    +    if document_data.parent_id == document_id:
    +        raise InvalidDocumentTypeException("Document cannot be its own parent")
         setattr(document, 'parent_id', document_data.parent_id)
     
     if document_data.description is not None:
         setattr(document, 'description', document_data.description)
     
     if document_data.tags is not None:
         setattr(document, 'tags', document_data.tags)
     
     if document_data.meta_data is not None:
         setattr(document, 'meta_data', document_data.meta_data)

    [To ensure code accuracy, apply this suggestion manually]

    Suggestion importance[1-10]: 7

    __

    Why: This prevents a potential circular reference bug where a document could set itself as its own parent, which could cause issues in tree traversal or infinite loops.

    Medium
    Delete document versions

    The code doesn't delete document versions when deleting a document. This will
    leave orphaned files in storage and potentially orphaned records in the
    database. Add code to delete all associated document versions.

    backend/api/document_service/app/services/document_service.py [294-307]

    -# Delete document from storage if it's a file
    -if document.type == DocumentType.FILE and document.url:
    -    try:
    -        # Extract bucket name and file path from URL
    -        # This is a simplified example, actual implementation may vary
    -        url_parts = document.url.split("/")
    -        bucket_name = url_parts[-2]
    -        file_path = url_parts[-1]
    +# Delete document versions from storage and database
    +if document.type == DocumentType.FILE:
    +    # Get all document versions
    +    document_versions = (
    +        self.db.query(DocumentVersion)
    +        .filter(DocumentVersion.document_id == document_id)
    +        .all()
    +    )
    +    
    +    # Delete each version's file from storage
    +    for version in document_versions:
    +        if version.url:
    +            try:
    +                # Extract bucket name and file path from URL
    +                url_parts = version.url.split("/")
    +                bucket_name = url_parts[-2]
    +                file_path = url_parts[-1]
    +                
    +                # Delete file from storage
    +                self.supabase_manager.delete_file(bucket_name, file_path)
    +            except Exception as e:
    +                # Log error but continue with document deletion
    +                print(f"Error deleting version file from storage: {e}")
    +    
    +    # Delete main document file if it exists
    +    if document.url:
    +        try:
    +            url_parts = document.url.split("/")
    +            bucket_name = url_parts[-2]
    +            file_path = url_parts[-1]
    +            
    +            # Delete file from storage
    +            self.supabase_manager.delete_file(bucket_name, file_path)
    +        except Exception as e:
    +            # Log error but continue with document deletion
    +            print(f"Error deleting file from storage: {e}")
     
    -        # Delete file from storage
    -        self.supabase_manager.delete_file(bucket_name, file_path)
    -    except Exception as e:
    -        # Log error but continue with document deletion
    -        print(f"Error deleting file from storage: {e}")
    -
    • Apply / Chat
    Suggestion importance[1-10]: 7

    __

    Why: This prevents resource leaks by ensuring all document versions are properly cleaned up when deleting a document, maintaining data consistency and preventing storage bloat.

    Medium
    Clean up temporary files

    The temporary file created is never deleted after processing, which can lead to
    disk space exhaustion. Add cleanup code to remove the temporary file after it's
    been processed.

    backend/api/document_service/app/main.py [422-441]

     @app.post("/documents/convert", tags=["Documents"])
     async def convert_document(
         file: UploadFile = File(...),
         output_format: str = "pdf",
         supabase_bucket: str = "documents",
         supabase_path: str = None,
         user_id: str = Depends(get_current_user),
     ):
         """
         Convierte un documento usando LibreOffice Online y lo sube a Supabase Storage.
         """
         import tempfile
         import shutil
    +    import os
         if not supabase_path:
             supabase_path = f"converted/{file.filename}.{output_format}"
         with tempfile.NamedTemporaryFile(delete=False) as tmp:
             shutil.copyfileobj(file.file, tmp)
             tmp_path = tmp.name
    -    url = process_document_with_libreoffice(tmp_path, output_format, supabase_bucket, supabase_path)
    -    return {"url": url}
    +    try:
    +        url = process_document_with_libreoffice(tmp_path, output_format, supabase_bucket, supabase_path)
    +        return {"url": url}
    +    finally:
    +        if os.path.exists(tmp_path):
    +            os.unlink(tmp_path)
    • Apply / Chat
    Suggestion importance[1-10]: 7

    __

    Why: Valid resource management issue. The temporary file created with delete=False is never cleaned up, which can lead to disk space exhaustion over time. The suggestion correctly adds proper cleanup using try/finally.

    Medium
    Security
    Fix CORS security configuration

    Setting allow_origins=["*"] while allow_credentials=True creates a security
    vulnerability. When credentials are allowed, origins must be explicitly
    specified rather than using a wildcard to prevent cross-site request forgery
    attacks.

    backend/api/external_tools_service/app/main.py [38-44]

     app.add_middleware(
         CORSMiddleware,
    -    allow_origins=["*"],  # In production, replace with specific origins
    +    allow_origins=[os.getenv("ALLOWED_ORIGINS", "http://localhost:3000").split(",")],  # Specify allowed origins
         allow_credentials=True,
         allow_methods=["*"],
         allow_headers=["*"],
     )
    • Apply / Chat
    Suggestion importance[1-10]: 5

    __

    Why: Identifies a real security vulnerability with CORS configuration, but the improved_code has a syntax error calling .split(",") on a list. The security concern is valid but the proposed solution is flawed.

    Low
    • More

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    4 participants