# foolish-wang/carsties architecture

> Architecture diagram of the GitHub repository foolish-wang/carsties, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/foolish-wang/carsties
- Repository: https://github.com/foolish-wang/carsties

## Overview

- Frontend (Next.js Web App): Represents the user interface, handling routing, authentication via NextAuth, and real-time notifications (SignalR).
- API Gateway: Acts as the entry point for client requests (using the GatewayService) and routes requests to the appropriate backend service.
– Auction Service: Manages auction listings and related operations.
– Bidding Service: Handles bids on auctions.
– Identity Service: Manages user authentication, registration, and identity tasks.
– Notification Service: Delivers real-time notifications (via SignalR) for events like auction updates.
– Search Service: Provides search functionality for auctions.
- Messaging Bus: Represent RabbitMQ/MassTransit as a central communication component between microservices.
- Nginx: Place a small component for reverse proxy that directs traffic to the Frontend and Gateway.

– Connect each microservice to its respective database where applicable.

##### Architectural Patterns & Key Technologies
- Microservice Architecture: Illustrate each backend component as an independent service communicating through a message broker (RabbitMQ/MassTransit).
- Authentication: Emphasize the Identity Service and NextAuth integration within the Frontend.
- Real-Time Communication: Indicate the Notification Service’s use of SignalR for live updates.

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["User/Client"]:::external
    NGINX["Nginx Reverse Proxy"]:::external
    Frontend["Frontend (Next.js)"]:::frontend
    API["API Gateway"]:::gateway

    Auction["Auction Service"]:::microservice
    Bidding["Bidding Service"]:::microservice
    Identity["Identity Service"]:::microservice
    Notification["Notification Service"]:::microservice
    Search["Search Service"]:::microservice

    Messaging["Messaging Bus (RabbitMQ/MassTransit)"]:::messaging

    Postgres["(PostgreSQL)"]:::database
    Mongo["(MongoDB)"]:::database

    User -->|"access"| Frontend
    NGINX -->|"routes"| Frontend
    Frontend -->|"api_request"| API

    API -->|"invokes"| Auction
    API -->|"invokes"| Bidding
    API -->|"invokes"| Identity
    API -->|"invokes"| Notification
    API -->|"invokes"| Search

    Auction -->|"communicates"| Messaging
    Bidding -->|"communicates"| Messaging
    Identity -->|"communicates"| Messaging
    Notification -->|"communicates"| Messaging
    Search -->|"communicates"| Messaging

    Auction -->|"stores_data"| Postgres
    Bidding -->|"stores_data"| Postgres
    Identity -->|"stores_data"| Postgres
    Notification -->|"stores_data"| Postgres
    Search -->|"stores_data"| Mongo

    click Frontend "https://github.com/foolish-wang/carsties/tree/main/frontend/web-app"
    click API "https://github.com/foolish-wang/carsties/tree/main/src/GatewayService"
    click Auction "https://github.com/foolish-wang/carsties/tree/main/src/AuctionService"
    click Bidding "https://github.com/foolish-wang/carsties/tree/main/src/BiddingService"
    click Identity "https://github.com/foolish-wang/carsties/tree/main/src/IdentityService"
    click Notification "https://github.com/foolish-wang/carsties/tree/main/src/NotificationService"
    click Search "https://github.com/foolish-wang/carsties/tree/main/src/SearchService"

    classDef external fill:#ffcdff,stroke:#333,stroke-width:2px
    classDef frontend fill:#d0e6ff,stroke:#333,stroke-width:2px
    classDef gateway fill:#d0ffd6,stroke:#333,stroke-width:2px
    classDef microservice fill:#ffd6a5,stroke:#333,stroke-width:2px
    classDef messaging fill:#d6fffa,stroke:#333,stroke-width:2px
    classDef database fill:#fff3b0,stroke:#333,stroke-width:2px
```
