Skip to content

Commit 83dd4dc

Browse files
committed
chore: improve blog pages
1 parent e6fb355 commit 83dd4dc

20 files changed

Lines changed: 1332 additions & 14 deletions

File tree

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ slug: welcome
33
title: Welcome to Structus
44
authors: [melsardes]
55
tags: [structus, kotlin, architecture, ddd]
6-
date: 2023-11-24
6+
date: 2025-12-19
77
---
88

9+
import SocialShare from '@site/src/components/SocialShare';
10+
911
# Welcome to Structus Documentation
1012

1113
We're excited to announce the launch of the official Structus documentation website!
12-
1314
<!-- truncate -->
1415

1516
## What is Structus?
@@ -30,15 +31,19 @@ Structus solves these problems by providing a framework-agnostic foundation that
3031
## Key Features
3132

3233
### 🚀 Pure Kotlin
34+
3335
No framework dependencies. Works with Spring Boot, Ktor, Micronaut, Quarkus, or pure Kotlin applications.
3436

3537
### 🔄 Coroutine-Ready
38+
3639
All I/O operations use suspend functions, making it perfect for modern asynchronous applications.
3740

3841
### 📦 Minimal Dependencies
42+
3943
Only Kotlin stdlib and kotlinx-coroutines-core. Nothing more.
4044

4145
### 🎨 Clean Architecture
46+
4247
Enforces proper layer separation and dependencies through well-defined interfaces.
4348

4449
## Getting Started
@@ -49,17 +54,18 @@ Ready to try Structus? Check out our [Quick Start Tutorial](/docs/getting-starte
4954

5055
We're continuously improving Structus. Here's what's coming:
5156

52-
- 📚 More comprehensive examples
53-
- 🔌 Framework integration guides (Spring Boot, Ktor)
54-
- 🎓 Video tutorials
55-
- 📦 Publication to Maven Central
57+
- **Transactional Outbox Pattern**: For reliable event publishing
58+
- **Saga Pattern Support**: For distributed transactions
59+
- **Projections**: CQRS read model support
60+
- **Multi-tenancy**: Enterprise-grade support
5661

57-
## Join the Community
62+
## Join Us
5863

59-
Structus is open-source and community-driven. We'd love your feedback!
64+
We're building Structus as an open-source community project. Whether you're using it in production or just exploring clean architecture concepts, we'd love to hear from you!
6065

61-
-[Star us on GitHub](https://github.com/structus-io/structus-kotlin)
62-
- 💬 [Join discussions](https://github.com/structus-io/structus-kotlin/discussions)
63-
- 🐛 [Report issues](https://github.com/structus-io/structus-kotlin/issues)
66+
<SocialShare
67+
title="Welcome to Structus - Clean Architecture for Kotlin"
68+
url="https://structus-io.github.io/structus-docs/blog/welcome"
69+
description="Introducing Structus: A pure Kotlin library for implementing Explicit Architecture with DDD, CQRS, and Event-Driven Design"
70+
/>
6471

65-
Thank you for your interest in Structus. Let's build better software together!

blog/authors.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ melsardes:
44
url: https://github.com/melsardes
55
image_url: https://github.com/melsardes.png
66
email: dev.melsardes@gmail.com
7+
bio: Software developer and open-source enthusiast passionate about clean code and domain-driven design
8+
socials:
9+
github: MelSardes
10+
twitter: MelSardes

docs/reference/api-reference.md

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
---
2+
id: api-reference
3+
title: API Reference
4+
sidebar_position: 1
5+
---
6+
7+
import ApiReference from '@site/src/components/ApiReference';
8+
9+
# Structus API Reference
10+
11+
Complete API documentation for the Structus library.
12+
13+
<ApiReference
14+
title="Core Aggregates"
15+
description="Base interfaces and classes for building domain models"
16+
endpoints={[
17+
{
18+
method: "interface",
19+
path: "AggregateRoot<ID>",
20+
description: "Base interface for aggregate root entities. All domain model aggregates must implement this interface.",
21+
parameters: [
22+
{
23+
name: "ID",
24+
type: "Serializable",
25+
description: "The type of the aggregate's identifier",
26+
required: true,
27+
}
28+
],
29+
returns: {
30+
type: "Entity with event sourcing capabilities",
31+
description: "Provides methods for managing domain events and state changes"
32+
},
33+
example: `data class OrderAggregate(
34+
override val id: OrderId,
35+
val items: List<OrderItem> = emptyList(),
36+
val status: OrderStatus = OrderStatus.PENDING
37+
) : AggregateRoot<OrderId> {
38+
override fun getUncommittedEvents(): List<DomainEvent> {
39+
return emptyList()
40+
}
41+
}`
42+
},
43+
{
44+
method: "interface",
45+
path: "Entity<ID>",
46+
description: "Base interface for entities within an aggregate. Entities have identity and lifecycle within aggregates.",
47+
parameters: [
48+
{
49+
name: "ID",
50+
type: "Serializable",
51+
description: "The type of the entity's identifier",
52+
required: true,
53+
}
54+
],
55+
returns: {
56+
type: "Entity with value object support",
57+
description: "Supports composition with value objects for rich domain models"
58+
}
59+
},
60+
{
61+
method: "class",
62+
path: "ValueObject",
63+
description: "Abstract base class for value objects. Value objects have no identity and are immutable.",
64+
returns: {
65+
type: "Immutable domain concept",
66+
description: "Used for modeling concepts like Money, Email, or ProductCode"
67+
},
68+
example: `data class Money(
69+
val amount: BigDecimal,
70+
val currency: Currency
71+
) : ValueObject() {
72+
init {
73+
require(amount >= BigDecimal.ZERO) { "Amount must be non-negative" }
74+
}
75+
}`
76+
}
77+
]}
78+
/>
79+
80+
<ApiReference
81+
title="Repository Pattern"
82+
description="Interfaces for persisting and retrieving aggregates"
83+
endpoints={[
84+
{
85+
method: "interface",
86+
path: "Repository<T, ID>",
87+
description: "Base repository interface for storing and retrieving aggregates of type T",
88+
parameters: [
89+
{
90+
name: "T",
91+
type: "AggregateRoot<ID>",
92+
description: "The aggregate root type",
93+
required: true,
94+
},
95+
{
96+
name: "ID",
97+
type: "Serializable",
98+
description: "The aggregate's identifier type",
99+
required: true,
100+
}
101+
],
102+
returns: {
103+
type: "Query and persistence operations",
104+
description: "Provides find, save, and delete operations"
105+
},
106+
example: `interface OrderRepository : Repository<OrderAggregate, OrderId> {
107+
suspend fun findByCustomerId(customerId: CustomerId): List<OrderAggregate>
108+
suspend fun findRecentOrders(limit: Int): List<OrderAggregate>
109+
}`
110+
}
111+
]}
112+
/>
113+
114+
<ApiReference
115+
title="Command Handling"
116+
description="Interfaces for handling commands and business operations"
117+
endpoints={[
118+
{
119+
method: "interface",
120+
path: "CommandHandler<T, R>",
121+
description: "Handles a command of type T and returns a result of type R",
122+
parameters: [
123+
{
124+
name: "T",
125+
type: "Command",
126+
description: "The command to handle",
127+
required: true,
128+
},
129+
{
130+
name: "R",
131+
type: "Any",
132+
description: "The return type of the command handler",
133+
required: true,
134+
}
135+
],
136+
returns: {
137+
type: "Result<R>",
138+
description: "Either a successful result or a domain error"
139+
},
140+
example: `class CreateOrderCommandHandler(
141+
private val orderRepository: OrderRepository
142+
) : CommandHandler<CreateOrderCommand, OrderId> {
143+
override suspend fun handle(command: CreateOrderCommand): OrderId {
144+
val order = OrderAggregate.create(
145+
customerId = command.customerId,
146+
items = command.items
147+
)
148+
orderRepository.save(order)
149+
return order.id
150+
}
151+
}`
152+
}
153+
]}
154+
/>
155+
156+
## Best Practices
157+
158+
- **Aggregate Design**: Keep aggregates small and focused on a single responsibility
159+
- **Event Sourcing**: Use domain events to capture state changes
160+
- **Repository Contract**: Define repositories per aggregate, not per entity
161+
- **Command Validation**: Validate commands at the handler level
162+
- **Error Handling**: Use result types or exceptions for domain errors
163+
164+
## See Also
165+
166+
- [Architecture Overview](/docs/architecture/overview)
167+
- [Getting Started](/docs/getting-started/quick-start)
168+
- [Advanced Patterns](/docs/advanced/cqrs-implementation)
169+

0 commit comments

Comments
 (0)