4.4 KiB
4.4 KiB
Kifi Project Handoff Document
This document provides an overview of the Kifi project, detailing the architecture, recent implementations, current state, and instructions for running the application.
1. Project Overview & Architecture
Kifi is an enterprise-grade project management and CRM application consisting of a mobile frontend and a reactive backend.
Backend (kifi-api)
- Framework: Spring Boot 3 with WebFlux (Reactive Stack)
- Language: Java 21
- Database: PostgreSQL accessed via Spring Data R2DBC
- Caching & Sessions: Redis (Reactive)
- Security: Spring Security with JJWT for token-based authentication
- Storage: Minio for S3-compatible object storage
- Architecture Pattern: Standard N-Tier (Controller → Service → Repository → Entity/DTO)
Frontend (kifi-app)
- Framework: Flutter
- State Management: Riverpod
- Networking: Dio for HTTP requests
- Key Dependencies:
file_picker,image_picker,path_provider,share_plus,fl_chart - Architecture Pattern: Feature-first modular structure (
auth,projects,transactions,business, etc.) with separation ofdata,domain,presentation, andproviders.
2. Recent Major Implementations
UI Standardization & Enterprise Polish
- Objective: Strictly adhere to a uniform, enterprise-grade design system across all list screens (Projects, Invoices, Vendors, Task Board), using the
CustomersScreenas the source of truth. - Changes made:
- Standardized background colors to
Colors.grey[100]across the app. - Implemented uniform search fields: white container,
grey[100]fill, rounded corners, no borders. - Redesigned the
TaskCardand task columns in theProjectBoardScreento look modern and functional.
- Standardized background colors to
Task Comments & File Attachments
- Initial State: Task comments only supported base64 encoded images stored directly in the PostgreSQL
TEXTcolumn. - New Feature: Implemented file attachments (PDFs, Docs, Images) for task comments with native downloading and sharing.
- Backend Refactor:
- Integrated
MinioServiceClientintoProjectService. - Modified
addCommentto intercept incoming base64 payloads, upload them to Minio in parallel using reactive streams (Flux), and save a JSON metadata string ([{"fileName": "...", "contentType": "...", "filePath": "..."}]) into the database. - Added a generic file download endpoint:
GET /projects/tasks/attachments/download.
- Integrated
- Frontend Refactor:
- Added
file_pickerdependency to support non-image documents. - Rebuilt the attachment picking UI in
TaskDetailsSheetto support both images and generic files. - Implemented a secure download mechanism using
dio,path_provider, andshare_plusto save and open documents natively. - Added an interactive image gallery (
AttachmentGalleryScreen) for previewing image attachments (both legacy base64 and new Minio-backed URLs).
- Added
3. Current State & Known Behaviors
- Backward Compatibility: The backend and frontend correctly handle "legacy" task comments that were saved purely as Base64 strings, alongside the new Minio-backed JSON structure.
- Application Configuration:
- Max in-memory size for Spring WebFlux was increased to
10MBinapplication.ymlto allow for large base64-encoded file uploads before they are dispatched to Minio.
- Max in-memory size for Spring WebFlux was increased to
- Outstanding Items:
- Since background services were interrupted, you may need to ensure your Minio container and Redis instance are up and running before testing the new upload flow.
4. Setup & Running Instructions
Backend
- Navigate to the backend directory:
cd kifi-api - Ensure your local PostgreSQL, Redis, and Minio instances are running.
- Clean and run the Spring Boot application:
./mvnw clean spring-boot:run
Frontend
- Navigate to the app directory:
cd kifi-app - Fetch new dependencies (especially the newly added
file_picker):flutter pub get - Run the app on your emulator or connected device:
flutter run
Warning
Because new native dependencies (
file_picker,share_plus) were added during the last session, hot-reloading will not work for these changes. You must stop the Flutter application completely and perform a fullflutter runto compile the native platform channels.