302 Commits

Author SHA1 Message Date
Felipe Cardoso
095aa1e7da Add local storage provider implementation
Introduce an abstract `StorageProvider` class and a
2025-03-12 18:35:51 +01:00
Felipe Cardoso
07f8435fcd Add utility functions for creating and verifying upload tokens
Introduced `create_upload_token` and `verify_upload_token` functions to handle secure file uploads. These utilities generate signed tokens with expiration and content validation, ensuring upload security. Verification includes signature integrity and expiration checks.
2025-03-12 18:35:47 +01:00
Felipe Cardoso
e27e2b75ee Update config structure and enhance file handling
Renamed API_V1_STR to API_VERSION_STR for consistency. Introduced 'UPLOAD_FOLDER' and ensured its creation, added logging for the data directory path, and implemented allowed image content type validation. Adjusted related references in `main.py`.
2025-03-12 18:35:42 +01:00
Felipe Cardoso
5ad886a53e Add support for serving static files from DATA_FILES_DIR
All checks were successful
Build and Push Docker Images / changes (push) Successful in 4s
Build and Push Docker Images / build-backend (push) Successful in 53s
Build and Push Docker Images / build-frontend (push) Has been skipped
Introduce a new environment variable, `DATA_FILES_DIR`, for configuring static file storage. Updated `docker-compose` files to mount the host directory and propagate the variable. Implemented FastAPI `StaticFiles` to serve files from this directory under the `/files` route.
2025-03-12 18:23:42 +01:00
Felipe Cardoso
63dadb9429 Add Event Themes management page to dashboard
Some checks failed
Build and Push Docker Images / changes (push) Successful in 5s
Build and Push Docker Images / build-backend (push) Has been skipped
Build and Push Docker Images / build-frontend (push) Failing after 50s
Introduced a new "Event Themes" page to allow users to manage visual themes for events. Updated the dashboard to include a button for navigating to the new page. The themes page supports listing, viewing, and creating themes, enhancing customization options for users.
2025-03-12 16:39:58 +01:00
Felipe Cardoso
9c7bc1f2cf Add new properties to event theme schemas and types
Some checks failed
Build and Push Docker Images / changes (push) Successful in 4s
Build and Push Docker Images / build-backend (push) Has been skipped
Build and Push Docker Images / build-frontend (push) Failing after 48s
Introduce `background_image_url`, `foreground_image_url`, `asset_image_urls`, and `is_active` properties to the `EventTheme` schemas and types. These additions enhance flexibility and allow better customization of event themes. Default value for `is_active` ensures consistent behavior.
2025-03-12 16:23:00 +01:00
Felipe Cardoso
288e09202d Add background and foreground image URLs to event themes
All checks were successful
Build and Push Docker Images / changes (push) Successful in 4s
Build and Push Docker Images / build-backend (push) Successful in 50s
Build and Push Docker Images / build-frontend (push) Has been skipped
Extended the event theme schema to include `background_image_url`
2025-03-12 16:20:12 +01:00
Felipe Cardoso
efb1dfd2a4 Add new fields to event theme model for asset handling
All checks were successful
Build and Push Docker Images / changes (push) Successful in 4s
Build and Push Docker Images / build-backend (push) Successful in 50s
Build and Push Docker Images / build-frontend (push) Has been skipped
Added `background_image_url`, `foreground_image_url`, and `asset_image_urls` fields to enhance theme customization. Updated `asset_image_urls` to use `MutableDict` with a default empty dictionary and ensured consistency in the model and migration script.
2025-03-12 16:14:07 +01:00
Felipe Cardoso
b94d88bcf6 Refactor provider composition with DataProviders wrapper
Some checks failed
Build and Push Docker Images / changes (push) Successful in 5s
Build and Push Docker Images / build-backend (push) Has been skipped
Build and Push Docker Images / build-frontend (push) Failing after 49s
Encapsulated `EventsProvider` and `EventThemesProvider` into a new `DataProviders` component to simplify and modularize provider structure. Updated the root provider hierarchy to use `DataProviders`, improving maintainability and readability.
2025-03-12 15:59:01 +01:00
Felipe Cardoso
99ec4ebfa1 Add EventThemesContext for managing event theme state
Introduced a new React context, EventThemesContext, to handle event theme state and CRUD operations. It includes support for creating, updating, deleting, and fetching themes with React Query integration. This provides a centralized solution for managing event theme-related data in the application.
2025-03-12 15:55:28 +01:00
Felipe Cardoso
e2265573eb Add support for deleting event themes
This commit introduces functionality to delete event themes via the API. It includes type definitions, SDK methods, and a React Query mutation for `deleteEventTheme`. Users can perform both soft and hard deletes with this implementation.
2025-03-12 15:22:03 +01:00
Felipe Cardoso
1abc4a743a Fix cleanup in Makefile by removing volumes with docker compose
Updated the `clean` target to use `docker compose down -v`, ensuring that volumes are also removed during cleanup. This prevents leftover volumes from persisting and occupying unnecessary space.
2025-03-12 15:21:54 +01:00
Felipe Cardoso
4b01d6f58f Add delete functionality for event themes
All checks were successful
Build and Push Docker Images / changes (push) Successful in 4s
Build and Push Docker Images / build-backend (push) Successful in 50s
Build and Push Docker Images / build-frontend (push) Has been skipped
Introduce a new endpoint to delete event themes, supporting both soft and hard deletes. Hard deletes are restricted to superusers, while soft deletes deactivate the theme. Also, improve error handling and user permission checks for this operation.
2025-03-12 15:21:47 +01:00
Felipe Cardoso
525d1b8012 Add is_active field to EventTheme model and test fixture.
The `is_active` field was introduced to the `EventTheme` model to indicate whether a theme is active. The corresponding test fixture in `conftest.py` was updated to include this new field, ensuring consistency in tests. This change enhances flexibility for managing event themes.
2025-03-12 15:21:28 +01:00
Felipe Cardoso
a0d472f583 Remove Events link from the navbar.
The Events link in the navbar has been commented out, effectively hiding it from the UI. This change may be temporary or subject to further decision, but it cleans up the navigation display for now.
2025-03-12 15:02:50 +01:00
Felipe Cardoso
3356c93374 Add Popover component using Radix UI primitives
Some checks failed
Build and Push Docker Images / changes (push) Successful in 4s
Build and Push Docker Images / build-backend (push) Has been skipped
Build and Push Docker Images / build-frontend (push) Failing after 48s
Introduce a reusable Popover component with Trigger, Content, and Anchor subcomponents, leveraging Radix UI primitives for accessibility and animations. Includes utility classes for styling and positioning, ensuring consistency and ease of use in the UI.
2025-03-12 14:47:03 +01:00
Felipe Cardoso
b7598350ba Enhance event details UI and add date/time format utilities
Some checks failed
Build and Push Docker Images / changes (push) Successful in 5s
Build and Push Docker Images / build-backend (push) Has been skipped
Build and Push Docker Images / build-frontend (push) Failing after 40s
Refactor event details page with a modernized design using cards, badges, and icons, improving user experience and accessibility. Introduce robust utilities in `/lib/utils.ts` for formatting dates and
2025-03-12 12:44:52 +01:00
Felipe Cardoso
768d1820e5 Add user menu with logout in navbar
Replaced the text-based logout button with a user menu using a popover. The menu includes the user's name and a logout option with an icon for better UX. This improves the design and accessibility of the authenticated navbar.
2025-03-12 10:14:08 +01:00
Felipe Cardoso
d5a24234d0 Refactor container layout and remove redundant wrappers
Reorganized container layouts across dashboard and event pages to remove redundant `div` wrappers and ensure consistent structure. This improves maintainability and simplifies the codebase while retaining visual behavior.
2025-03-12 10:14:04 +01:00
Felipe Cardoso
3ddb289c76 Add @radix 2025-03-12 10:13:53 +01:00
Felipe Cardoso
ad0f9f1078 Refactor: Move Navbar to MainLayout for consistency
Some checks failed
Build and Push Docker Images / changes (push) Successful in 4s
Build and Push Docker Images / build-backend (push) Has been skipped
Build and Push Docker Images / build-frontend (push) Failing after 47s
Relocated the Navbar component to the MainLayout to streamline its rendering across dashboard pages. This eliminates redundant Navbar instances in individual pages, improving maintainability and reducing duplication.
2025-03-12 09:56:03 +01:00
Felipe Cardoso
77c5b5df9a Refactor navbar for improved UI and code consistency.
Some checks failed
Build and Push Docker Images / build-frontend (push) Failing after 46s
Build and Push Docker Images / changes (push) Successful in 3s
Build and Push Docker Images / build-backend (push) Has been skipped
Simplified the navbar layout and styling for better readability and maintainability. Replaced custom button styling with reusable Button component for consistency across the app. Enhanced hover and active state styles with dynamic class handling.
2025-03-12 09:52:27 +01:00
Felipe Cardoso
4cdf8b7576 Add reusable UI components: Textarea, Input, Label, and Switch
Some checks failed
Build and Push Docker Images / changes (push) Successful in 3s
Build and Push Docker Images / build-backend (push) Has been skipped
Build and Push Docker Images / build-frontend (push) Failing after 47s
Introduce four reusable components (Textarea, Input, Label, Switch) with consistent styling and accessibility support. These components streamline UI development and follow best practices for design and interactivity.
2025-03-12 09:49:06 +01:00
Felipe Cardoso
193e9fa4d2 Refactor event creation form with improved UI and validation
Some checks failed
Build and Push Docker Images / changes (push) Successful in 5s
Build and Push Docker Images / build-backend (push) Has been skipped
Build and Push Docker Images / build-frontend (push) Has been cancelled
Replaced basic HTML form with styled components for better UI consistency. Added fields for start/end time and location URL, along with live slug validation to prevent reserved slugs. Enhanced layout and structure for improved usability and responsiveness.
2025-03-12 09:48:50 +01:00
Felipe Cardoso
e896575f62 Add @radix-ui/react-label and @radix-ui/react-switch deps
Included new Radix UI components, `react-label` and `react-switch`, in `package.json` for enhanced UI elements support. Added related dependencies in `package-lock.json` to ensure compatibility and proper functionality within the project.
2025-03-12 09:48:44 +01:00
Felipe Cardoso
5ecc8441ae Add RESERVED_SLUGS constant and consolidate exports
Introduce a RESERVED_SLUGS constant to standardize restricted slugs across the application. Created a `constants/index.ts` file to centralize and streamline exports for better maintainability.
2025-03-12 09:36:44 +01:00
Felipe Cardoso
71c114798b Add "Add New Event" button to dashboard
This update introduces a button to the "Your Events" section of the dashboard, allowing users to quickly navigate to the event creation page. The enhancement improves user flow and accessibility for managing events.
2025-03-12 09:35:51 +01:00
Felipe Cardoso
e5eccf1361 Add Badge component and update axios to 1.8.3
Some checks failed
Build and Push Docker Images / changes (push) Successful in 4s
Build and Push Docker Images / build-backend (push) Has been skipped
Build and Push Docker Images / build-frontend (push) Failing after 47s
Introduce a reusable Badge component with variant support for consistent UI styling. Additionally, upgrade axios from version 1.8.1 to 1.8.3 to include the latest fixes and improvements.
2025-03-12 09:30:26 +01:00
Felipe Cardoso
446fae44b0 Add Badge component and update axios to 1.8.3
Introduce a reusable Badge component with variant support for consistent UI styling. Additionally, upgrade axios from version 1.8.1 to 1.8.3 to include the latest fixes and improvements.
2025-03-12 09:30:21 +01:00
Felipe Cardoso
11fa5f6c78 Add event detail page with dynamic slug support
This commit introduces a new dynamic event detail page under the dashboard. It fetches event data based on the slug using context and handles loading, error, and empty states gracefully. Includes integration with the Navbar component for consistent UI.
2025-03-12 09:22:13 +01:00
Felipe Cardoso
9a59c88143 Add event creation page and link from dashboard
Introduced a new page for creating events with a form to input event details and added a link from the dashboard to this page. The form includes fields for title, description, date, location, and public/private options, enhancing user functionality. Users are redirected to the event page upon successful creation.
2025-03-12 09:22:06 +01:00
Felipe Cardoso
e57c63e60b Add framer-motion to project dependencies
Integrated framer-motion package (v12.4.11) to enhance animation capabilities. Updated `package.json` and `package-lock.json` to include the package and its dependencies. This addition provides advanced motion animations for React components.
2025-03-12 09:21:55 +01:00
Felipe Cardoso
d8980e18ce Add support for fetching events by slug in context
Introduced `fetchEventBySlug` method and `event` state to the events context, enabling retrieval of event data via slugs. Updated context state to handle related loading and error states (`isLoadingEvent` and `eventError`), and integrated query logic for slug-based event fetching.
2025-03-12 09:21:45 +01:00
Felipe Cardoso
082c1dc585 Remove unused DashboardPage component from the codebase.
This component was no longer in use and has been deleted to clean up the codebase. Its removal helps maintain clarity and reduces unnecessary clutter in the frontend directory.
2025-03-11 06:57:55 +01:00
Felipe Cardoso
158a8b441a Add invitation and dashboard pages with UI components
Introduced a dynamic invitation page to display event details based on a slug, including RSVP functionality (placeholder). Added a dashboard page for authenticated users, providing a welcome message and placeholder for event management. Also implemented reusable Card UI components for consistent styling.
2025-03-11 06:57:34 +01:00
Felipe Cardoso
f245145087 Refactor event retrieval and improve test coverage
All checks were successful
Build and Push Docker Images / changes (push) Successful in 4s
Build and Push Docker Images / build-backend (push) Successful in 51s
Build and Push Docker Images / build-frontend (push) Has been skipped
Removed redundant code for event retrieval and standardized logic by introducing a unified method for generating event endpoints. Updated tests to align with these changes, adding support for slug-based access and handling finer permission cases. Minor issues with test formatting and comments were also addressed.
2025-03-11 06:47:58 +01:00
Felipe Cardoso
80ff350053 Add EventsContext for managing events state and operations
Introduce an EventsContext and EventsProvider to centralize event-related logic, including queries, mutations, and pagination. Wrap the application with the EventsProvider in the providers index to make the context accessible throughout the app.
2025-03-11 06:19:06 +01:00
Felipe Cardoso
114f0e7807 Add schemas and types for events and event themes
This commit introduces detailed schemas and types for events and event themes, including creation, update, and response objects. It also adds support for paginated event responses and newly defined API endpoints such as creating, updating, and fetching event themes and events. These additions enhance the schema structure and improve type safety for event-related operations.
2025-03-11 06:18:56 +01:00
Felipe Cardoso
79733d5bec Add new Makefile targets for logs and restart tasks
Extended the Makefile with new .PHONY targets: logs, logs-dev, restart, and restart-dev. These additions streamline viewing logs and restarting services for both production and development environments. Enhanced workflow efficiency by consolidating repetitive commands.
2025-03-11 06:12:21 +01:00
Felipe Cardoso
e1145525ff Refactor event access validation and enhance endpoint logic
All checks were successful
Build and Push Docker Images / changes (push) Successful in 5s
Build and Push Docker Images / build-backend (push) Successful in 55s
Build and Push Docker Images / build-frontend (push) Has been skipped
Centralized event access validation into a reusable `validate_event_access` function, eliminating duplicated code across endpoints. Updated the logic in `get_event` and `get_event_by_slug` to use this function. Adjusted tests to align with the refactored logic and fixed permission-based response statuses.
2025-03-10 09:18:46 +01:00
Felipe Cardoso
c5915e57b1 Restrict event access and add extensive event tests
All checks were successful
Build and Push Docker Images / changes (push) Successful in 4s
Build and Push Docker Images / build-backend (push) Successful in 51s
Build and Push Docker Images / build-frontend (push) Has been skipped
Updated event API to enforce stricter access controls based on user roles, including creators, managers, superusers, and guests. Added robust test cases for creating, fetching, and handling event access scenarios to ensure consistent behavior across endpoints.
2025-03-09 17:37:48 +01:00
Felipe Cardoso
4192911538 Add authentication check to event-related API routes
All checks were successful
Build and Push Docker Images / changes (push) Successful in 4s
Build and Push Docker Images / build-backend (push) Successful in 52s
Build and Push Docker Images / build-frontend (push) Has been skipped
Ensure that all event-related endpoints verify the presence of a valid authenticated user before proceeding. Raise a 401 Unauthorized error if authentication credentials are missing or invalid, enhancing the security of API routes.
2025-03-09 16:25:48 +01:00
Felipe Cardoso
c2cdc3c110 Refactor event API and extend authentication utilities
All checks were successful
Build and Push Docker Images / changes (push) Successful in 6s
Build and Push Docker Images / build-backend (push) Successful in 55s
Build and Push Docker Images / build-frontend (push) Has been skipped
Refactored the event API routes to improve error handling, add logging, and provide enhanced response structures with pagination. Updated tests to use new fixtures and include additional authentication utilities to facilitate testing with FastAPI's dependency injection. Also resolved issues with timezone awareness in event schemas.
2025-03-09 16:04:51 +01:00
Felipe Cardoso
fe2bcbd6e7 Add event counting methods and generic pagination schema
Introduce methods to count user, public, and upcoming events to enhance CRUD functionality for events. Additionally, add a `PaginatedResponse` schema to simplify and standardize paginated API responses. These updates support improved data querying and response handling.
2025-03-09 10:56:22 +01:00
Felipe Cardoso
5c73f2720e Add event routes and enhance routing structure
Introduced routes for event management, including CRUD operations and querying by user or public visibility. Updated event themes routes with operation IDs for better documentation. Refactored `api/main.py` to `api/router.py` and integrated events routing into the API.
2025-03-05 18:57:24 +01:00
Felipe Cardoso
4a9a37f507 Add CRUD operations and tests for Event model
All checks were successful
Build and Push Docker Images / changes (push) Successful in 4s
Build and Push Docker Images / build-backend (push) Successful in 50s
Build and Push Docker Images / build-frontend (push) Has been skipped
This commit introduces a new CRUDEvent class to manage event-related database operations, including retrieval, creation, updating, and deletion of events. It includes corresponding unit tests to ensure the correctness of these functionalities, updates event schemas for enhanced validation, and refines timezone handling for event dates and deadlines.
2025-03-05 14:58:15 +01:00
Felipe Cardoso
a517df1eab ```
Switch to timezone.utc for event date validation

Replaced ZoneInfo('UTC') with timezone.utc in event date validation to ensure consistency and compatibility with standard libraries. Simplifies datetime handling and avoids potential issues with external dependencies.
```
2025-03-05 14:50:24 +01:00
Felipe Cardoso
0b6f47a602 Add event schema models and corresponding test cases
All checks were successful
Build and Push Docker Images / changes (push) Successful in 4s
Build and Push Docker Images / build-backend (push) Successful in 50s
Build and Push Docker Images / build-frontend (push) Has been skipped
Introduce Pydantic models for event creation, updates, and responses, including validation for fields such as timezone, event date, and RSVP deadline. Add comprehensive pytest test cases to ensure correct behavior and data validation. This provides a robust foundation for event-related functionalities.
2025-03-05 12:48:25 +01:00
Felipe Cardoso
cbcd04d8e1 Rename schema and test files for consistency
Renamed `event_theme` and `test_user_schema` file paths and imports to follow consistent plural naming conventions. This improves code clarity and aligns file and import naming across the project.
2025-03-05 12:48:18 +01:00
Felipe Cardoso
b384512b9c Add tests for event theme API functionality
All checks were successful
Build and Push Docker Images / changes (push) Successful in 5s
Build and Push Docker Images / build-backend (push) Successful in 52s
Build and Push Docker Images / build-frontend (push) Has been skipped
Introduces comprehensive tests for creating, listing, updating, and retrieving event themes. Includes scenarios with valid data, invalid data, and pagination to ensure robust API behavior. Adds necessary fixtures to support the new test cases.
2025-03-05 12:42:06 +01:00