{
"type": "mermaid",
"diagramType": "sequence",
"source": "sequenceDiagram\n Client->>API: Request\n API-->>Client: Response",
"outputPath": "docs/diagrams/api-flow.svg",
"format": "svg"
}
classDiagram
class User {
+String id
+String email
+String name
+create()
+update()
+delete()
}
class Order {
+String id
+Date createdAt
+Status status
+process()
+cancel()
}
class OrderItem {
+String productId
+int quantity
+float price
}
User "1" --> "*" Order : places
Order "1" --> "*" OrderItem : contains
erDiagram
USER ||--o{ ORDER : places
USER {
uuid id PK
string email UK
string name
timestamp created_at
}
ORDER ||--|{ ORDER_ITEM : contains
ORDER {
uuid id PK
uuid user_id FK
enum status
timestamp created_at
}
ORDER_ITEM {
uuid id PK
uuid order_id FK
uuid product_id FK
int quantity
}
PRODUCT ||--o{ ORDER_ITEM : "ordered in"
PRODUCT {
uuid id PK
string name
decimal price
}
@startuml C4_Context
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml
Person(user, "User", "A customer of the system")
System(system, "E-Commerce Platform", "Allows users to browse and purchase products")
System_Ext(payment, "Payment Gateway", "Processes payments")
System_Ext(email, "Email Service", "Sends notifications")
Rel(user, system, "Uses", "HTTPS")
Rel(system, payment, "Processes payments", "HTTPS")
Rel(system, email, "Sends emails", "SMTP")
@enduml
@startuml C4_Container
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml
Person(user, "User")
System_Boundary(system, "E-Commerce Platform") {
Container(spa, "Web Application", "React", "User interface")
Container(api, "API Gateway", "Node.js", "REST API")
Container(orders, "Order Service", "Go", "Handles orders")
Container(products, "Product Service", "Go", "Product catalog")
ContainerDb(db, "Database", "PostgreSQL", "Stores data")
ContainerQueue(queue, "Message Queue", "RabbitMQ", "Async messaging")
}
Rel(user, spa, "Uses", "HTTPS")
Rel(spa, api, "Calls", "HTTPS")
Rel(api, orders, "Routes", "gRPC")
Rel(api, products, "Routes", "gRPC")
Rel(orders, db, "Reads/Writes", "SQL")
Rel(orders, queue, "Publishes", "AMQP")
@enduml