Commit Graph

115 Commits

Author SHA1 Message Date
mohamad
8f1da5d440 refactor: Improve Alembic migration functions by integrating configuration and script directory handling for enhanced migration context management
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 1m17s
2025-06-01 17:42:17 +02:00
mohamad
0f9d83a233 refactor: Update migration functions to accept connection parameter for improved flexibility and consistency
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 1m16s
2025-06-01 17:39:07 +02:00
mohamad
cb5bfcf7b5 refactor: Separate async migration logic into dedicated module and streamline migration functions for improved clarity and maintainability
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 1m17s
2025-06-01 17:33:04 +02:00
mohamad
e16c749019 refactor: Enhance Alembic migration functions to support direct execution and improve error handling for database URL configuration
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 1m18s
2025-06-01 17:29:48 +02:00
mohamad
7223606fdc refactor: Update Alembic migration functions to support asynchronous execution and streamline migration handling in application startup
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 1m20s
2025-06-01 17:20:28 +02:00
mohamad
f4eeb00acf fix: Add Alembic directory and configuration file to production Dockerfile for migration support
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 1m16s
2025-06-01 17:16:26 +02:00
mohamad
43e2d88ffe fix: Update Alembic configuration to use absolute paths for ini file and script location in migration process
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 1m15s
2025-06-01 17:13:09 +02:00
mohamad
32841ea727 fix: Enhance Alembic configuration by setting script location and database URL validation in migration process
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 1m17s
2025-06-01 17:09:49 +02:00
mohamad
26e06ddeaa refactor: Simplify Dockerfile by reorganizing Alembic file copying and enhance migration handling in application startup
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 1m21s
2025-06-01 17:03:13 +02:00
mohamad
f2df1c50dd fix: Update Alembic configuration in startup event to set script location and database URL
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 1m26s
2025-06-01 16:57:07 +02:00
mohamad
411c3c91b2 feat: Add Alembic configuration and migration command to application startup
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 1m16s
2025-06-01 16:54:16 +02:00
mohamad
5a2b311a4f fix ig
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 1m14s
2025-06-01 16:49:21 +02:00
mohamad
9b09b461bd refactor: Update production Dockerfile to use Node.js for serving built assets and enhance environment variable injection
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 1m24s
2025-06-01 16:46:00 +02:00
mohamad
9f8de46d06 refactor: Transition production Dockerfile to use Nginx for serving built assets and streamline environment variable handling
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 1m20s
2025-06-01 16:38:29 +02:00
mohamad
b1a74edb6a refactor: Update environment variable handling in Dockerfile for production
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 1m16s
2025-06-01 16:32:51 +02:00
mohamad
161292ff3b refactor: Optimize Dockerfiles and deployment workflow for improved performance and reliability
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 1m54s
- Updated Dockerfiles to use `python:3.11-slim` for reduced image size and enhanced build efficiency.
- Implemented multi-stage builds with selective file copying and non-root user creation for better security.
- Enhanced deployment workflow with retry logic for image pushes and added cleanup steps for Docker resources.
- Improved build commands with BuildKit optimizations for both backend and frontend images.
2025-06-01 16:26:49 +02:00
mohamad
55d08d36e0 refactor: Revise .dockerignore and Dockerfile for enhanced build efficiency and organization
Some checks failed
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Has been cancelled
- Updated .dockerignore to categorize ignored files, including logs and local development configurations.
- Implemented a multi-stage build in Dockerfile to optimize image size and dependency management.
- Added build dependencies and created a virtual environment for better isolation of Python packages.
2025-06-01 16:14:55 +02:00
mohamad
59f2f47949 refactor: Improve deployment workflow with retry logic for image pushes and optimized build process
Some checks failed
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Has been cancelled
2025-06-01 16:03:58 +02:00
mohamad
1e9957de91 refactor: Enhance deployment workflow for backend and frontend images
Some checks failed
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Failing after 24s
2025-06-01 16:00:55 +02:00
mohamad
6ed7e32922 refactor: Update .dockerignore for improved clarity and organization
Some checks failed
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Has been cancelled
- Consolidated and categorized ignored files for better readability.
- Added entries for logs, local development, and documentation.
- Removed redundant entries and ensured proper grouping of related files.
2025-06-01 15:56:49 +02:00
mohamad
cc1f910e4c refactor: Standardize user creation in Dockerfile and improve multi-stage build syntax
Some checks failed
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Failing after 4m40s
2025-06-01 15:47:42 +02:00
mohamad
cd98b7b854 refactor: Update backend Dockerfile to use Alpine package names
Some checks failed
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Failing after 20s
2025-06-01 15:46:08 +02:00
mohamad
392a2ae049 refactor: Switch backend Dockerfile to use Alpine package manager
Some checks failed
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Failing after 19s
2025-06-01 15:44:09 +02:00
mohamad
a51b18e8f5 refactor: Update Docker configurations for improved environment variable handling
Some checks failed
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Failing after 22s
- Changed the frontend Dockerfile to use process.env for environment variables instead of direct interpolation.
- Updated the production Docker Compose file to set environment variables directly instead of using build args.
- Switched the backend Dockerfile base image from `python:3.11-slim` to `python:alpine` for a smaller image size and increased worker count from 4 to 8 for better performance.
2025-06-01 15:41:42 +02:00
mohamad
99d6c5ffaa refactor: Improve environment variable injection in Dockerfile for production
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 30s
2025-06-01 15:34:59 +02:00
mohamad
dd29f27a5b fix: Update API base URL for development environment
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 27s
2025-06-01 15:15:56 +02:00
mohamad
d05200b623 refactor: Update frontend components and Dockerfile for production
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 38s
- Changed the build command in Dockerfile from `npm run build` to `npm run build-only` for optimized production builds.
- Simplified service worker initialization by removing conditional precaching logic.
- Enhanced styling and structure in `VListItem.vue` and `ListDetailPage.vue` for better readability and consistency with Valerie UI components.
- Improved focus handling in item addition and editing processes for better user experience.
- Cleaned up unused CSS classes and ensured consistent usage of Valerie UI components across the application.
2025-06-01 14:59:30 +02:00
mohamad
ed76816a32 Enhance deployment workflow with context variable debugging and fallback logic
Some checks failed
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Failing after 1m26s
2025-06-01 14:50:52 +02:00
mohamad
8c5753ea77 fix: Update Docker image tags
Some checks failed
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Failing after 17s
2025-06-01 14:47:45 +02:00
mohamad
12f35b539a fix: Update Docker login commands in deployment workflow
Some checks failed
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Failing after 16s
2025-06-01 14:41:09 +02:00
mohamad
e104d26583 chore: Update deployment workflow to trigger on closed pull requests to prod
Some checks failed
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Failing after 32s
2025-06-01 14:38:04 +02:00
mohamad
8ff31ecf91 refactor: Update deployment workflows and Dockerfiles for production
- Modified the GitHub Actions workflow to streamline the deployment process by installing Docker directly and using shell commands for building and pushing images.
- Changed the base image for the backend Dockerfile from `python:3.11-slim` to `python:alpine` for a smaller footprint.
- Updated the frontend Dockerfile to use `node:23-alpine` instead of `node:24-alpine`, and refactored the production stage to use `node:slim`. Added a script for runtime environment variable injection.
2025-06-01 14:37:09 +02:00
mohamad
1c87170955 refactor: use html for now
Some checks failed
Deploy to Production, build images and push to Gitea Registry / deploy (push) Failing after 2m14s
2025-06-01 14:27:46 +02:00
mohamad
74c73a9e8f refactor: Update GroupsPage to use standard HTML for now 2025-06-01 14:27:02 +02:00
mohamad
679169e4fb refactor: Simplify ChoresPage structure and enhance form functionality
- Removed redundant form elements and improved the layout for better readability.
- Streamlined the chore creation and editing process with enhanced validation and auto-save features.
- Updated keyboard shortcuts for improved accessibility and user experience.
- Enhanced modal interactions and improved loading states during data fetching.
- Cleaned up unused code and optimized the overall component structure.
2025-06-01 14:27:02 +02:00
google-labs-jules[bot]
a7fbc454a9 Refactor: Reset Alembic migrations and consolidate models.
This commit addresses issues with backend models, schemas, and migrations.

Key changes:
- Consolidated all SQLAlchemy model definitions into `be/app/models.py`.
- Emptied `be/app/models/expense.py` as its contents were duplicates.
- Verified and standardized Base class usage and SQLAlchemy imports in models.
- Confirmed the correctness of self-referential relationships in the `Expense` model.
- Added a clarifying comment to `SplitTypeEnum` regarding future extensibility.
- Corrected a typo in `Settlement.created_by_user_id`.

Migration Cleanup:
- Deleted all existing Alembic migration files from `be/alembic/versions/`.
- Created a new, single initial migration script (`0001_initial_schema.py`) that defines the entire database schema based on the current state of the SQLAlchemy models. This provides a clean slate for future migrations.

This reset was performed because the previous migration history was complex and contained a revision that was incompatible with the current model definitions. Starting fresh ensures consistency between the models and the database schema from the initial point.
2025-06-01 14:26:37 +02:00
google-labs-jules[bot]
813ed911f1 Okay, I've made some changes to integrate the Valerie UI components into the Account, Group Detail, and List Detail pages. This is part of the ongoing effort to standardize the UI and make the code easier to maintain.
Here's a breakdown of the changes:

1.  **`AccountPage.vue`**:
    *   I replaced the main heading with `VHeading`.
    *   I updated the loading spinner to `VSpinner`.
    *   I converted the error alert to `VAlert` with an action button.
    *   I refactored the Profile, Password, and Notifications sections to use `VCard` for their structure.
    *   The form elements within these cards (name, email, passwords) now use `VFormField` and `VInput`.
    *   Action buttons like "Save Changes" and "Change Password" are now `VButton` with an integrated `VSpinner` for loading states.
    *   The notification preferences list uses `VList` and `VListItem`, with each preference toggle converted to `VToggleSwitch`.

2.  **`GroupDetailPage.vue`**:
    *   I updated the page-level loading spinner, error alert, and main heading to `VSpinner`, `VAlert`, and `VHeading`.
    *   I refactored the "Group Members", "Invite Members", "Chores", and "Expenses" sections from custom "neo-card" styling to use `VCard`.
    *   Headers within these cards use `VHeading` and action buttons use `VButton` (I kept Material Icons where `VIcon` wasn't a direct replacement).
    *   Lists of members, chores, and expenses now use `VList` and `VListItem`.
    *   Buttons within list items (e.g., "Remove member") are `VButton` with `VSpinner`.
    *   Role indicators and frequency/split type "chips" are now `VBadge` components, and I updated the helper functions to return VBadge-compatible variants.
    *   The "Invite Members" form elements (input for code, copy button) use `VFormField`, `VInput`, and `VButton`.
    *   I simplified empty states within card bodies using `VIcon` and text.

3.  **`ListDetailPage.vue`**: This complex page required several steps to refactor:
    *   **Page-Level & Header:** I updated the loading state to `VSpinner`, the error alert to `VAlert`, and the main title to `VHeading`. Header action buttons are `VButton` with icons, and the list status is `VBadge`.
    *   **Modals:** I converted all five custom modals (OCR, Confirmation, Edit Item, Settle Share, Cost Summary shell) to use `VModal`. Internal forms and actions within these modals now use `VFormField`, `VInput`, `VButton`, `VSpinner`, `VList`, `VListItem`, and `VAlert` as appropriate. I removed the `onClickOutside` logic.
    *   **Main Items List:** The loading state uses `VCard` with `VSpinner`, and the empty state uses `VCard variant="empty-state"`. The list itself is now a `VCard` containing a `VList`. Each item is a `VListItem` with internal content refactored to use `VCheckbox`, `VInput` (for price), and `VButton` with `VIcon` for actions.
    *   **Add Item Form:** I re-structured this below the items list, using `VFormField`, `VInput`, and `VButton` with `VIcon`.
    *   **Expenses Section:** The main card uses `VCard` with `VHeading` and `VButton` in the header. Loading/error/empty states use `VSpinner`, `VAlert`, `VIcon`. The expenses list is `VList`, with each expense item as a `VListItem`. Statuses are `VBadge`.

This refactoring significantly increases the usage of the Valerie UI component library across these key application pages. This should help create a more consistent experience for you and make development smoother. Next, I'll focus on the Chores-related pages.
2025-06-01 14:26:37 +02:00
google-labs-jules[bot]
272e5abe41 refactor: Integrate Valerie UI components into Group and List pages
This commit refactors parts of `GroupsPage.vue`, `ListsPage.vue`, and the shared `CreateListModal.vue` to use the newly created Valerie UI components.

Key changes include:

1.  **Modals:**
    *   The "Create Group Dialog" in `GroupsPage.vue` now uses `VModal`, `VFormField`, `VInput`, `VButton`, and `VSpinner`.
    *   The `CreateListModal.vue` component (used by both pages) has been internally refactored to use `VModal`, `VFormField`, `VInput`, `VTextarea`, `VSelect`, `VButton`, and `VSpinner`.

2.  **Forms:**
    *   The "Join Group" form in `GroupsPage.vue` now uses `VFormField`, `VInput`, `VButton`, and `VSpinner`.

3.  **Alerts:**
    *   Error alerts in both `GroupsPage.vue` and `ListsPage.vue` now use the `VAlert` component, with retry buttons placed in the `actions` slot.

4.  **Empty States:**
    *   The empty state displays (e.g., "No Groups Yet", "No lists found") in both pages now use the `VCard` component with `variant="empty-state"`, mapping content to the relevant props and slots.

5.  **Buttons:**
    *   Various standalone buttons (e.g., "Create New Group", "Create New List", "List" button on group cards) have been updated to use the `VButton` component with appropriate props for variants, sizes, and icons.

**Scope of this Refactor:**
*   The focus was on replacing direct usages of custom-styled modal dialogs, form elements, alerts, and buttons with their Valerie UI component counterparts.
*   Highly custom card-like structures such as `neo-group-card` (in `GroupsPage.vue`) and `neo-list-card` (in `ListsPage.vue`), along with their specific "create" card variants, have been kept with their existing custom styling for this phase. This is due to their unique layouts and styling not directly mapping to the current generic `VCard` component without significant effort or potential introduction of overly specific props to `VCard`. Only buttons within these custom cards were refactored.
*   The internal item rendering within `neo-list-card` (custom checkboxes, add item input) also remains custom for now.

This refactoring improves consistency by leveraging the standardized Valerie UI components for common UI patterns like modals, forms, alerts, and buttons on these pages.
2025-06-01 14:26:37 +02:00
google-labs-jules[bot]
fc16f169b1 Jules was unable to complete the task in time. Please review the work done so far and provide feedback for Jules to continue. 2025-06-01 14:26:37 +02:00
google-labs-jules[bot]
3811dc7ee5 Refactor: Polish backend based on review
I reviewed the backend codebase covering schema, API endpoints, error handling, and tests.

Key changes I implemented:
- Updated `app/models.py`:
    - Added `parent_expense_id` and `last_occurrence` fields to the `Expense` model to align with the `add_recurring_expenses.py` migration.
    - Added `parent_expense` and `child_expenses` self-referential relationships to the `Expense` model.
- Updated `app/core/exceptions.py`:
    - Removed the unused and improperly defined `BalanceCalculationError` class.

I identified areas for future work:
- Create a new Alembic migration if necessary to ensure `parent_expense_id` and `last_occurrence` columns are correctly reflected in the database, or verify the existing `add_recurring_expenses.py` migration's status.
- Significantly improve API test coverage, particularly for:
    - Chores module (personal and group)
    - Groups, Invites, Lists, Items, OCR endpoints
    - Full CRUD operations for Expenses and Settlements
    - Recurring expense functionalities.
2025-06-01 14:26:36 +02:00
mohamad
136c4df7ac feat: Integrate Storybook for component development 2025-06-01 14:26:36 +02:00
mohamad
821a26e681 feat: Add Recurrence Pattern and Update Expense Schema
- Introduced a new `RecurrencePattern` model to manage recurrence details for expenses, allowing for daily, weekly, monthly, and yearly patterns.
- Updated the `Expense` model to include fields for recurrence management, such as `is_recurring`, `recurrence_pattern_id`, and `next_occurrence`.
- Modified the database schema to reflect these changes, including alterations to existing columns and the removal of obsolete fields.
- Enhanced the expense creation logic to accommodate recurring expenses and updated related CRUD operations accordingly.
- Implemented necessary migrations to ensure database integrity and support for the new features.
2025-06-01 14:23:05 +02:00
mohamad
ee6d96d9ec feat: Revamp ChoresPage with enhanced UI and functionality
- Redesigned the ChoresPage layout to improve user experience, introducing a new header with tabs for viewing overdue, today, upcoming, all pending, and completed chores.
- Implemented a calendar view for better visualization of chores, allowing users to navigate between months and add chores directly on specific dates.
- Added a loading state to enhance feedback during data fetching.
- Introduced a shortcuts modal to display keyboard shortcuts for improved accessibility.
- Enhanced chore card interactions with improved styling and responsiveness, including a transition effect for list items.
- Updated chore management functionalities, including create, edit, and delete operations, with better validation and auto-save features.
2025-06-01 13:19:28 +02:00
mohamad
8c52bbb307 feat: Integrate Storybook for component development 2025-05-31 14:43:59 +02:00
mohamad
ce67570cfb feat: Update deployment workflow and enhance ListDetailPage functionality
- Modified the production deployment workflow to trigger on pushes to the 'prod' branch and updated Docker registry login to use Gitea Container Registry.
- Enhanced ListDetailPage.vue to improve loading states and error handling, introducing a new loading mechanism for items and utilizing session storage for cached data.
- Implemented Intersection Observer for pre-fetching list details to optimize user experience during navigation.
- Improved touch feedback for list cards and optimized styles for mobile responsiveness.
2025-05-31 14:08:40 +02:00
mohamad
cb51186830 feat: Add production deployment configuration and environment setup
- Introduced `docker-compose.prod.yml` to define services for production deployment, including PostgreSQL, FastAPI backend, frontend, and Redis.
- Created `env.production.template` to outline necessary environment variables for production, ensuring sensitive data is not committed.
- Added `PRODUCTION.md` as a deployment guide detailing the setup process using Docker Compose and Gitea Actions for CI/CD.
- Implemented Gitea workflows for build, test, and deployment processes to streamline production updates.
- Updated backend and frontend Dockerfiles for optimized production builds and configurations.
- Enhanced application settings to support environment-specific configurations, including CORS and health checks.
2025-05-28 08:23:22 +02:00
mohamad
84b046508a feat: Implement refresh token functionality in authentication flow
- Added support for refresh tokens in the authentication backend, allowing users to obtain new access tokens using valid refresh tokens.
- Created a new `BearerResponseWithRefresh` model to structure responses containing both access and refresh tokens.
- Updated the `AuthenticationBackend` to handle login and logout processes with refresh token support.
- Introduced a new `/auth/jwt/refresh` endpoint to facilitate token refreshing, validating the refresh token and generating new tokens as needed.
- Modified OAuth callback logic to generate and return both access and refresh tokens upon successful authentication.
- Updated frontend API service to send the refresh token in the Authorization header for token refresh requests.
2025-05-25 12:51:02 +02:00
mohamad
a0d67f6c66 feat: Add comprehensive notes and tasks for project stabilization and enhancements
- Introduced a new `notes.md` file to document critical tasks and progress for stabilizing the core functionality of the MitList application.
- Documented the status and findings for key tasks, including backend financial logic fixes, frontend expense split settlement implementation, and core authentication flow reviews.
- Outlined remaining work for production deployment, including secret management, CI/CD pipeline setup, and performance optimizations.
- Updated the logging configuration to change the log level to WARNING for production readiness.
- Enhanced the database connection settings to disable SQL query logging in production.
- Added a new endpoint to list all chores for improved user experience and optimized database queries.
- Implemented various CRUD operations for chore assignments, including creation, retrieval, updating, and deletion.
- Updated frontend components and services to support new chore assignment features and improved error handling.
- Enhanced the expense management system with new fields and improved API interactions for better user experience.
2025-05-24 21:36:57 +02:00
mohamad
81577ac7e8 feat: Add Recurrence Pattern and Update Expense Schema
- Introduced a new `RecurrencePattern` model to manage recurrence details for expenses, allowing for daily, weekly, monthly, and yearly patterns.
- Updated the `Expense` model to include fields for recurrence management, such as `is_recurring`, `recurrence_pattern_id`, and `next_occurrence`.
- Modified the database schema to reflect these changes, including alterations to existing columns and the removal of obsolete fields.
- Enhanced the expense creation logic to accommodate recurring expenses and updated related CRUD operations accordingly.
- Implemented necessary migrations to ensure database integrity and support for the new features.
2025-05-23 21:01:49 +02:00
google-labs-jules[bot]
b0100a2e96 Fix: Ensure financial accuracy in cost splitting and balances
I've refactored the group balance summary logic to correctly account for
SettlementActivity. A SettlementActivity now reduces your
effective total_share_of_expenses, ensuring that net balances within
a group sum to zero. Previously, SettlementActivity amounts were
incorrectly added to total_settlements_paid, skewing balance
calculations.

I updated the existing `test_group_balance_summary_with_settlement_activity`
to assert the corrected balance outcomes.

I also added an extensive suite of API-level tests for:
- All expense splitting types (EQUAL, EXACT_AMOUNTS, PERCENTAGE, SHARES, ITEM_BASED),
  covering various scenarios and input validations.
- Group balance summary calculations, including multiple scenarios with
  SettlementActivity, partial payments, multiple expenses, and
  interactions with generic settlements. All balance tests verify that
  the sum of net balances is zero.

The CRUD operations for expenses and settlement activities were reviewed
and found to be sound, requiring no changes for this fix.

This resolves the flawed logic identified in
`be/tests/api/v1/test_costs.py` (test_group_balance_summary_with_settlement_activity)
and ensures that backend financial calculations are provably correct.
2025-05-22 17:04:46 +00:00