# alex-valauney/buy-01 architecture

> Architecture diagram of the GitHub repository alex-valauney/buy-01, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alex-valauney/buy-01
- Repository: https://github.com/alex-valauney/buy-01

## Overview

Buy-01 is an Angular storefront backed by Spring Boot microservices. Users browse products, register or log in, and sellers manage product listings; the frontend’s API service is the HTTP boundary, while the gateway and discovery service are documented infrastructure. Product and user services implement the corresponding domain operations and persist MongoDB records; media handles image storage. The README also describes the service architecture and data models. Source excerpts establish several internal calls, but not the frontend’s complete HTTP routing or service registration, so those links are left unverified or omitted.

Main entry points: [`frontend/src/app/app-routing.module.ts`](https://github.com/alex-valauney/buy-01/blob/main/frontend/src/app/app-routing.module.ts) (App routes), [`frontend/src/app/features/seller/product-form/product-form.component.ts`](https://github.com/alex-valauney/buy-01/blob/main/frontend/src/app/features/seller/product-form/product-form.component.ts) (Product form), [`microservices/user-service/src/main/java/com/buy01/user/repository/UserRepository.java`](https://github.com/alex-valauney/buy-01/blob/main/microservices/user-service/src/main/java/com/buy01/user/repository/UserRepository.java) (User repository), [`microservices/product-service/src/main/java/com/buy01/product/repository/ProductRepository.java`](https://github.com/alex-valauney/buy-01/blob/main/microservices/product-service/src/main/java/com/buy01/product/repository/ProductRepository.java) (Product repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Angular storefront"]
  node_routes["App routes"]
  node_login["Login screen<br/>[login.component.ts]"]
  node_register["Registration screen"]
  node_listing["Product listing"]
  node_dashboard["Seller dashboard"]
  node_productform["Product form"]
  node_authclient["Auth client<br/>[auth.service.ts]"]
  node_productclient["Product client<br/>[product.service.ts]"]
  node_api["HTTP API client<br/>[api.service.ts]"]
end

subgraph group_platform["Service infrastructure"]
  node_gateway["API gateway"]
  node_discovery["Service discovery"]
end

subgraph group_users["Identity service"]
  node_authcontroller["Auth endpoints"]
  node_userservice["User operations<br/>[UserService.java]"]
  node_userrepo["User repository"]
  node_userrecord["User record<br/>[User.java]"]
  node_userdb[("User MongoDB")]
end

subgraph group_catalog["Catalog and media"]
  node_productcontroller["Product endpoints"]
  node_productservice["Product operations"]
  node_productrepo["Product repository"]
  node_productrecord["Product record<br/>[Product.java]"]
  node_productdb[("Product MongoDB")]
  node_mediacontroller["Media endpoints"]
  node_filestore["File storage"]
end

node_shopper(("Shopper or seller"))

node_shopper -->|"uses"| node_routes
node_routes -->|"routes to"| node_login
node_routes -->|"routes to"| node_register
node_routes -->|"routes to"| node_listing
node_routes -->|"routes to"| node_dashboard
node_routes -->|"routes to"| node_productform
node_login -->|"calls"| node_authclient
node_register -->|"calls"| node_authclient
node_authclient -->|"sends requests"| node_api
node_productclient -->|"sends requests"| node_api
node_productform -->|"uses"| node_productclient
node_productform -.->|"uploads images"| node_filestore
node_api -.->|"HTTP requests"| node_gateway
node_authcontroller -->|"calls"| node_userservice
node_userservice -->|"reads and writes"| node_userrepo
node_userrepo -->|"persists"| node_userrecord
node_userrepo -.->|"stores"| node_userdb
node_productcontroller -->|"calls"| node_productservice
node_productservice -->|"reads and writes"| node_productrepo
node_productrepo -->|"persists"| node_productrecord
node_productrepo -.->|"stores"| node_productdb
node_mediacontroller -->|"delegates"| node_filestore

click node_routes "https://github.com/alex-valauney/buy-01/blob/main/frontend/src/app/app-routing.module.ts"
click node_login "https://github.com/alex-valauney/buy-01/blob/main/frontend/src/app/features/auth/login/login.component.ts"
click node_register "https://github.com/alex-valauney/buy-01/blob/main/frontend/src/app/features/auth/register/register.component.ts"
click node_listing "https://github.com/alex-valauney/buy-01/blob/main/frontend/src/app/features/product/product-list/product-list.component.ts"
click node_dashboard "https://github.com/alex-valauney/buy-01/blob/main/frontend/src/app/features/seller/dashboard/seller-dashboard.component.ts"
click node_productform "https://github.com/alex-valauney/buy-01/blob/main/frontend/src/app/features/seller/product-form/product-form.component.ts"
click node_authclient "https://github.com/alex-valauney/buy-01/blob/main/frontend/src/app/core/services/auth.service.ts"
click node_productclient "https://github.com/alex-valauney/buy-01/blob/main/frontend/src/app/core/services/product.service.ts"
click node_api "https://github.com/alex-valauney/buy-01/blob/main/frontend/src/app/core/services/api.service.ts"
click node_gateway "https://github.com/alex-valauney/buy-01/blob/main/microservices/gateway-service/src/main/java/com/buy01/gateway/GatewayServiceApplication.java"
click node_discovery "https://github.com/alex-valauney/buy-01/blob/main/microservices/discovery-service/src/main/java/com/buy01/discovery/DiscoveryServiceApplication.java"
click node_authcontroller "https://github.com/alex-valauney/buy-01/blob/main/microservices/user-service/src/main/java/com/buy01/user/controller/AuthController.java"
click node_userservice "https://github.com/alex-valauney/buy-01/blob/main/microservices/user-service/src/main/java/com/buy01/user/service/UserService.java"
click node_userrepo "https://github.com/alex-valauney/buy-01/blob/main/microservices/user-service/src/main/java/com/buy01/user/repository/UserRepository.java"
click node_userrecord "https://github.com/alex-valauney/buy-01/blob/main/microservices/user-service/src/main/java/com/buy01/user/model/User.java"
click node_productcontroller "https://github.com/alex-valauney/buy-01/blob/main/microservices/product-service/src/main/java/com/buy01/product/controller/ProductController.java"
click node_productservice "https://github.com/alex-valauney/buy-01/blob/main/microservices/product-service/src/main/java/com/buy01/product/service/ProductService.java"
click node_productrepo "https://github.com/alex-valauney/buy-01/blob/main/microservices/product-service/src/main/java/com/buy01/product/repository/ProductRepository.java"
click node_productrecord "https://github.com/alex-valauney/buy-01/blob/main/microservices/product-service/src/main/java/com/buy01/product/model/Product.java"
click node_mediacontroller "https://github.com/alex-valauney/buy-01/blob/main/microservices/media-service/src/main/java/com/buy01/media/controller/MediaController.java"
click node_filestore "https://github.com/alex-valauney/buy-01/blob/main/microservices/media-service/src/main/java/com/buy01/media/service/FileStorageService.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_routes,node_login,node_register,node_listing,node_dashboard,node_productform,node_authclient,node_productclient,node_api toneBlue
class node_gateway,node_discovery toneAmber
class node_authcontroller,node_userservice,node_userrepo,node_userrecord,node_userdb toneMint
class node_productcontroller,node_productservice,node_productrepo,node_productrecord,node_productdb,node_mediacontroller,node_filestore toneRose
class node_shopper toneIndigo
```

## Components

### Angular storefront

- [App routes](https://github.com/alex-valauney/buy-01/blob/main/frontend/src/app/app-routing.module.ts): `frontend/src/app/app-routing.module.ts`
- [Login screen](https://github.com/alex-valauney/buy-01/blob/main/frontend/src/app/features/auth/login/login.component.ts): `frontend/src/app/features/auth/login/login.component.ts`
- [Registration screen](https://github.com/alex-valauney/buy-01/blob/main/frontend/src/app/features/auth/register/register.component.ts): `frontend/src/app/features/auth/register/register.component.ts`
- [Product listing](https://github.com/alex-valauney/buy-01/blob/main/frontend/src/app/features/product/product-list/product-list.component.ts): `frontend/src/app/features/product/product-list/product-list.component.ts`
- [Seller dashboard](https://github.com/alex-valauney/buy-01/blob/main/frontend/src/app/features/seller/dashboard/seller-dashboard.component.ts): `frontend/src/app/features/seller/dashboard/seller-dashboard.component.ts`
- [Product form](https://github.com/alex-valauney/buy-01/blob/main/frontend/src/app/features/seller/product-form/product-form.component.ts): `frontend/src/app/features/seller/product-form/product-form.component.ts`
- [Auth client](https://github.com/alex-valauney/buy-01/blob/main/frontend/src/app/core/services/auth.service.ts): `frontend/src/app/core/services/auth.service.ts`
- [Product client](https://github.com/alex-valauney/buy-01/blob/main/frontend/src/app/core/services/product.service.ts): `frontend/src/app/core/services/product.service.ts`
- [HTTP API client](https://github.com/alex-valauney/buy-01/blob/main/frontend/src/app/core/services/api.service.ts): `frontend/src/app/core/services/api.service.ts`

### Service infrastructure

- [API gateway](https://github.com/alex-valauney/buy-01/blob/main/microservices/gateway-service/src/main/java/com/buy01/gateway/GatewayServiceApplication.java): `microservices/gateway-service/src/main/java/com/buy01/gateway/GatewayServiceApplication.java`
- [Service discovery](https://github.com/alex-valauney/buy-01/blob/main/microservices/discovery-service/src/main/java/com/buy01/discovery/DiscoveryServiceApplication.java): `microservices/discovery-service/src/main/java/com/buy01/discovery/DiscoveryServiceApplication.java`

### Identity service

- [Auth endpoints](https://github.com/alex-valauney/buy-01/blob/main/microservices/user-service/src/main/java/com/buy01/user/controller/AuthController.java): `microservices/user-service/src/main/java/com/buy01/user/controller/AuthController.java`
- [User operations](https://github.com/alex-valauney/buy-01/blob/main/microservices/user-service/src/main/java/com/buy01/user/service/UserService.java): `microservices/user-service/src/main/java/com/buy01/user/service/UserService.java`
- [User repository](https://github.com/alex-valauney/buy-01/blob/main/microservices/user-service/src/main/java/com/buy01/user/repository/UserRepository.java): `microservices/user-service/src/main/java/com/buy01/user/repository/UserRepository.java`
- [User record](https://github.com/alex-valauney/buy-01/blob/main/microservices/user-service/src/main/java/com/buy01/user/model/User.java): `microservices/user-service/src/main/java/com/buy01/user/model/User.java`
- **User MongoDB**

### Catalog and media

- [Product endpoints](https://github.com/alex-valauney/buy-01/blob/main/microservices/product-service/src/main/java/com/buy01/product/controller/ProductController.java): `microservices/product-service/src/main/java/com/buy01/product/controller/ProductController.java`
- [Product operations](https://github.com/alex-valauney/buy-01/blob/main/microservices/product-service/src/main/java/com/buy01/product/service/ProductService.java): `microservices/product-service/src/main/java/com/buy01/product/service/ProductService.java`
- [Product repository](https://github.com/alex-valauney/buy-01/blob/main/microservices/product-service/src/main/java/com/buy01/product/repository/ProductRepository.java): `microservices/product-service/src/main/java/com/buy01/product/repository/ProductRepository.java`
- [Product record](https://github.com/alex-valauney/buy-01/blob/main/microservices/product-service/src/main/java/com/buy01/product/model/Product.java): `microservices/product-service/src/main/java/com/buy01/product/model/Product.java`
- **Product MongoDB**
- [Media endpoints](https://github.com/alex-valauney/buy-01/blob/main/microservices/media-service/src/main/java/com/buy01/media/controller/MediaController.java): `microservices/media-service/src/main/java/com/buy01/media/controller/MediaController.java`
- [File storage](https://github.com/alex-valauney/buy-01/blob/main/microservices/media-service/src/main/java/com/buy01/media/service/FileStorageService.java): `microservices/media-service/src/main/java/com/buy01/media/service/FileStorageService.java`

### Other components

- **Shopper or seller**

## Connections

- Shopper or seller → App routes: uses
- App routes → Login screen: routes to (evidence: `frontend/src/app/app-routing.module.ts`)
- App routes → Registration screen: routes to (evidence: `frontend/src/app/app-routing.module.ts`)
- App routes → Product listing: routes to (evidence: `frontend/src/app/app-routing.module.ts`)
- App routes → Seller dashboard: routes to (evidence: `frontend/src/app/app-routing.module.ts`)
- App routes → Product form: routes to (evidence: `frontend/src/app/app-routing.module.ts`)
- Login screen → Auth client: calls (evidence: `frontend/src/app/features/auth/login/login.component.ts`)
- Registration screen → Auth client: calls (evidence: `frontend/src/app/features/auth/register/register.component.ts`)
- Auth client → HTTP API client: sends requests (evidence: `frontend/src/app/core/services/auth.service.ts`)
- Product client → HTTP API client: sends requests (evidence: `frontend/src/app/core/services/product.service.ts`)
- Product form → Product client: uses (evidence: `frontend/src/app/features/seller/product-form/product-form.component.ts`)
- Product form → File storage: uploads images
- HTTP API client → API gateway: HTTP requests
- Auth endpoints → User operations: calls (evidence: `microservices/user-service/src/main/java/com/buy01/user/controller/AuthController.java`)
- User operations → User repository: reads and writes (evidence: `microservices/user-service/src/main/java/com/buy01/user/service/UserService.java`)
- User repository → User record: persists (evidence: `microservices/user-service/src/main/java/com/buy01/user/repository/UserRepository.java`)
- User repository → User MongoDB: stores
- Product endpoints → Product operations: calls (evidence: `microservices/product-service/src/main/java/com/buy01/product/controller/ProductController.java`)
- Product operations → Product repository: reads and writes (evidence: `microservices/product-service/src/main/java/com/buy01/product/service/ProductService.java`)
- Product repository → Product record: persists (evidence: `microservices/product-service/src/main/java/com/buy01/product/repository/ProductRepository.java`)
- Product repository → Product MongoDB: stores
- Media endpoints → File storage: delegates (evidence: `microservices/media-service/src/main/java/com/buy01/media/controller/MediaController.java`)
