Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,15 @@ NLWebNet/
│ ├── Endpoints/ # Minimal API endpoints (/ask, /mcp)
│ ├── MCP/ # Model Context Protocol integration
│ ├── Extensions/ # DI and middleware extensions
│ ├── Middleware/ # Request processing middleware
│ ├── Middleware/ # ASP.NET Core middleware
│ └── Extensions/ # Dependency injection extensions
│ └── Middleware/ # Request processing middleware
├── samples/ # 🎯 Sample applications and usage examples
│ ├── Demo/ # 🎮 .NET 9 Blazor Web App demo application
│ └── AspireHost/ # 🏗️ .NET Aspire orchestration host
├── Components/ # Modern Blazor components
├── Layout/ # Layout components (MainLayout, etc.)
│ └── Pages/ # Page components (Home, NLWebDemo, Error)
│ ├── wwwroot/ # Static assets (app.css, favicon, etc.)
│ └── Properties/ # Launch settings and configuration
├── deployment/ # 🚀 Deployment and infrastructure files
│ ├── azure/ # Azure deployment (Bicep templates)
── kubernetes/ # Kubernetes manifests and Helm charts
│ ├── docker/ # Docker and Docker Compose files
│ └── scripts/ # Deployment and validation scripts
├── doc/ # 📚 Documentation
└── tests/ # 🧪 Unit and integration tests
└── NLWebNet.Tests/ # 📋 xUnit test project
Expand Down Expand Up @@ -411,28 +409,28 @@ NLWebNet supports multiple deployment options for different environments:
# Quick start with Docker Compose
git clone https://github.com/jongalloway/NLWebNet.git
cd NLWebNet
docker-compose up --build
cd deployment/docker && docker-compose up --build
```

### ☁️ Azure Cloud Deployment
```bash
# Deploy to Azure Container Apps
./scripts/deploy/deploy-azure.sh -g myResourceGroup -t container-apps
./deployment/scripts/deploy/deploy-azure.sh -g myResourceGroup -t container-apps

# Deploy to Azure App Service
./scripts/deploy/deploy-azure.sh -g myResourceGroup -t app-service
./deployment/scripts/deploy/deploy-azure.sh -g myResourceGroup -t app-service
```

### ⚙️ Kubernetes Deployment
```bash
# Deploy to any Kubernetes cluster
kubectl apply -f k8s/
kubectl apply -f deployment/kubernetes/manifests/
```

### 📦 Container Registry
Pre-built images available soon. For now, build locally:
```bash
./scripts/deploy/build-docker.sh -t latest
./deployment/scripts/deploy/build-docker.sh -t latest
```

📖 **[Complete Deployment Guide](doc/deployment/README.md)** - Comprehensive instructions for all deployment scenarios.
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions docker-compose.yml → deployment/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ services:
# NLWebNet Demo Application
nlwebnet-demo:
build:
context: .
dockerfile: Dockerfile
context: ../../
dockerfile: deployment/docker/Dockerfile
target: final
container_name: nlwebnet-demo
ports:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ set -e # Exit on any error
IMAGE_NAME="nlwebnet-demo"
DEFAULT_TAG="latest"
REGISTRY=""
DOCKERFILE="Dockerfile"
DOCKERFILE="deployment/docker/Dockerfile"
BUILD_CONTEXT="../../../"

# Colors for output
RED='\033[0;31m'
Expand Down Expand Up @@ -95,8 +96,8 @@ print_status "Image name: $FULL_IMAGE_NAME"
print_status "Dockerfile: $DOCKERFILE"

# Check if Dockerfile exists
if [[ ! -f "$DOCKERFILE" ]]; then
print_error "Dockerfile not found: $DOCKERFILE"
if [[ ! -f "$BUILD_CONTEXT$DOCKERFILE" ]]; then
print_error "Dockerfile not found: $BUILD_CONTEXT$DOCKERFILE"
exit 1
fi

Expand All @@ -107,7 +108,7 @@ if [[ "$NO_CACHE" == true ]]; then
BUILD_CMD="$BUILD_CMD --no-cache"
fi

BUILD_CMD="$BUILD_CMD -t $FULL_IMAGE_NAME -f $DOCKERFILE ."
BUILD_CMD="$BUILD_CMD -t $FULL_IMAGE_NAME -f $DOCKERFILE $BUILD_CONTEXT"

print_status "Running: $BUILD_CMD"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ while [[ $# -gt 0 ]]; do
-t|--template)
case "$2" in
container-apps)
TEMPLATE_FILE="deploy/azure/container-apps.bicep"
PARAMETERS_FILE="deploy/azure/container-apps.parameters.json"
TEMPLATE_FILE="../../../deployment/azure/container-apps.bicep"
PARAMETERS_FILE="../../../deployment/azure/container-apps.parameters.json"
;;
app-service)
TEMPLATE_FILE="deploy/azure/app-service.bicep"
TEMPLATE_FILE="../../../deployment/azure/app-service.bicep"
;;
*)
print_error "Invalid template: $2. Use 'container-apps' or 'app-service'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ function Test-Command($command) {

# 1. Build and Test
Write-Host "`n📦 Step 1: Building and Testing..." -ForegroundColor Yellow
dotnet build src/NLWebNet --configuration Release
dotnet build ../../src/NLWebNet --configuration Release
if ($LASTEXITCODE -ne 0) { throw "Build failed" }

dotnet test --configuration Release --no-build
if ($LASTEXITCODE -ne 0) { throw "Tests failed" }

# 2. Create Package
Write-Host "`n📦 Step 2: Creating Package..." -ForegroundColor Yellow
$outputDir = ".\packages-validation"
$outputDir = "..\..\packages-validation"
Remove-Item $outputDir -Recurse -Force -ErrorAction SilentlyContinue
dotnet pack src/NLWebNet --configuration Release --output $outputDir
dotnet pack ../../src/NLWebNet --configuration Release --output $outputDir
if ($LASTEXITCODE -ne 0) { throw "Pack failed" }

# Find the created package
Expand Down Expand Up @@ -121,7 +121,7 @@ Write-Host "`n📦 Step 5: Analyzing Dependencies..." -ForegroundColor Yellow
if (-not $SkipDependencyCheck) {
# Check for vulnerable dependencies
Write-Host "Checking for vulnerable dependencies..."
$vulnerableOutput = dotnet list src/NLWebNet package --vulnerable --include-transitive 2>&1
$vulnerableOutput = dotnet list ../../src/NLWebNet package --vulnerable --include-transitive 2>&1
if ($vulnerableOutput -match "has the following vulnerable packages") {
Write-Host "❌ Vulnerable dependencies found:" -ForegroundColor Red
Write-Host $vulnerableOutput -ForegroundColor Red
Expand All @@ -132,7 +132,7 @@ if (-not $SkipDependencyCheck) {

# Check for deprecated dependencies
Write-Host "Checking for deprecated dependencies..."
$deprecatedOutput = dotnet list src/NLWebNet package --deprecated 2>&1
$deprecatedOutput = dotnet list ../../src/NLWebNet package --deprecated 2>&1
if ($deprecatedOutput -match "has the following deprecated packages") {
Write-Host "⚠️ Deprecated dependencies found:" -ForegroundColor Yellow
Write-Host $deprecatedOutput -ForegroundColor Yellow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ echo "====================================="

# 1. Build and Test
echo -e "\n📦 Step 1: Building and Testing..."
dotnet build src/NLWebNet --configuration Release
dotnet build ../../src/NLWebNet --configuration Release
dotnet test --configuration Release --no-build

# 2. Create Package
echo -e "\n📦 Step 2: Creating Package..."
OUTPUT_DIR="./packages-validation"
OUTPUT_DIR="../../packages-validation"
rm -rf "$OUTPUT_DIR"
dotnet pack src/NLWebNet --configuration Release --output "$OUTPUT_DIR"
dotnet pack ../../src/NLWebNet --configuration Release --output "$OUTPUT_DIR"

# Find the created package
NUPKG_FILE=$(find "$OUTPUT_DIR" -name "*.nupkg" ! -name "*.symbols.nupkg" | head -n 1)
Expand Down Expand Up @@ -73,18 +73,18 @@ fi
# 5. Dependency Analysis
echo -e "\n📦 Step 5: Analyzing Dependencies..."
echo "Checking for vulnerable dependencies..."
if dotnet list src/NLWebNet package --vulnerable --include-transitive 2>&1 | grep -q "has the following vulnerable packages"; then
if dotnet list ../../src/NLWebNet package --vulnerable --include-transitive 2>&1 | grep -q "has the following vulnerable packages"; then
echo "❌ Vulnerable dependencies found"
dotnet list src/NLWebNet package --vulnerable --include-transitive
dotnet list ../../src/NLWebNet package --vulnerable --include-transitive
exit 1
else
echo "✅ No vulnerable dependencies found"
fi

echo "Checking for deprecated dependencies..."
if dotnet list src/NLWebNet package --deprecated 2>&1 | grep -q "has the following deprecated packages"; then
if dotnet list ../../src/NLWebNet package --deprecated 2>&1 | grep -q "has the following deprecated packages"; then
echo "⚠️ Deprecated dependencies found"
dotnet list src/NLWebNet package --deprecated
dotnet list ../../src/NLWebNet package --deprecated
else
echo "✅ No deprecated dependencies found"
fi
Expand All @@ -99,7 +99,7 @@ dotnet new web -n TestConsumer -o "$TEST_CONSUMER_DIR" --force
cd "$TEST_CONSUMER_DIR"

# Add the local package
dotnet add package NLWebNet --source ../packages-validation --prerelease --prerelease
dotnet add package NLWebNet --source ../../packages-validation --prerelease --prerelease

# Create test Program.cs
cat > Program.cs << 'EOF'
Expand Down
34 changes: 17 additions & 17 deletions doc/deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ git clone https://github.com/jongalloway/NLWebNet.git
cd NLWebNet

# Run with Docker Compose
docker-compose up --build
cd deployment/docker && docker-compose up --build

# Or run locally (requires .NET 9)
cd samples/Demo
Expand All @@ -46,13 +46,13 @@ Use the provided build script for easy Docker image creation:

```bash
# Build with default settings
./scripts/deploy/build-docker.sh
./deployment/scripts/deploy/build-docker.sh

# Build with specific tag
./scripts/deploy/build-docker.sh -t v1.0.0
./deployment/scripts/deploy/build-docker.sh -t v1.0.0

# Build and push to registry
./scripts/deploy/build-docker.sh -t v1.0.0 -r myregistry.azurecr.io -p
./deployment/scripts/deploy/build-docker.sh -t v1.0.0 -r myregistry.azurecr.io -p
```

### Manual Docker Build
Expand All @@ -75,7 +75,7 @@ For local development with dependencies:

```bash
# Start all services
docker-compose up -d
cd deployment/docker && docker-compose up -d

# View logs
docker-compose logs -f nlwebnet-demo
Expand Down Expand Up @@ -105,7 +105,7 @@ Key environment variables for Docker deployment:

```bash
# Deploy all resources
kubectl apply -f k8s/
kubectl apply -f deployment/kubernetes/manifests/

# Check deployment status
kubectl get pods -l app=nlwebnet-demo
Expand All @@ -129,14 +129,14 @@ kubectl get ingress
--from-literal=azure-search-api-key="your-key"

# Apply configuration
kubectl apply -f k8s/configmap.yaml
kubectl apply -f deployment/kubernetes/manifests/configmap.yaml
```

3. **Deploy application**:
```bash
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
kubectl apply -f k8s/ingress.yaml
kubectl apply -f deployment/kubernetes/manifests/deployment.yaml
kubectl apply -f deployment/kubernetes/manifests/service.yaml
kubectl apply -f deployment/kubernetes/manifests/ingress.yaml
```

4. **Verify deployment**:
Expand Down Expand Up @@ -185,25 +185,25 @@ az account set --subscription "your-subscription-id"

```bash
# Deploy using script
./scripts/deploy/deploy-azure.sh -g myResourceGroup -t container-apps
./deployment/scripts/deploy/deploy-azure.sh -g myResourceGroup -t container-apps

# Or manual deployment
az deployment group create \
--resource-group myResourceGroup \
--template-file deploy/azure/container-apps.bicep \
--parameters @deploy/azure/container-apps.parameters.json
--template-file deployment/azure/container-apps.bicep \
--parameters @deployment/azure/container-apps.parameters.json
```

### App Service Deployment

```bash
# Deploy to App Service
./scripts/deploy/deploy-azure.sh -g myResourceGroup -t app-service -e prod
./deployment/scripts/deploy/deploy-azure.sh -g myResourceGroup -t app-service -e prod

# Manual deployment
az deployment group create \
--resource-group myResourceGroup \
--template-file deploy/azure/app-service.bicep \
--template-file deployment/azure/app-service.bicep \
--parameters appName=nlwebnet environment=prod
```

Expand All @@ -225,7 +225,7 @@ az deployment group create \

3. **Deploy application**:
```bash
kubectl apply -f k8s/
kubectl apply -f deployment/kubernetes/manifests/
```

## Production Considerations
Expand Down Expand Up @@ -323,7 +323,7 @@ kubectl get events --sort-by=.metadata.creationTimestamp

```bash
# Docker logs
docker-compose logs -f nlwebnet-demo
cd deployment/docker && docker-compose logs -f nlwebnet-demo

# Kubernetes logs
kubectl logs -f -l app=nlwebnet-demo
Expand Down
2 changes: 1 addition & 1 deletion doc/package-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This guide outlines the comprehensive validation process for the NLWebNet NuGet

### Linux/macOS (Bash)
```bash
./scripts/validate-package.sh
./deployment/scripts/validate-package.sh
```

## 📋 Manual Validation Checklist
Expand Down
2 changes: 1 addition & 1 deletion doc/todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ Comprehensive testing and validation infrastructure has been implemented coverin
- [x] ✅ **VALIDATED**: Minimal API endpoint registration works correctly
- [x] **Production Readiness**:
- [x] ✅ **RESOLVED**: ModelContextProtocol prerelease dependency - NLWebNet marked as 0.1.0-alpha.1 - [x] ✅ **Final package validation before publication**:
- [x] ✅ Run comprehensive validation script (`scripts/validate-package.ps1`) - ALL CHECKS PASSED
- [x] ✅ Run comprehensive validation script (`deployment/scripts/validate-package.ps1`) - ALL CHECKS PASSED
- [x] ✅ Verify package content and assembly metadata - Confirmed correct structure
- [x] ✅ Confirm no vulnerable or deprecated dependencies - Clean
- [x] ✅ Test integration with fresh consumer project - Successful compilation
Expand Down