Overview
Silky provides official sample projects that demonstrate how to build production-oriented microservice applications using the framework.
Sample: Microservice E-Commerce
A complete e-commerce microservice sample at: https://github.com/liuhll/silky.sample
Architecture
The sample includes the following services:
| Service | Description |
|---|---|
GatewayHost | API gateway, external HTTP entry point |
AccountService | User accounts, balance management |
OrderService | Order creation, TCC distributed transaction coordinator |
InventoryService | Stock reservation and deduction (TCC participant) |
IdentityService | JWT authentication and authorization |
Technology Stack
- Registry: Zookeeper (Docker Compose included)
- Cache: Redis
- Database: MySQL (via EFCore)
- Transactions: TCC (Silky.Transaction.Tcc)
- Logging: Serilog → Elasticsearch
- Tracing: SkyAPM
- Documentation: Swagger
Quick Start
git clone https://github.com/liuhll/silky.sample.git
cd silky.sample
# Start infrastructure (Zookeeper, Redis, MySQL, etc.)
docker-compose -f docker-compose/docker-compose.yml up -d
# Start services (example: OrderService)
cd src/OrderService/OrderService.Host
dotnet run
Repository Samples
The framework repository (d:\open-source\silky) contains minimal samples under samples/:
samples/
quickstart/ # Minimal two-service + gateway project
microservices/ # Multi-service with EFCore and Redis
Run the Quickstart Sample
cd samples/quickstart
docker-compose up -d # start Zookeeper and Redis
cd NormalHost
dotnet run # start the business service
cd ../GatewayHost
dotnet run # start the gateway
Open http://localhost:5000/swagger to see the aggregated Swagger docs.
Learning Path
For framework newcomers, we recommend this order:
- Quick Start — understand basic concepts
- App Services & Service Entries — service definition
- RPC Communication — inter-service calls
- Service Governance — resilience policies
- Explore the full sample for distributed transactions, caching, and tracing
