# nishiket-singh/bidwise-bidding-website architecture

> Architecture diagram of the GitHub repository nishiket-singh/bidwise-bidding-website, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nishiket-singh/bidwise-bidding-website
- Repository: https://github.com/nishiket-singh/bidwise-bidding-website

## Overview

##### Project type and purpose
- This is a full-stack web application named “BidWise.”
- Frontend: React single-page application (SPA) in the BidWiseClient folder.
- Backend: Spring Boot REST API in the group111 Maven project folder.
- Features: user signup/signin, product catalog, bidding engine, payment flow via Stripe, email notifications, auction-end processing.

##### File structure
- Top-level separation:
– BidWiseClient/ → React app: public assets, src components, pages, styles.
– group111/ → Spring Boot app: controllers, services, repositories, models, DTOs, exceptions, SQL scripts.
– Postman TestCases/ → collections for API endpoints (bidding, login, products, payments).
- Backend patterns:
– MVC / layered architecture:
· Controllers → REST endpoints
· Services → business logic (bidding, payment, authentication, email)
· Repositories → JPA data access
· DTOs ↔ domain models
– Configuration files: application.properties, data.sql, schema.sql
- Frontend patterns:
– Component hierarchy: pages under src/components/pages, shared components (navbar, footer, buttons).
– CSS modules for styling.
– HTTP calls from React to backend API.

##### Examining the README
- Tech stack called out: React, Spring Boot, SQL database, Stripe API.
- Deployment URLs illustrate public API and client hosting.

##### Main components
a. User’s Web Browser (React SPA)
b. React Application Layers
– UI Components → pages, buttons, forms
– API Service Layer (HTTP client)
c. Backend REST API (Spring Boot)
– Controllers (BiddingController, PaymentController, ProductController, UserController)
– Service Layer (BiddingService, PaymentService, AuthenticationService, EmailService, BiddingEndService)
– Repository Layer (JPA Repositories connected to SQL)
– Domain Models & DTOs
d. SQL Database (MySQL/PostgreSQL or in-memory H2)
e. External Services
– Stripe Payment API
– SMTP/Email Service (for notifications)
f. Postman Test Harness (optional external client)

##### Relationships and data flows
- User → React SPA: UI interactions (login, browsing, bidding, checkout).
- React SPA → Spring Boot API: REST calls (JSON over HTTP).
- API Controllers → Services → Repositories: internal request flow.
- Repository → SQL Database: CRUD operations on Users, Products, Bids, Orders, AuthTokens.
- PaymentService → Stripe API: payment authorization & capture.
- BiddingEndService (scheduled or event-driven) → triggers bid-closing logic, updates DB, sends email via EmailService.

##### Architectural patterns and design principles
- Layered architecture (presentation, service, data).
- Dependency Injection (Spring).
- DTO pattern to decouple API contract from persistence models.
- RESTful API design.
- Component-based UI (React).
- External integration points abstracted behind service interfaces (e.g., Stripe, Email).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User and External Clients
    U["User's Web Browser"]:::external
    PM["Postman Test Harness"]:::external

    %% Frontend Layer
    subgraph "Frontend (React v18)" 
        direction TB
        SPA["React SPA"]:::frontend
        APIService["API Service Layer\n(HTTP client)"]:::frontend
        subgraph "UI Components" 
            direction TB
            Pages["Pages\n(SignIn,SignUp,Catalogue,Bidding,Checkout,Receipt)"]:::frontend
            SharedComp["Shared Components\n(Navbar,Footer,Buttons)"]:::frontend
            Styles["CSS Modules\n(Components & Pages)"]:::frontend
        end
        SPA -->|interacts with| Pages
        SPA -->|uses| SharedComp
        SPA -->|styled by| Styles
        Pages -->|calls| APIService
    end

    %% Backend Layer
    subgraph "Backend (Spring Boot v2.x)" 
        direction TB
        Controllers["Controllers\n(BiddingController,PaymentController,ProductController,UserController)"]:::backend
        Services["Services\n(AuthenticationService,BiddingService,PaymentService,EmailService,BiddingEndService)"]:::backend
        Repos["Repositories\n(UserRepo,ProductRepo,BidRepo,HighestBidRepo,OrderRepo,TokenRepo)"]:::backend
        Models["Domain Models\n(User,Product,Bid,HighestBid,Order,AuthToken)"]:::backend
        DTOs["DTOs\n(SignupDto,SigninDto,ProductDto,SubmitBidDto,PaymentDetailsDto,ReceiptDto,ResponseDto,SigninResponseDto,ForgotPasswordResponseDto)"]:::backend
        Exceptions["Exceptions\n(AuthenticationFailException,CustomException)"]:::backend
        Config["Config & Scripts\n(application.properties,schema.sql,data.sql)"]:::backend
        Bootstrap["Application Bootstrap\n(EcommerceprojectApplication)"]:::backend

        APIService -->|HTTP JSON| Controllers
        Controllers -->|calls| Services
        Services -->|calls| Repos
        Repos -->|manages| Models
        Controllers -->|uses| DTOs
        Controllers -->|handles| Exceptions
        Bootstrap -->|bootstraps| Controllers
        Repos -->|reads/writes| Config
    end

    %% Data & External Services
    subgraph "Data & External Services"
        direction TB
        DB[(SQL Database)]:::db
        Stripe["Stripe Payment API"]:::external
        EmailSvc["SMTP/Email Service"]:::external
    end

    Repos -->|CRUD| DB
    PaymentService -->|authorizes| Stripe
    BiddingEndService -->|sends notifications via| EmailSvc

    %% External Client to API
    PM -->|REST calls| Controllers
    U -->|UI interactions| SPA

    %% Click Events
    click SPA "https://github.com/nishiket-singh/bidwise-bidding-website/tree/main/BidWiseClient/"
    click Pages "https://github.com/nishiket-singh/bidwise-bidding-website/tree/main/BidWiseClient/src/components/pages/"
    click SharedComp "https://github.com/nishiket-singh/bidwise-bidding-website/tree/main/BidWiseClient/src/components/"
    click Styles "https://github.com/nishiket-singh/bidwise-bidding-website/tree/main/BidWiseClient/src/components/css/"
    click APIService "https://github.com/nishiket-singh/bidwise-bidding-website/blob/main/BidWiseClient/src/App.js"
    click PM "https://github.com/nishiket-singh/bidwise-bidding-website/tree/main/Postman TestCases/"
    click Controllers "https://github.com/nishiket-singh/bidwise-bidding-website/tree/main/group111/src/main/java/com/yorku/group111/controllers/"
    click Services "https://github.com/nishiket-singh/bidwise-bidding-website/tree/main/group111/src/main/java/com/yorku/group111/service/"
    click Repos "https://github.com/nishiket-singh/bidwise-bidding-website/tree/main/group111/src/main/java/com/yorku/group111/repository/"
    click Models "https://github.com/nishiket-singh/bidwise-bidding-website/tree/main/group111/src/main/java/com/yorku/group111/model/"
    click DTOs "https://github.com/nishiket-singh/bidwise-bidding-website/tree/main/group111/src/main/java/com/yorku/group111/dto/"
    click Exceptions "https://github.com/nishiket-singh/bidwise-bidding-website/tree/main/group111/src/main/java/com/yorku/group111/exceptions/"
    click Config "https://github.com/nishiket-singh/bidwise-bidding-website/tree/main/group111/src/main/resources/"
    click Bootstrap "https://github.com/nishiket-singh/bidwise-bidding-website/blob/main/group111/src/main/java/com/yorku/group111/EcommerceprojectApplication.java"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366d6,stroke-width:1px
    classDef backend fill:#E6FFE6,stroke:#28a745,stroke-width:1px
    classDef db fill:#FFD8A8,stroke:#ff8c00,stroke-width:1px
    classDef external fill:#F0D0FF,stroke:#6f42c1,stroke-width:1px
```
