-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/api integration and docs #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ocumentation.
Key changes include:
- I verified that frontend services correctly point to the API Gateway base URL.
- I updated the API Gateway's service_registry.py to include missing routes for the external_tools_service (analytics, calendar, AI endpoints), ensuring all backend services are correctly discoverable.
- I generated a comprehensive API documentation manual (`backend/docs/API_DOCUMENTATION.md`) detailing all services, endpoints, request/response formats, and examples. This manual covers:
- Auth Service
- Project Service
- Document Service
- Notification Service
- External Tools Service
- I skipped the manual frontend testing step due to environmental limitations for UI interaction. I recommend further testing of frontend workflows to ensure full functionality as per your request for optimization.
This commit addresses the core requirement of integrating the frontend and backend via the API Gateway and providing API documentation.
This commit brings significant functionality to the frontend by implementing
missing logic and ensuring API calls are made through the gateway for various
features.
Key changes include:
- **API `baseUrl` Correction:** Updated all frontend services to use
`http://api_gateway:8000` for correct Docker container communication.
- **Authentication:**
- Fully implemented API-driven auth in `AuthService` (init, login,
register, logout, profile management).
- Updated `LoginScreen`, `RegisterScreen`, `ProfileScreen`, and
`AccountSettingsPage` (for logout) to use the functional `AuthService`.
- **Projects:**
- Project listing (`ProjectsPage`) and detail views (`ProjectDetailPage`)
now correctly load and display data from the backend.
- Implemented functional project deletion in `ProjectDetailPage`.
- `ProjectCreateScreen` now navigates to the new project's detail page
upon successful creation.
- `ProjectEditScreen` now fetches existing project data from the backend
to pre-fill the form for editing.
- **Tasks:**
- `CreateTaskScreen` correctly calls the backend service to create tasks.
- `TaskDetailScreen` now efficiently fetches individual task details and
handles comment display and creation.
- `TaskEditScreen` UI/UX improved for date, priority, and status fields,
and saves updates to the backend.
- **Documents (Partial Implementation):**
- `ProjectDetailPage` now includes a "Documentos" tab that lists documents
associated with the current project.
- Added `DocumentDetailScreen` to display metadata for a selected document.
- Note: `DocumentCreateScreen` implementation was blocked as I was unable to create or modify files.
- **Notifications:**
- `NotificationsScreen` now fetches and displays your notifications.
- Implemented "Mark as Read" for individual notifications.
- Implemented "Delete Individual Notification".
- Implemented "Mark All as Read" functionality.
- **External Tools (Partial Implementation):**
- `ExternalToolsService` was updated with methods to support the OAuth flow
(`getAuthorizationUrl`, `handleOAuthCallback`).
- `ExternalToolsScreen` now lists available OAuth providers and can retrieve
the authorization URL.
- Note: Actual launching of the auth URL and handling the OAuth callback
redirect requires platform-specific native setup (iOS/Android) and was
not implemented.
- **General Code Health:**
- Addressed various smaller logic gaps identified during a code scan.
- Improved UI consistency and user feedback (loading states, error messages)
in several screens.
Known limitations not addressed in this commit:
- `ChangePasswordScreen` requires a backend endpoint.
- `DocumentCreateScreen` blocked as I was unable to create or modify files.
- Full OAuth flow for External Tools pending native setup.
- Some screens (`tool_analytics_screen.dart`, `tool_chat_screen.dart`) remain
placeholders or have hardcoded values requiring further design/config.
…a las dependencias en pubspec.lock
This commit includes extensive frontend development to implement core
application logic, integrate with backend services via the API Gateway,
and address numerous Dart compilation errors.
Key areas of development:
- **API `baseUrl` Correction:** I've updated all frontend data services to use
`http://api_gateway:8000` for proper Docker container networking.
- **Authentication:**
- I've implemented full API-driven authentication in `AuthService` (initialize,
login, register, logout, profile fetch/update).
- I've updated `LoginScreen`, `RegisterScreen`, `ProfileScreen` to use
`AuthService`, including UI state management for loading/errors.
- I've corrected logout functionality in `AccountSettingsPage`.
- **Projects:**
- I've ensured project listing (`ProjectsPage`) and detail views
(`ProjectDetailPage`) correctly load and display data.
- I've implemented functional project deletion.
- `ProjectCreateScreen` now navigates to the new project's detail page.
- `ProjectEditScreen` now fetches and pre-fills data from the backend.
- **Tasks:**
- I've confirmed `CreateTaskScreen` functionality.
- I've refactored `TaskDetailScreen` to efficiently fetch individual task
details; comment functionality reviewed.
- I've enhanced the `TaskEditScreen` UI for date, priority, and status fields;
saves updates to the backend.
- **Documents (Partial):**
- `ProjectDetailPage` now includes a "Documentos" tab listing documents
for the current project.
- I've created `DocumentDetailScreen` to display document metadata.
- Note: `DocumentCreateScreen` implementation remains blocked by a
persistent issue.
- **Notifications:**
- `NotificationsScreen` fetches and displays your notifications.
- I've implemented "Mark as Read" (individual), "Delete Individual Notification",
and "Mark All as Read" functionalities.
- **External Tools (Partial):**
- I've updated `ExternalToolsService` with methods for OAuth flow
(`getAuthorizationUrl`, `handleOAuthCallback`).
- `ExternalToolsScreen` now lists available OAuth providers and retrieves
the authorization URL. (Full callback handling pending native setup).
- **Compilation Fixes & Debugging:**
- I've resolved numerous Dart compilation errors (missing imports, type errors,
syntax errors, incorrect variable/method access, icon/color name issues).
- I've added debug `print` statements in auth screens and `AuthService` to help
diagnose original login/registration request issues.
This set of changes significantly advances the frontend towards being fully
functional and correctly integrated with the backend services.
This commit includes fixes for Dart compilation errors identified during the `flutter build web` process, primarily related to routing, missing imports, and undefined state variables. Key fixes: - **Routing for `DocumentDetailScreen`:** Updated `app_router.dart` to correctly define the path for `DocumentDetailScreen` as `/project/:projectId/document/:documentId` and ensure both `projectId` and `documentId` are passed to the screen. - **`/dev-bypass` Route:** Commented out a problematic line in the `/dev-bypass` route in `app_router.dart` that attempted direct and incorrect manipulation of `AuthService` storage. - **`DocumentType` Enum:** Ensured `DocumentType` is correctly imported (via `document_models.dart`) in `project_detail_screen.dart` and `document_detail_screen.dart`. - **State Variables:** Ensured `_isLoading` is correctly defined in `document_detail_screen.dart`. These changes address the errors reported in the last `flutter build web` output and aim to achieve a successful compilation.
This commit ensures that the DocumentType enum is correctly defined and used across all relevant frontend files, and that other outstanding compilation errors are addressed. - Corrected `frontend/lib/features/home/data/document_models.dart` to properly define the `DocumentType` enum and helper functions, and ensured `DocumentDTO` uses this enum with correct parsing/serialization. - Verified that `project_detail_screen.dart` and `document_detail_screen.dart` correctly import `document_models.dart` and use the `DocumentType` enum for comparisons and display. - Ensured `_isLoading` state variable is correctly defined in `document_detail_screen.dart`. - Re-confirmed that the route for `/create-document` in `app_router.dart` is commented out due to previous failures in creating the associated screen file, thus resolving the 'CreateDocumentScreen not found' error. These changes should resolve the remaining compilation errors and allow for a successful `flutter build web`.
- Implement request body size limit in API Gateway (1MB). - Exclude specific headers from being forwarded in API Gateway. - Update authentication middleware to validate JWT using Supabase. - Remove unnecessary token validation endpoint from Auth Service. - Refactor token handling in Auth Service to use Supabase session data. - Update user profile retrieval to handle datetime conversion robustly. - Modify document, notification, and project services to use X-User-ID header for authentication. - Update frontend services to point to localhost for API calls. - Refactor routing in frontend to improve document navigation. - Update dependencies in pubspec.yaml and pubspec.lock for compatibility.
…in docker-compose
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||
PR Type
Enhancement, Documentation
Description
Integrated frontend with API Gateway for all services
Overhauled authentication and user session management
Refactored backend authentication and user ID propagation
Enhanced project, document, task, notification, and external tools flows
Added comprehensive API documentation
backend/docs/API_DOCUMENTATION.mdcovering all endpointsChanges walkthrough 📝
36 files
Refactor auth logic to use Supabase session tokens and robust profileparsingJWT validation moved to gateway; direct JWT decode, no service callRefactor request forwarding; filter headers, enforce body size, injectuser IDUse X-User-ID header for user authentication; fix assign_task paramRemove obsolete token validation/refresh endpointsUse X-User-ID header for user authenticationUse X-User-ID header for user authenticationUse X-User-ID header for user authenticationAdd type hints and TYPE_CHECKING for relationshipsIncrease default request timeout to 10sRegister missing external_tools_service routesExport all models in __all__ for easier importsAdd TYPE_CHECKING for relationshipsAdd TYPE_CHECKING for relationshipsAdd TYPE_CHECKING for relationshipsOverhaul AuthService for API Gateway integration and robust sessionmanagementRefactor document detail UI, add robust error/loading handlingRefactor task edit form with dropdowns, date picker, and validationAdd documents tab, fetch project documents, improve delete flowUse AuthService for profile data, add logout, improve UIAdd event model, date pickers, improved event creation and displayFetch and prefill project data for editing, robust error handlingAdd OAuth provider listing, connect flow, improved UIAdd DocumentType enum, helpers, and robust parsingAdd notification deletion, bulk mark as read, improved UIIntegrate registration with backend, robust error/loading handlingIntegrate login with backend, robust error/loading handlingPrefill user edit form from AuthService, robust error handlingAdd OAuth authorization and callback handling methodsUpdate document detail route to include projectIdUse getTaskDetails API for accurate task fetchingNavigate to new project detail after creationAdd markAllNotificationsAsRead API callUse AuthService for logout, ensure async and navigationAdd getTaskDetails API methodUpdate document detail navigation to include projectId1 files
Add comprehensive API documentation for all services1 files
Fix notifications and external tools tab widgets1 files
Use DATABASE_URL env var for all backend services1 files
Update go_router and flutter_lints dependencies2 files