Enterprise Learning Management System con frontend Blazor WebAssembly e backend ASP.NET Core.
Versione: 1.6.0-dev Stack: .NET 8, Blazor WebAssembly, ASP.NET Core Web API, SQL Server, MongoDB, Redis Deploy: Kubernetes su Rocky Linux 10 con Podman Monitoring: Grafana + Prometheus con dashboards personalizzati
- Blazor WebAssembly con componenti interattivi e routing client-side
- VideoUpload Component con drag & drop, validazione file, progress tracking
- VideoPlayer Component con streaming MongoDB GridFS
- AI Chatbot Widget con Ollama (qwen2:0.5b) per supporto real-time
- Cookie Consent Wall GDPR-compliant con UI moderna
- Responsive Design mobile-first con breakpoints ottimizzati
- ASP.NET Core 8 con Minimal APIs pattern
- Endpoints Database-Driven: 50+ endpoint configurabili da SQL Server senza rebuild
- MongoDB GridFS: Video storage con GZip compression (20-40% riduzione dimensione)
- Automatic Database Migrations: EF Core migrations al startup (no downtime)
- JWT Authentication: Token-based auth con refresh token support
- Health Checks:
/healthendpoint per Kubernetes liveness/readiness probes
- SQL Server 2022: Dati relazionali (utenti, corsi, iscrizioni, chatbot messages)
- MongoDB 7.0: Video storage GridFS con compression, metadata indexing
- Redis 7: Cache distribuita, session storage
- Elasticsearch 8.11: Full-text search (configurato)
- Ollama LLM Server: Modello qwen2:0.5b (1.7s avg response time)
- Chatbot persistente: Conversazioni salvate in SQL Server
- Context-aware responses: History-based conversation flow
- Grafana Dashboards: "InsightLearn Platform Monitoring" con metriche real-time
- Pod CPU/Memory usage
- Network I/O statistics
- Pod health status
- Service availability
- Prometheus: Metrics collection con 30s scrape interval
- Service Watchdog: Auto-healing system che monitora e riavvia servizi failed
- Persistent Port-Forwarding: Script auto-restart per Grafana (http://localhost:3000)
- ✅ Security Patches Applied (2025-01-08):
- CVE-2024-43483 (HIGH) - Microsoft.Extensions.Caching.Memory patched
- CVE-2024-43485 (HIGH) - System.Text.Json patched
- Tutte le dipendenze transitive aggiornate
- GDPR Compliance: Cookie consent wall, privacy policy
- TLS/SSL: Certificati self-signed per dev, Let's Encrypt ready per prod
- JWT Secret Rotation: Configurabile via environment variables
- Kubernetes-Native: StatefulSets, Deployments, Services, ConfigMaps, Secrets
- Horizontal Pod Autoscaling: CPU/Memory-based scaling (min 1, max 5 replicas)
- Health Probes: Liveness, Readiness, Startup probes per tutti i servizi
- Rolling Updates: Zero-downtime deployments
- Podman Support: Native container runtime su Rocky Linux 10
- .NET 8 SDK
- Podman (su Rocky Linux) o Docker
- kubectl
- minikube
- Git
# 1. Clone repository
git clone https://github.com/marypas74/InsightLearn_WASM.git
cd InsightLearn_WASM
# 2. Setup iniziale (crea .env, build, avvia minikube, crea secrets)
./setup.sh
# 3. Modifica .env con password sicure
nano .env
# 4. Deploy su Kubernetes
./deploy.sh
# 5. Avvia port-forwards
./start-all.shDopo il deployment, i servizi sono accessibili su:
- Frontend WASM: http://localhost:8080 (o https://wasm.insightlearn.cloud via Cloudflare)
- Backend API: http://localhost:31081 (NodePort) o http://localhost:8081 (port-forward)
- API Health: http://localhost:31081/health
- Swagger: http://localhost:31081/swagger
- Grafana: http://localhost:3000 (port-forward persistente) o http://localhost:31300 (NodePort)
- Login:
admin/admin(cambiare al primo accesso) - Dashboard: http://localhost:3000/d/insightlearn-main/insightlearn-platform-monitoring
- Login:
- Prometheus: http://localhost:9091 (
⚠️ porta 9091, non 9090)
Per avere Grafana sempre accessibile su http://localhost:3000:
# Avvia port-forward persistente con auto-restart
./k8s/grafana-port-forward-persistent.sh &Per monitorare e riavviare automaticamente i servizi failed:
# Avvia watchdog in background
./k8s/service-watchdog.sh &
# Verifica log
tail -f /tmp/insightlearn-watchdog.logPer esporre l'applicazione su Internet con HTTPS:
# Installa cloudflared
# https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation
# Avvia tunnel
cloudflared tunnel run insightlearnAccesso pubblico: https://wasm.insightlearn.cloud
La solution InsightLearn.WASM.sln è organizzata in 4 progetti:
- InsightLearn.Core - Domain entities, interfaces, DTOs
- InsightLearn.Infrastructure - Repository implementations, DbContext
- InsightLearn.Application - ASP.NET Core Web API backend
- InsightLearn.WebAssembly - Blazor WebAssembly frontend
Tutti gli endpoint API sono memorizzati nel database (SystemEndpoints table) per permettere modifiche senza rebuild:
- Backend:
/api/system/endpointsritorna tutti gli endpoint attivi - Caching: MemoryCache con expiration 60 minuti
- Frontend:
EndpointConfigurationServicecarica da API con fallback a appsettings.json - Seed Data: 50+ endpoint predefiniti in 9 categorie
Categorie endpoint: Auth, Courses, Categories, Enrollments, Users, Dashboard, Reviews, Payments, Chat
| Servizio | Porta | Descrizione |
|---|---|---|
| WASM Frontend | 8080 | Blazor WebAssembly client |
| API Backend | 8081 | ASP.NET Core Web API |
| SQL Server | 1433 | Dati relazionali principali |
| MongoDB | 27017 | Video storage, chat messages |
| Redis | 6379 | Cache, sessioni |
| Ollama | 11434 | LLM server per chatbot |
# Copia .env.example
cp .env.example .env
# Modifica con password sicure
nano .env# Restore packages
dotnet restore InsightLearn.WASM.sln
# Build
dotnet build InsightLearn.WASM.sln -c Release# Rocky Linux con Podman
minikube config set rootless true
minikube start --driver=podman --container-runtime=cri-o \
--memory=14336 --cpus=6 \
--base-image=gcr.io/k8s-minikube/kicbase-rocky:v0.0.48
# Abilita Ingress
minikube addons enable ingress# Crea namespace
kubectl create namespace insightlearn
# Source environment variables
source .env
# Crea secrets
kubectl create secret generic sqlserver-secret \
--from-literal=SA_PASSWORD="${MSSQL_SA_PASSWORD}" \
-n insightlearn
kubectl create secret generic mongodb-secret \
--from-literal=MONGO_INITDB_ROOT_PASSWORD="${MONGO_PASSWORD}" \
-n insightlearn
kubectl create secret generic redis-secret \
--from-literal=REDIS_PASSWORD="${REDIS_PASSWORD}" \
-n insightlearn# Set minikube podman environment
eval $(minikube podman-env)
# Build API image
podman build -t localhost/insightlearn/api:latest -f Dockerfile .
# Load in minikube
minikube image load localhost/insightlearn/api:latest
# Deploy Kubernetes manifests
kubectl apply -f k8s/ -n insightlearn
# Wait for pods
kubectl wait --for=condition=ready pod -l app=sqlserver -n insightlearn --timeout=300s
kubectl wait --for=condition=ready pod -l app=api -n insightlearn --timeout=300s
kubectl wait --for=condition=ready pod -l component=wasm -n insightlearn --timeout=300s# WASM
kubectl port-forward -n insightlearn svc/wasm-blazor-webassembly-service 8080:80 &
# API
kubectl port-forward -n insightlearn svc/api-service 8081:80 &curl http://localhost:8081/healthcurl -X POST http://localhost:8081/api/chat/message \
-H "Content-Type: application/json" \
-d '{"message":"Ciao","contactEmail":"[email protected]"}'curl http://localhost:8081/api/system/endpoints | jqSe il frontend mostra errori dopo un deploy:
- Hard Refresh:
Ctrl + Shift + R(Windows/Linux) oCmd + Shift + R(Mac) - Clear Cache: F12 → Application → Clear storage
- Incognito Mode:
Ctrl + Shift + N
# Check pod status
kubectl get pods -n insightlearn
# Check pod logs
kubectl logs -n insightlearn <pod-name>
# Describe pod
kubectl describe pod -n insightlearn <pod-name>
# Restart deployment
kubectl rollout restart deployment/<deployment-name> -n insightlearn# Kill existing port-forwards
pkill -f "kubectl port-forward"
# Restart
./start-all.sh- CLAUDE.md - Guida per Claude Code con architettura dettagliata
- DEPLOYMENT-COMPLETE-GUIDE.md - Guida deployment completa
- DOCKER-COMPOSE-GUIDE.md - Docker Compose setup
- k8s/README.md - Kubernetes manifests
- NETWORK-REPORT-2025-11-06.md - Report network engineer
| Script | Descrizione |
|---|---|
| setup.sh | Setup iniziale completo (prerequisites, build, minikube, secrets) |
| deploy.sh | Deploy su Kubernetes (build images, apply manifests) |
| start-all.sh | Avvia port-forwards e mostra URL accesso |
- Admin Email: [email protected]
- Admin Password: da file
.env(ADMIN_PASSWORD)
- SQL Server: sa /
${MSSQL_SA_PASSWORD} - MongoDB: admin /
${MONGO_PASSWORD} - Redis:
${REDIS_PASSWORD}
InsightLearn_WASM/
├── src/
│ ├── InsightLearn.Core/ # Domain entities, interfaces
│ ├── InsightLearn.Infrastructure/ # Repositories, DbContext
│ ├── InsightLearn.Application/ # ASP.NET Core Web API
│ └── InsightLearn.WebAssembly/ # Blazor WASM frontend
├── k8s/ # Kubernetes manifests
├── nginx/ # Nginx config e certificati
├── docker-compose.yml # Stack completo
├── Dockerfile # API build
├── .env # Environment variables (non committare!)
└── InsightLearn.WASM.sln # Visual Studio solution
# Build solution
dotnet build InsightLearn.WASM.sln
# Build specific project
dotnet build src/InsightLearn.Application/InsightLearn.Application.csproj
# Publish API
dotnet publish src/InsightLearn.Application/InsightLearn.Application.csproj \
-c Release -o ./publish
# Run API locally
dotnet run --project src/InsightLearn.Application/InsightLearn.Application.csprojIl versioning è gestito in Directory.Build.props:
<VersionPrefix>1.4.22</VersionPrefix>
<VersionSuffix>dev</VersionSuffix>Versione finale: 1.4.22-dev
- Fork il repository
- Crea un branch per la feature:
git checkout -b feature/amazing-feature - Commit le modifiche:
git commit -m 'feat: Add amazing feature' - Push al branch:
git push origin feature/amazing-feature - Apri una Pull Request
Proprietario: [email protected]
- GitHub: https://github.com/marypas74/InsightLearn_WASM
- Issues: https://github.com/marypas74/InsightLearn_WASM/issues
- Maintainer: [email protected]