e4ebdec57a | ||
---|---|---|
.. | ||
.config | ||
deployment | ||
src | ||
.dockerignore | ||
.gitignore | ||
MusicStore.sln | ||
README-CloudFoundry.md | ||
README.md | ||
docker-compose.dcproj | ||
docker-compose.override.yml | ||
docker-compose.yml | ||
nuget.config | ||
runMusicStore.cmd | ||
runMusicStoreService.sh | ||
runMusicStoreUI.sh | ||
runOrderService.sh | ||
runShoppingCartService.sh | ||
tye.yaml |
README.md
Steeltoe MusicStore Sample Application
This repo tree contains a sample app illustrating how to use all of the Steeltoe components together in a ASP.NET Core application. This application is based on the ASP.NET Core reference app MusicStore provided by Microsoft.
In creating this application, we took the Microsoft reference application and broke it up into multiple independent services:
- MusicStoreUI - provides the UI to the MusicStore application and all of its services.
- MusicStoreService - provides a RESTful API to the MusicStore and its backend Music database.
- OrderService - provides a RESTful API for Order processing service and its backend Order database.
- ShoppingCartService - provides a RESTful api to a ShoppingCart service and its backend ShoppingCart database.
Note: The OrderService and ShoppingCartService are independent from the Music application and could be used in any other application requiring those basic services.
This application makes use of the following Steeltoe components:
- Spring Cloud Config Server Client for centralized application configuration
- Spring Cloud Eureka Server Client for service discovery
- Steeltoe Connector for connecting to MySql using EFCore
- Steeltoe CircuitBreaker to help prevent cascading failures from lower level service failures
- Steeltoe Management for enabling management actuator endpoints
- Spring Boot Admin for interacting with management actuators and viewing detailed service status
- Steeltoe Redis Connector to connect to a Redis cache for Session storage. Note: This is required if you want to scale the MusicStoreUI component to multiple instances.
- Steeltoe Redis DataProtection provider to the cause the DataProtection KeyRing to be stored in a Redis cache. Note: This is also required if you want to scale the MusicStoreUI component to multiple instances.
- Optionally uses Hystrix Dashboard for monitoring Circuit Breakers
Usage of Redis for Session storage DataProtection KeyRing storage is controlled by the environment variable USE_REDIS_CACHE
for MusicStoreUI. This variable is not set if you run the project directly or with Docker Compose, but is enabled when using Project Tye
Getting Started
- Clone the Samples repo. (i.e. git clone https://github.com/SteeltoeOSS/Samples)
Using Docker compose
cd Samples/MusicStore
docker-compose up
Using Project Tye
- Install Tye
cd Samples/MusicStore
tye run
- Browse to the local Tye dashboard to see the status of all the services and find the URL of the Music Store UI
Cloud Foundry
Other Platforms
Review the resources in the deployment folder for templates and scripts for deploying to other platforms like Kubernetes