Commit Graph

130 Commits

Author SHA1 Message Date
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
Felipe Cardoso
b3a4c45202 Add event themes API routes for CRUD operations
Implemented API endpoints for creating, reading, updating, and listing event themes. Integrated the new routes into the FastAPI application router under the '/event_themes' prefix.
2025-03-05 12:42:00 +01:00
Felipe Cardoso
6884cbbf64 Rename test file to correct singular form for consistency
Updated the filename from `test_user_schemas.py` to `test_user_schema.py` to align with naming conventions. This ensures consistency across the test suite and improves maintainability.
2025-03-05 12:41:51 +01:00
Felipe Cardoso
d65d1f3164 Add tests and validation for EventTheme schema
Introduced extensive test cases to validate `EventTheme` schemas, ensuring proper handling of valid and invalid inputs, optional fields, and partial updates. Enhanced schema validation by adding constraints for `name`, `color_palette`, and `fonts` fields, as well as updating `id` to use `UUID` type for consistency. These changes improve data integrity and increase confidence in schema-related functionality.
2025-03-05 12:41:31 +01:00
Felipe Cardoso
c5478e45b6 Refactor AuthService for better error handling and CRUD usage
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
Replaced raw database queries with CRUD operations for consistency and modularity. Enhanced error handling by adding detailed exception messages and logging for failed actions, such as authentication and registration. Updated tests to reflect new exception-based error handling approach.
2025-03-05 12:00:23 +01:00
Felipe Cardoso
658ef1c7c2 Add CRUD operations and tests for EventTheme management
All checks were successful
Build and Push Docker Images / changes (push) Successful in 5s
Build and Push Docker Images / build-backend (push) Successful in 51s
Build and Push Docker Images / build-frontend (push) Has been skipped
Introduced CRUD implementation, schema definitions, and tests for EventTheme. This allows creation, retrieval, updating, deletion, and querying of active event themes. Comprehensive tests ensure functionality works as intended, including edge cases for nonexistent themes.
2025-03-05 11:43:14 +01:00
Felipe Cardoso
d0bcb77438 Add theme toggle and button components to UI
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 45s
Integrated a ThemeToggle component into the Navbar for dark/light mode switching and created a reusable Button component with configurable styles. Updated `.gitignore` to exclude the `lib` folder for cleanup.
2025-03-05 11:27:32 +01:00
Felipe Cardoso
0df4c8c1f6 Add TailwindCSS utilities and update UI dependencies
Introduce TailwindCSS utilities, animations, and theme configurations to enhance UI styling. Update dependencies to include Radix, clsx, lucide-react, and other utilities for improved design flexibility and component styling. Refactor global CSS, PostCSS config, and utils for streamlined development.
2025-03-05 11:27:26 +01:00
Felipe Cardoso
29e0ba2a70 Add invite page with invitation code validation
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 43s
This commit introduces a new invite page where users can input and validate their invitation codes. The page redirects valid users to the related event, and displays appropriate errors for invalid or failed submissions. It includes a responsive UI with loading states and error handling.
2025-03-05 11:04:47 +01:00
Felipe Cardoso
c1cfc05a9e Add dynamic homepage with authentication and feature sections
Replaced static placeholder homepage with a dynamic one that includes authentication checks. Redirects authenticated users to the dashboard and shows a redesigned landing page with hero, features, and footer sections for unauthenticated users. Enhances user experience and aligns with product goals.
2025-03-05 11:04:43 +01:00
Felipe Cardoso
c3da4bbaef Add a navbar component and refactor dashboard logic
Introduce a reusable Navbar component to streamline navigation and hide it on public pages. Simplify dashboard logic by removing redundant authentication checks and improve layout structure. Enhances user experience with a cleaner and more maintainable codebase.
2025-03-05 11:04:39 +01:00
Felipe Cardoso
1b453e80c9 Refactor authentication flows and improve logout handling
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 44s
Split authentication logic into a reusable `MainLayout` component for better structure and consistency. Enhanced logout functionality to ensure proper state resetting and added minor delays for reliable redirect behavior. Improved safeguards for unauthenticated access, reducing potential edge case errors.
2025-03-05 10:56:20 +01:00
Felipe Cardoso
585ae65758 Add dashboard and login pages with authentication logic
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 44s
Introduced the dashboard page that verifies user authentication and redirects unauthenticated users to the login page. Added a login page enabling users to sign in, with error handling and redirects upon successful authentication. Both pages are styled and handle loading states appropriately.
2025-03-05 10:39:07 +01:00
Felipe Cardoso
9e7bc35a2f Remove unused frontend_dev_modules volume from dev config
The `frontend_dev_modules` volume was redundant and is no longer being used in the development workflow. This change simplifies the `docker-compose.dev.yml` file by eliminating unnecessary configuration.
2025-03-05 10:31:46 +01:00
Felipe Cardoso
eba94f981c Update font to Inter and add Providers to RootLayout
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 43s
Replaced Geist fonts with Inter for better design consistency. Integrated a Providers component into RootLayout to manage app-wide context. Updated metadata to reflect the branding of "EventSpace - Family Celebrations".
2025-03-05 10:30:38 +01:00
Felipe Cardoso
eaa2561a46 Update node_modules mount path in docker-compose.dev.yml
Replaces the named volume `frontend_dev_modules` with a direct path `/app/node_modules`. This change simplifies development setup and ensures consistency across environments.
2025-03-05 10:30:16 +01:00
Felipe Cardoso
4525dd21be Add global providers for react-query, theming, and auth
Introduce a new Providers component to manage global contexts including react-query, theme switching, and authentication. Added necessary dependencies: `@tanstack/react-query-devtools` and `next-themes`, and configured default options for react-query.
2025-03-05 10:17:29 +01:00
Felipe Cardoso
c61ad52331 Refactor auto-generated schemas and types formatting
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 42s
Updated the formatting for auto-generated schemas, types, and related files to adhere to consistent coding standards (e.g., double quotes, indentation). No functional changes were made, ensuring behavior remains identical.
2025-03-05 10:13:33 +01:00
Felipe Cardoso
ffa3f2ffd3 Add auto-generated API client and schema files
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 42s
Integrated auto-generated TypeScript client and schemas using @hey-api/openapi-ts for API communication. Includes type definitions, API endpoint handlers, and React Query integration for enhanced type safety and developer experience.
2025-03-05 10:09:48 +01:00
Felipe Cardoso
a7504f6876 Add authentication context and provider for user management
Introduce `AuthContext` with login, logout, and token management. Includes protected route handling, token refresh logic, and user session persistence via React Context API. Prepares the app for authentication workflows.
2025-03-05 10:09:19 +01:00
Felipe Cardoso
761254f940 Add OpenAPI TypeScript config and update dependencies
Introduced `openapi-ts.config.ts` to generate client code from the OpenAPI spec. Updated several dependencies to enable OpenAPI integration, including `@hey-api` plugins, `axios`, and `@tanstack/react-query`. These changes set up the project for streamlined API access using autogenerated TypeScript clients.
2025-03-05 10:09:14 +01:00
Felipe Cardoso
b019511a1f Add operation_id to all API route handlers
This commit adds the `operation_id` parameter to all relevant API endpoints in the `auth` routes. These identifiers enhance API documentation and make routes easier to distinguish in tools like Swagger or OpenAPI. No functionality is altered, but these additions improve clarity and maintainability.
2025-03-05 09:16:27 +01:00
Felipe Cardoso
4f06c95eda Refactor tests to remove redundant user validation 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 51s
Build and Push Docker Images / build-frontend (push) Has been skipped
Removed tests for missing `first_name` and `last_name` in `test_user` as database integrity constraints already ensure these validations. This reduces duplication and simplifies the test suite.
2025-03-04 19:11:13 +01:00