Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Blog Example

This example provides a blog application implemented with Spine. It allows to create blogs, write blog posts and publish them on blog pages so that other people can read them.

Domain Model

Blog Bounded Context is composed of two aggregates (BlogAggregate and BlogPostAggregate) and one projection (BlogViewProjection).

Blog Aggregate

BlogAggregate manages the state of Blog model by handling CreateBlog command and reacting to BlogPostCreated event.

CreateBlog command is produced to create a new Blog entity. BlogPostCreated event is emitted to notify that a new BlogPost entity was created and it should be assigned to a Blog.

Blog Post Aggregate

BlogPostAggregate manages the state of BlogPost entity and handles CreateBlogPost and PublishBlogPost commands.

CreateBlogPost command is emitted to create a new BlogPost entity with a "draft" state in a Blog. PublishBlogPost command is used to move existing BlogPost from "draft" to "published" state and make it visible in BlogViewProjection.

Blog View Projection

BlogViewProjection represents the current state of a Blog and contains a list of published BlogPosts. It encapsulates the view that the reader should see when reading the Blog.


A local gRPC server receiving commands and queries for the Blog Bounded Context can be started with:

./gradlew :blog:run

By default, it listens on the port 50051. To start it on a different port, use:

/gradlew :blog:run -Dport=PORT_NUMBER
You can’t perform that action at this time.