Skip to content

Conversation

@sayeedajmal
Copy link
Owner

@sayeedajmal sayeedajmal commented Jun 18, 2025

Summary by CodeRabbit

  • New Features

    • Introduced new React components: Contact, EditProfile, NotFound, Cart, Checkout, ProductDetails, WishProduct, and Wishlist for enhanced user experience.
    • Added a new user model to the backend product service for improved authentication and authorization.
    • Expanded repository query methods for advanced product, category, image, variant, and specification filtering.
    • Enhanced backend error handling with custom exceptions and stricter validation across services.
  • Bug Fixes

    • Corrected and unified API endpoint paths for authentication and product-related controllers.
    • Improved JWT handling and security configuration in authentication and gateway services.
  • Refactor

    • Migrated backend entity relationships to use proper JPA associations and Lombok for cleaner code.
    • Standardized controller and service error handling by propagating exceptions.
    • Updated import paths and directory structures for frontend components and Redux store.
  • Style

    • Updated global font settings and removed unused fonts in frontend CSS.
    • Improved layout and color theming in new and existing frontend components using Tailwind CSS.
  • Documentation

    • Rewrote the frontend README to provide a comprehensive overview and project structure guide.

@coderabbitai
Copy link

coderabbitai bot commented Jun 18, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update introduces significant refactoring and enhancements across backend and frontend modules. The backend (MartAuth, MartGateway, MartProduct) sees improved entity modeling with richer JPA associations, stricter error handling via custom exceptions, and expanded repository query methods. Controller and service layers are streamlined, with exception handling centralized and method signatures updated. Security configurations and JWT handling are refined for both gateway and auth services. The frontend (martUI) receives a comprehensive redesign: new components (Header, Footer, Contact, Cart, Checkout, Wishlist, ProductDetails, etc.) are added, navigation and routing are restructured, and code organization is improved for scalability and maintainability.

Changes

Files/Paths Change Summary
Docker-Compose.yaml, MartAuth/Dockerfile, MartGateway/Dockerfile Updated port mappings and EXPOSE directives for service containers.
MartAuth/.gitignore Changed .gitignore rule to ignore maven-wrapper.jar.
MartAuth/pom.xml, MartGateway/pom.xml Reformatted POMs, improved metadata, standardized dependency management and artifact naming.
MartAuth/src/main/resources/application.yaml, MartAuth/src/main/resources/application.yml, MartGateway/src/main/resources/application.yml, MartProduct/src/main/resources/application.yaml Added or updated application configuration files; removed old YAML files; standardized service names and route predicates.
MartAuth/src/main/java/com/saudiMart/Auth/Controller/AuthController.java Changed base mapping to /authen, moved @Autowired to constructor, improved docs and debug output.
MartAuth/src/main/java/com/saudiMart/Auth/Model/Users.java Added @JsonIgnoreProperties, clarified field comments.
MartAuth/src/main/java/com/saudiMart/Auth/Security/JwtRequestFilter.java, MartAuth/src/main/java/com/saudiMart/Auth/Security/SecurityConfig.java Simplified security filter chain, removed custom entry point, updated permitted URLs.
MartAuth/src/main/java/com/saudiMart/Auth/Utils/JwtUtil.java Changed JWT "name" claim to use display name.
MartGateway/src/main/java/com/saudimart/Gateway/Security/SecurityConfig.java, MartGateway/src/main/java/com/saudimart/Gateway/Security/filter/JwtAuthenticationFilter.java, MartGateway/src/main/java/com/saudimart/Gateway/Utils/JwtUtil.java Enhanced JWT role extraction, switched to WebFilter, improved CORS, expanded public endpoints.
MartProduct/src/main/java/com/saudiMart/Product/Controller/CategoryController.java, ... (all MartProduct controllers) Changed route mappings, switched to constructor injection, removed internal try-catch, updated to throw ProductException, standardized responses.
MartProduct/src/main/java/com/saudiMart/Product/Model/*.java Refactored entity models: renamed PKs, replaced FK fields with JPA associations, added lifecycle hooks, used Lombok, added new fields.
MartProduct/src/main/java/com/saudiMart/Product/Repository/*.java Added/updated query methods to support new associations and richer queries.
MartProduct/src/main/java/com/saudiMart/Product/Service/*.java Switched to field injection, enforced null/entity checks, replaced Optional returns with exceptions, removed unused methods.
martUI/README.md Rewrote to describe project structure and technologies.
martUI/src/App.jsx, martUI/src/main.jsx, martUI/src/api/auth.js, martUI/src/components/, martUI/src/pages/ Restructured imports, added new UI components (Header, Footer, Contact, Cart, Checkout, Wishlist, ProductDetails, NotFound, etc.), updated navigation and routing, improved layout and styling.
martUI/src/index.css Removed unused font imports, set global font family.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Gateway
    participant AuthService
    participant ProductService

    User->>Gateway: HTTP request (e.g., /authen/login, /products)
    Gateway->>Gateway: JwtAuthenticationFilter (extracts JWT, roles)
    alt Public endpoint (/authen/**, /users/**, /actuator/**)
        Gateway->>TargetService: Forward request (no auth required)
    else Protected endpoint
        alt JWT valid
            Gateway->>TargetService: Forward request with user headers
        else JWT invalid
            Gateway-->>User: 401 Unauthorized
        end
    end
    TargetService->>Gateway: Response
    Gateway->>User: Response
Loading
sequenceDiagram
    participant Controller
    participant Service
    participant Repository
    participant DB

    Controller->>Service: API call (e.g., getProductById)
    Service->>Repository: Query (e.g., findById)
    Repository->>DB: SQL/ORM query
    DB-->>Repository: Entity/Result
    alt Entity found
        Repository-->>Service: Entity
        Service-->>Controller: Entity
    else Not found
        Repository-->>Service: null/empty
        Service-->>Controller: throw ProductException
    end
    Controller-->>User: Response (or error)
Loading

Poem

Hopping through code with a whisk and a wand,
Entities now link with a magical bond!
Controllers throw errors, no more silent fall,
JWTs checked at the gateway wall.
UI shines with new pages and flair—
A rabbit’s delight, with features to spare!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 036af30 and b98c019.

⛔ Files ignored due to path filters (1)
  • .DS_Store is excluded by !**/.DS_Store
📒 Files selected for processing (64)
  • Docker-Compose.yaml (1 hunks)
  • MartAuth/.gitignore (1 hunks)
  • MartAuth/Dockerfile (1 hunks)
  • MartAuth/pom.xml (3 hunks)
  • MartAuth/src/main/java/com/saudiMart/Auth/Controller/AuthController.java (2 hunks)
  • MartAuth/src/main/java/com/saudiMart/Auth/Model/Users.java (2 hunks)
  • MartAuth/src/main/java/com/saudiMart/Auth/Security/JwtRequestFilter.java (1 hunks)
  • MartAuth/src/main/java/com/saudiMart/Auth/Security/SecurityConfig.java (2 hunks)
  • MartAuth/src/main/java/com/saudiMart/Auth/Utils/JwtUtil.java (1 hunks)
  • MartAuth/src/main/resources/application.yaml (1 hunks)
  • MartAuth/src/main/resources/application.yml (0 hunks)
  • MartGateway/Dockerfile (1 hunks)
  • MartGateway/pom.xml (3 hunks)
  • MartGateway/src/main/java/com/saudimart/Gateway/Security/SecurityConfig.java (2 hunks)
  • MartGateway/src/main/java/com/saudimart/Gateway/Security/filter/JwtAuthenticationFilter.java (1 hunks)
  • MartGateway/src/main/java/com/saudimart/Gateway/Utils/JwtUtil.java (2 hunks)
  • MartGateway/src/main/resources/application.yml (2 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Controller/CategoryController.java (1 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Controller/PriceTierController.java (1 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Controller/ProductImageController.java (1 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Controller/ProductSpecificationController.java (1 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Controller/ProductVariantController.java (1 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Controller/ProductsController.java (1 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Model/Category.java (3 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Model/PriceTier.java (1 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Model/ProductImage.java (2 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Model/ProductSpecification.java (2 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Model/ProductVariant.java (1 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Model/Products.java (3 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Model/Users.java (1 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Repository/CategoryRepository.java (1 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Repository/PriceTierRepository.java (1 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Repository/ProductImageRepository.java (1 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Repository/ProductSpecificationRepository.java (1 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Repository/ProductVariantRepository.java (1 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Repository/ProductsRepository.java (1 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Service/CategoryService.java (1 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Service/PriceTierService.java (1 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Service/ProductImageService.java (2 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Service/ProductSpecificationService.java (1 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Service/ProductVariantService.java (1 hunks)
  • MartProduct/src/main/java/com/saudiMart/Product/Service/ProductsService.java (2 hunks)
  • MartProduct/src/main/resources/application.yaml (1 hunks)
  • martUI/README.md (1 hunks)
  • martUI/src/App.jsx (4 hunks)
  • martUI/src/Footer.jsx (0 hunks)
  • martUI/src/api/auth.js (1 hunks)
  • martUI/src/components/Contact.jsx (1 hunks)
  • martUI/src/components/EditProfile.jsx (1 hunks)
  • martUI/src/components/Footer.jsx (1 hunks)
  • martUI/src/components/Header.jsx (1 hunks)
  • martUI/src/components/LoginPage.jsx (1 hunks)
  • martUI/src/components/NotFound.jsx (1 hunks)
  • martUI/src/components/NotificationDisplay.jsx (1 hunks)
  • martUI/src/components/SignupPage.jsx (1 hunks)
  • martUI/src/index.css (1 hunks)
  • martUI/src/main.jsx (1 hunks)
  • martUI/src/pages/buyer/BuyerDashboard.jsx (1 hunks)
  • martUI/src/pages/components/Cart.jsx (1 hunks)
  • martUI/src/pages/components/Categories.jsx (6 hunks)
  • martUI/src/pages/components/Checkout.jsx (1 hunks)
  • martUI/src/pages/components/ProductDetails.jsx (1 hunks)
  • martUI/src/pages/components/WishProduct.jsx (1 hunks)
  • martUI/src/pages/components/Wishlist.jsx (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@sayeedajmal sayeedajmal merged commit f09b002 into main Jun 18, 2025
0 of 2 checks passed
@sayeedajmal sayeedajmal deleted the updateProduct branch June 18, 2025 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants