113 Commits

Author SHA1 Message Date
d9ff535ac0 Improve project structure.
New Project Structure:
  - Created reusable UI components (ServiceCard, AnimatedSection, SectionTitle)
  - Split large components into smaller, focused ones
  - Extracted shared hooks for common functionality
  - Organized constants into separate files

Key Improvements:
  - Hooks: useScrollNavigation, useScrollToSection, useCookieSettings
  - UI Components: Modular components for consistent styling and behavior
  - Constants: Centralized data management (ServicesData, NavigationData)
  - Component Split: Navbar, Hero, and Footer broken into logical sub-components
2025-08-08 19:38:12 +02:00
a5d59cbd64 Update run config 2025-07-23 08:21:53 +02:00
0759f23b22 Backend Refactoring
1. Enhanced User Session Management & Logging

  CurrentSessionProvider (backend/server/src/main/java/dev/rheinsw/server/security/session/CurrentSessionProvider.java):
  - Added comprehensive null safety checks for JWT authentication
  - Implemented detailed logging for user session retrieval
  - Added validation for all required JWT claims (sub, preferred_username, email)
  - Enhanced error messages with specific validation failures

  UserSessionFilter (backend/server/src/main/java/dev/rheinsw/server/security/session/UserSessionFilter.java):
  - Replaced silent exception handling with proper logging
  - Added request context logging (method, URI)
  - Categorized different exception types for better debugging
  - Enhanced error visibility while maintaining non-blocking behavior

  UserService (backend/server/src/main/java/dev/rheinsw/server/security/user/UserService.java):
  - Added comprehensive null safety validations
  - Implemented detailed logging for user creation and lookup operations
  - Enhanced exception handling with proper error context
  - Added input validation for session data

  2. Improved Controller Logging & Validation

  CustomerController (backend/server/src/main/java/dev/rheinsw/server/internal/customer/controller/CustomerController.java):
  - Added comprehensive logging for all user actions
  - Implemented input validation with @Valid annotations
  - Enhanced error handling with user context
  - Added null checks for path parameters

  ProjectController (backend/server/src/main/java/dev/rheinsw/server/internal/project/controller/ProjectController.java):
  - Similar logging and validation improvements
  - Added comprehensive user action tracking
  - Enhanced error handling with proper validation

  3. Enhanced DTO Validation

  CreateCustomerDto (backend/server/src/main/java/dev/rheinsw/server/internal/customer/dtos/CreateCustomerDto.java):
  - Added Bean Validation annotations (@NotBlank, @Email, @Size)
  - Implemented comprehensive field validation
  - Added proper error messages in German

  CustomerValidationRequest & CreateCustomerProjectDto: Similar validation enhancements

  4. Improved Exception Handling

  GlobalExceptionHandler (backend/common/src/main/java/dev/rheinsw/common/controller/exception/handler/GlobalExceptionHandler.java):
  - Added correlation IDs for better error tracking
  - Replaced unsafe error message exposure with secure error responses
  - Enhanced logging with proper log levels and context
  - Added specific handlers for validation errors and illegal arguments
  - Implemented structured error responses with correlation tracking

  ProjectUseCaseImpl (backend/server/src/main/java/dev/rheinsw/server/internal/project/usecase/ProjectUseCaseImpl.java):
  - Fixed null return issue (now throws exceptions instead)
  - Added comprehensive input validation
  - Enhanced error handling with proper exception types
  - Added detailed logging for all operations

  5. Test Coverage & Quality

  Added comprehensive unit tests:
  - CurrentSessionProviderTest: 8 test cases covering all authentication scenarios
  - UserServiceTest: 7 test cases covering user creation and validation
  - ProjectUseCaseImplTest: 14 test cases covering project operations
  - Added test dependencies (spring-boot-starter-test, spring-security-test)

  6. Frontend Compatibility

  Updated frontend error handling:
  - Enhanced validateCustomer.ts and addCustomer.ts to log correlation IDs
  - Maintained backward compatibility with existing error handling
  - Added debugging support for new correlation ID feature

  7. Build & Deployment

  -  Backend: Builds successfully with all tests passing
  -  Frontend: Both frontend projects build successfully
  -  Dependencies: Added necessary test dependencies
  -  Validation: Bean Validation is properly configured and working

  🔒 Security & Reliability Improvements

  1. Authentication Security: Robust JWT validation with proper error handling
  2. Input Validation: Comprehensive validation across all DTOs
  3. Error Handling: Secure error responses that don't expose internal details
  4. Null Safety: Extensive null checks throughout the codebase
  5. Logging Security: No sensitive data logged, proper correlation IDs for debugging

  📈 Monitoring & Debugging

  1. Correlation IDs: Every error response includes a unique correlation ID
  2. Structured Logging: Consistent logging patterns with user context
  3. Request Tracing: User actions are logged with proper context
  4. Error Classification: Different error types handled appropriately
2025-07-23 00:18:26 +02:00
432ae7e507 Reintroduce RestTemplateConfig 2025-07-23 00:14:56 +02:00
7355b67d62 Prompt template 2025-07-22 23:50:43 +02:00
5c5ed854e4 Code Cleanup 2025-07-22 23:42:18 +02:00
7d901c4273 Update dependencies and remove gateway
* Remove Gateway module, configuration, and references
* Update backend services to directly handle requests under `/api` prefix
* Adjust frontend contact route to connect directly to the server
* Centralize authentication logic and integrate token refresh mechanism
2025-07-22 23:32:57 +02:00
c0b3669c30 Remove Gateway service and configuration
- Delete Gateway module, associated Spring Boot application, and related configuration (`GatewayApplication.java`, `application.yml`, and `pom.xml`).
- Remove Gateway references in `docker-compose.yml`, `.gitlab-ci.yml`, and `backend/pom.xml`.
- Update backend services to directly handle requests under `/api` prefix (e.g., `/api/customers`, `/api/contact`).
- Adjust frontend contact route to connect directly to the server, replacing gateway references with server URLs.
2025-07-15 20:46:43 +02:00
c69786d14b Merge branch 'customer-project' into 'dev'
Add project management support and integrate customer-project functionality

See merge request rheinsw/rheinsw-mono-repo!19
2025-07-15 18:23:53 +00:00
03f633ae52 Add project management support and integrate customer-project functionality 2025-07-15 18:23:53 +00:00
2707aa48bc Remove unused showInfoToast import and align CustomersPage with useCallback dependencies 2025-07-11 23:50:03 +02:00
bdbaf36456 Centralize authentication logic and integrate token refresh mechanism
- Introduce `AuthWrapper` component for streamlined session-based layouts and authentication handling.
- Add new utilities (`tokenUtils.ts`) for JWT decoding, token expiration checks, and refresh operations via Keycloak.
- Refactor `serverCall` and `authOptions` to use centralized token refresh logic, removing redundant implementations.
- Implement `ClientSessionProvider` for consistent session management across the client application.
- Simplify `RootLayout` by delegating authentication enforcement to `AuthWrapper`.
2025-07-11 23:42:41 +02:00
6aae06635d Reset form state on dialog close in NewCustomerModal
- Add `resetForm` utility to restore initial modal state.
- Automatically reset form state when dialog closes or a new customer is created to improve UX.
2025-07-11 20:36:51 +02:00
14d089073b Make NewCustomerModal props readonly to ensure immutability 2025-07-11 20:31:36 +02:00
b62ee3e9ad Add token expiration check and refresh mechanism in serverCall
- Decode and validate JWT payload to detect expired or near-expiring tokens.
- Implement `refreshAccessToken` using Keycloak endpoints for seamless token refresh.
- Modify `serverCall` to refresh and update token dynamically before API requests.
- Improve error logging for token decoding and refresh operations.
2025-07-11 20:30:12 +02:00
52c6358a0c Remove unused showInfoToast during customer data fetch 2025-07-11 20:22:20 +02:00
0724f3b1e7 Remove callApi, refactor API integrations, and adjust error handling
- Delete unused `callApi` utility and related imports across components.
- Replace `callApi` with direct `fetch` usage in `validateCustomer` and `addCustomer`.
- Update `customerRoutes` to include `/api` prefix for consistency.
- Refactor `useErrorHandler` to ensure comprehensive state management during errors.
- Improve `ErrorBoundary` component text for better clarity in fallback UI.
- Align `CustomersPage` logic with `useCallback` for optimized dependency management.
2025-07-11 20:21:45 +02:00
86be1e8920 Enhance NewCustomerModal with callback support and toast notifications
- Add `onCustomerCreated` callback to refresh customer list after creation.
- Integrate `showInfoToast` and `showSuccessToast` for validation and creation feedback.
- Prevent closing modal on backdrop click; add explicit cancel button.
- Refactor `addCustomer` to use `callApi` and centralized routes.
- Simplify customer fetching logic in `CustomersPage` with reusable function.
2025-07-11 19:53:52 +02:00
644d907b45 Reset state on dialog close in ErrorDialog component 2025-07-11 19:33:27 +02:00
c99e09056c Refactor error handling utilities
- Replace `showError` with a more versatile `showToast` utility.
- Add specific toast functions (`showErrorToast`, `showSuccessToast`, etc.) for better message handling.
- Remove `showError.ts` and migrate logic to `showToast.ts` for cleaner structure.
- Update `ErrorBoundary` and `useErrorHandler` to use the new `showToast` functions.
2025-07-11 19:15:08 +02:00
18014ce9f0 Introduce ErrorBoundary component for improved error handling
- Add `ErrorBoundary` component to handle rendering fallback UI during errors.
- Integrate `ErrorBoundary` into main layout and critical pages for global error handling.
- Create `useErrorHandler` hook to handle async errors consistently across components.
- Refactor `NewCustomerModal` and `CustomersPage` to leverage `useErrorHandler` for improved error management.
- Add a fallback dialog UI for user-friendly error reporting and resolution.
2025-07-11 19:06:07 +02:00
2a95efb75f Remove CustomerRepository and replace with direct API calls
- Remove `CustomerRepository` and its methods for customer management and caching.
- Refactor customer-related pages (`[id]/page.tsx`, `customers/page.tsx`) to use direct `fetch` API calls.
- Update breadcrumb resolver to fetch data directly from the API.
- Simplify `addCustomer` use case to avoid repository dependency.
2025-07-11 18:38:44 +02:00
328c0537ba Introduce caching in CustomerRepository and refactor API integration
- Add in-memory caching for customer data in `CustomerRepository` to reduce API calls.
- Replace direct API calls with methods from `CustomerRepository`.
- Update customer-related pages (`[id]/page.tsx`, `customers/page.tsx`) to use `CustomerRepository` for data fetching.
- Adjust breadcrumb resolver to leverage `CustomerRepository`.
- Remove `axios` dependency from customer-related components.
2025-07-07 22:02:55 +02:00
4ae62f2911 Handle empty input validation in validateCustomer use case 2025-07-07 22:02:38 +02:00
e42b352216 Refactor navigation structure and API routes
- Centralize user menu, sidebar items, and breadcrumb logic.
- Map consistent API endpoints in `customerRoutes`.
- Replace inline route definitions with reusable constants.
- Refactor auth configuration file location.
- Improve `<Link>` usage to replace static `<a>` elements.
- Adjust sidebar and dropdown components to use dynamic navigation configurations.
2025-07-07 19:49:58 +02:00
7ba92dc66c Remove demo-related tables and indices from initial schema migration 2025-07-06 21:20:32 +02:00
7b39ab8cd8 Add INTERNAL_BACKEND_URL to .env generation in CI pipeline 2025-07-06 20:24:37 +02:00
4b08e5e58c Fix base URL formatting in serverCall for API requests 2025-07-06 19:59:50 +02:00
54793437a1 Handle empty customers array in filtering logic 2025-07-06 19:52:48 +02:00
1ff2b0e8be Merge branch 'customer-details-view' into 'dev'
Customer Detail Page and Enhance dynamic breadcrumbs

See merge request rheinsw/rheinsw-mono-repo!18
2025-07-06 17:24:12 +00:00
e00142ff81 Customer Detail Page and Enhance dynamic breadcrumbs 2025-07-06 17:24:12 +00:00
055d19d201 Merge branch 'customer-handling' into 'dev'
Add customer management

See merge request rheinsw/rheinsw-mono-repo!17
2025-07-06 08:31:48 +00:00
916dbfcf95 Add customer management 2025-07-06 08:31:48 +00:00
2bd76aa6bb Fix .env handling in CI pipeline 2025-07-02 11:18:11 +09:00
cd3165dbe6 Enhance CI pipeline to include NEXTAUTH_URL for production and test environments. 2025-07-02 11:12:12 +09:00
fb3b5b6880 Cleanup 2025-07-02 11:09:20 +09:00
7cac66d018 Add env_file support for internal_frontend in docker-compose.yml 2025-07-02 11:02:09 +09:00
63985d538a Improve .env handling and deployment; ensure .env is included as an artifact and update deployment scripts to copy it. 2025-07-02 11:01:29 +09:00
3f3ea936dc Log .env contents during CI pipeline 2025-07-02 10:46:39 +09:00
c16ba0d09a Add environment variable handling for CI builds in internal_frontend 2025-07-02 10:41:04 +09:00
9837259c41 Update authOptions import path 2025-07-02 10:22:08 +09:00
ae425e4e28 Refactor authOptions into a separate module to improve structure and reusability. 2025-07-02 10:14:21 +09:00
b1d7eb906f Remove unused jsonwebtoken and jwt-decode dependencies 2025-07-02 10:04:09 +09:00
2f71dca04d Integrate NextAuth with Keycloak and implement JWT validation in internal_frontend. 2025-07-02 09:55:25 +09:00
da3bd7e181 Merge remote-tracking branch 'origin/dev' into dev 2025-07-02 01:45:04 +09:00
0b2f8332a2 Add dynamic breadcrumb navigation and update kanzlei routes under /demo 2025-07-02 01:25:55 +09:00
b33b470e7b Add foundational UI components (sidebar, some basic navigation) 2025-07-01 18:44:15 +09:00
20314c64b2 Add theme integration and shadcn setup in internal_frontend 2025-07-01 17:37:30 +09:00
GitLab CI
bf387fe14c Merge remote-tracking branch 'origin/production' into dev 2025-07-01 08:31:40 +00:00
7c3ee5357e Merge branch 'dev' into 'production'
Add internal_frontend project

See merge request rheinsw/rheinsw-mono-repo!15
2025-07-01 08:29:06 +00:00