How manthankk/knowcode-25 works
Project Overview
• This is a multi-module, full-stack application that leverages a microservice architecture.
• The overall system comprises a modern React-based frontend (located in the SKIN-CARE directory) and at least two back-end Spring Boot services:
– The first backend service (“KJ-main”) handles user login, product management, reviews, purchases, and vendor operations.
– The second backend service (“gateway-main”) is dedicated to payment processing and integrating with the Razorpay API.
• The README highlights key pages as “Landing Page”, “Product Page”, “Community”, “Skin Disease Analysis”, and “Payment System”, indicating that the system is rich in UI along with various business functionalities.
Main Components and Their Roles
a. SKIN-CARE (Frontend)
• Built with React/Vite as evidenced by files like App.jsx, main.jsx, and various page components.
• Contains separate routing logic (e.g., RetailerRouter.jsx and UserRouter.jsx) to serve different user roles.
• Provides a user interface for accessing all major features (e.g., community interactions, product browsing, and order tracking).
b. KJ-main (Backend Service for User and Business Logic)
• A Spring Boot (Java) service indicated by the pom.xml, mvnw scripts, and the Maven project structure.
• Implements typical Model-View-Controller (MVC) pattern:
• Controller layer: REST controllers (e.g., CustomerController, ProductsController, ReviewController, etc.) for handling HTTP requests.
• Service layer: Business logic encapsulated in various service classes.
• Repository layer: Data persistence via repositories for entities like Customer, Products, Purchase, Review, and Vendor.
• Likely interacts with a database as configured in application.properties, though the physical database isn’t explicitly present in the file tree.
c. gateway-main (Backend Service for Payment Processing)
• Another Spring Boot application focused on payment functionality.
• Follows a similar MVC pattern with controllers (e.g., RazorpayController), services (RazorpayService), and repositories for Payment entities.
• Acts as a dedicated Payment Gateway backend that the frontend might call when processing transactions.
Relationships and Data Flow
• The SKIN-CARE frontend communicates with the back-end services via RESTful APIs:
– It routes authentication, product, and order management requests to the KJ-main service.
– Payment-related requests are forwarded to the gateway-main service.
• Within each backend service, controllers receive HTTP requests, invoke business logic in the service layers, and persist or retrieve data via repositories.
• If applicable, there may be cross-service communication (for instance, after a purchase is created, the KJ-main service might need to trigger a payment request to the gateway-main service or vice versa).
Architectural Patterns and Design Principles
• Microservices: The clear separation between the login/product service (KJ-main) and the payment service (gateway-main) promotes modularity.
• MVC in the backend: Both backend services organize code logically into controllers, services, and repositories.
• Separation of concerns: The frontend (SKIN-CARE) is isolated from back-end business logic, highlighting a clear API-driven design.
• Extensibility: With distinct services (one handling user/business logic and one focusing on payment), it is easier to maintain and scale specific parts of the system.