Skip to content

petr-rudzenkou/eShop

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

357 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Getting started

1. Local Dev Environment

Clone the eShop repository: https://github.com/petr-rudzenkou/eShop

Prerequisites

  1. .NET 9
  2. Aspire CLI
    dotnet tool install -g Aspire.Cli --prerelease
  3. OCI compliant container runtime:
  4. Integrated Developer Environment (IDE) or code editor:

2. Exploring Runtime Architecture

eShop Reference Application

eShop Reference Application architecture diagram

The application consists of:

  • 2 Frontends
  • 5 APIs
  • 2 Processors
  • 4 Databases
  • Cache
  • Event Bus
  • Monitoring system

Running the Project

  1. Start the application by running:
aspire run
  1. Watch the console output for initialization messages

  2. Look for the dashboard URL in the console output (typically something like https://localhost:19888/login?t=4f08cd9d2bfc2a0ee873fdb8c7bf11e6)

  3. Open the Aspire dashboard in your browser to examine the application structure, logs, traces.

  4. Check the running containers:

docker ps

Container list

Troubleshooting Common Issues

Unhealthy resources

Give some time for the services to warm-up

SSL Certificate Issues

If you encounter SSL/TLS connection errors, run:

dotnet dev-certs https --trust

PUBLISHING FAILED: An error occurred trying to start process 'docker' with working directory

This error occurs if you're using podman as the container runtime. By default Aspire uses docker. You'll need to tell Aspire to use posman:

aspire run ASPIRE_CONTAINER_RUNTIME=podman

Port Conflicts

If you experience port conflicts:

  1. Stop all running Docker containers:
docker stop $(docker ps -q)
  1. Re-run the AppHost project

Note

Make sure you've completed all the setup requirements from the Local Dev Environment guide before running the project.

3. Publishing and Deployement

1. Aspire CLI

The Aspire Command Line Interface will provide enhanced capabilities for:

Features

  • Project scaffolding and templates
  • Local development orchestration
  • Enhanced Publish/Deploy Semantics
  • Support for generation of IaC artifacts for multiple providers (Bicep, K8S, Docker Compose)
  • Broader deployment targets, including non-Azure environments.

How to install?

dotnet tool install -g Aspire.Cli --prerelease

1. Azure

Publish

Add Azure Container App environment to your AppHost project using the AddAzureContainerAppEnvironment method:

var builder = DistributedApplication.CreateBuilder(args);
builder.AddAzureContainerAppEnvironment("aca-env");

Generate Bicep manifests from your Aspire application:

aspire publish -o aca-artifacts

Review the contents of the aca-artifacts folder, which will include Bicep templates for all application resources.

Deploy (Optional)

Azure CLI should be installed to perform this step.

az login

Deploy Aspire application to Azure:

aspire deploy

2. Kubernetes

Publish

Add a Kubernetes environment to your AppHost project using the AddKubernetesEnvironment method:

var builder = DistributedApplication.CreateBuilder(args);
builder.AddKubernetesEnvironment("k8s");

Generate Kubernetes manifests from your Aspire application:

aspire publish -o k8s-artifacts

Review the contents of the k8s-artifacts folder, which will include a Helm chart with templates for all application containers.

3. Docker Compose

Publish

Add a Docker Compose environment to your AppHost project using the AddDockerComposeEnvironment method:

var builder = DistributedApplication.CreateBuilder(args);
builder.AddDockerComposeEnvironment("docker-compose");

Generate docker compose file from your Aspire application:

aspire publish -o docker-compose-artifacts

Review the contents of the docker-compose-artifacts folder, which will include docker-compose file defining all application containers.

Troubleshooting Common Issues

PUBLISHING FAILED: An error occurred trying to start process 'docker' with working directory

This error occurs if you're using podman as the container runtime. By default Aspire uses docker. You'll need to tell Aspire to use posman:

aspire publish -o docker-compose-artifacts ASPIRE_CONTAINER_RUNTIME=podman

Support Resources

About

A reference .NET application implementing an eCommerce site

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C# 84.1%
  • HTML 7.7%
  • CSS 7.1%
  • Other 1.1%