Skip to content

santypr/aspire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‰ Dragon Ball Character Library

A comprehensive full-stack application built with .NET Aspire, React.js, and Azure Container Apps, demonstrating modern cloud-native architecture with Dapr orchestration.

Dragon Ball Character Library

πŸš€ Overview

This project showcases how to build a modern, cloud-native application using:

  • .NET Aspire for orchestration and service discovery
  • React.js + TypeScript for the frontend
  • ASP.NET Core Web API for the backend
  • Azure Container Apps for deployment
  • Dapr for microservices integration
  • Azure Services (App Configuration, Key Vault, Blob Storage, SQL Database)

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   React.js      β”‚    β”‚  .NET Web API   β”‚    β”‚  Azure Services β”‚
β”‚   Frontend      │◄──►│   Backend       │◄──►│                 β”‚
β”‚                 β”‚    β”‚                 β”‚    β”‚ β€’ App Config    β”‚
β”‚ β€’ TypeScript    β”‚    β”‚ β€’ Entity FW     β”‚    β”‚ β€’ Key Vault     β”‚
β”‚ β€’ Modern UI     β”‚    β”‚ β€’ Swagger       β”‚    β”‚ β€’ Blob Storage  β”‚
β”‚ β€’ CRUD Ops      β”‚    β”‚ β€’ Health Checks β”‚    β”‚ β€’ SQL Database  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                        β”‚                        β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚ .NET Aspire     β”‚
                    β”‚ Orchestration   β”‚
                    β”‚                 β”‚
                    β”‚ β€’ Service Disc. β”‚
                    β”‚ β€’ Configuration β”‚
                    β”‚ β€’ Observability β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚ Azure Container β”‚
                    β”‚ Apps + Dapr     β”‚
                    β”‚                 β”‚
                    β”‚ β€’ Auto Scaling  β”‚
                    β”‚ β€’ Load Balancer β”‚
                    β”‚ β€’ Ingress       β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🎯 Features

Dragon Ball Character Management

  • βœ… Create new Dragon Ball characters
  • βœ… Read character details and library
  • βœ… Update character information
  • βœ… Delete characters from library

Character Attributes

  • Name: Character's name (e.g., Goku, Vegeta)
  • Race: Character's species (e.g., Saiyan, Namekian)
  • Planet: Home planet (e.g., Earth, Vegeta)
  • Transformation: Ultimate form (e.g., Ultra Instinct, Super Saiyan Blue)
  • Technique: Signature attack (e.g., Kamehameha, Final Flash)

Technical Features

  • 🎨 Modern UI: Responsive design with Dragon Ball theme
  • πŸ”’ Type Safety: Full TypeScript support
  • πŸ₯ Health Checks: Comprehensive monitoring
  • πŸ“Š API Documentation: Swagger/OpenAPI integration
  • πŸ”„ Real-time Updates: Live data synchronization
  • πŸ›‘οΈ Error Handling: Robust error management
  • πŸ“± Mobile Responsive: Works on all device sizes

πŸ› οΈ Technology Stack

Frontend

  • React.js 18 - UI Library
  • TypeScript - Type Safety
  • CSS3 - Modern Styling
  • Axios - HTTP Client
  • Create React App - Build Tool

Backend

  • .NET 8.0 - Runtime
  • ASP.NET Core - Web Framework
  • Entity Framework Core - ORM
  • Swagger - API Documentation
  • .NET Aspire - Orchestration

Azure Services

  • Azure Container Apps - Hosting
  • Azure App Configuration - Configuration Management
  • Azure Key Vault - Secrets Management
  • Azure Blob Storage - File Storage
  • Azure SQL Database - Data Storage

DevOps & Orchestration

  • Dapr - Microservices Runtime
  • Docker - Containerization
  • YAML - Configuration as Code
  • .NET Aspire - Local Development

🚦 Getting Started

Prerequisites

  • .NET 8.0 SDK
  • Node.js 18+ and npm
  • Docker Desktop
  • Visual Studio 2022 or VS Code

Local Development

  1. Clone the repository

    git clone <repository-url>
    cd aspire
  2. Restore .NET packages

    dotnet restore
  3. Install React dependencies

    cd DragonBallLibrary.Web
    npm install
    cd ..
  4. Run with Aspire

    cd DragonBallLibrary.AppHost
    dotnet run
  5. Access the applications

Manual Development (Alternative)

Terminal 1 - API Service:

cd DragonBallLibrary.ApiService
dotnet run

Terminal 2 - React Frontend:

cd DragonBallLibrary.Web
npm start

🌐 API Endpoints

Method Endpoint Description
GET /api/characters Get all characters
GET /api/characters/{id} Get character by ID
POST /api/characters Create new character
PUT /api/characters/{id} Update character
DELETE /api/characters/{id} Delete character
GET /health Health check
GET /swagger API documentation

Example Character JSON:

{
  "id": 1,
  "name": "Goku",
  "race": "Saiyan",
  "planet": "Earth",
  "transformation": "Ultra Instinct",
  "technique": "Kamehameha"
}

πŸ“¦ Azure Container Apps Deployment

1. Build Container Images

# API Service
docker build -f DragonBallLibrary.ApiService/Dockerfile -t dragonball-api .

# React Frontend
docker build -f DragonBallLibrary.Web/Dockerfile -t dragonball-web .

2. Push to Azure Container Registry

# Tag images
docker tag dragonball-api dragonballregistry.azurecr.io/dragonball-api:latest
docker tag dragonball-web dragonballregistry.azurecr.io/dragonball-web:latest

# Push images
docker push dragonballregistry.azurecr.io/dragonball-api:latest
docker push dragonballregistry.azurecr.io/dragonball-web:latest

3. Deploy to Azure Container Apps

# Create environment
az containerapp env create \
  --name dragonball-env \
  --resource-group dragonball-rg \
  --location eastus \
  --dapr-enabled

# Deploy API service
az containerapp create \
  --name dragonball-api \
  --resource-group dragonball-rg \
  --environment dragonball-env \
  --image dragonballregistry.azurecr.io/dragonball-api:latest \
  --target-port 8080 \
  --ingress external \
  --enable-dapr \
  --dapr-app-id apiservice

# Deploy Web frontend
az containerapp create \
  --name dragonball-web \
  --resource-group dragonball-rg \
  --environment dragonball-env \
  --image dragonballregistry.azurecr.io/dragonball-web:latest \
  --target-port 3000 \
  --ingress external

πŸ”§ Dapr Configuration

The project includes Dapr components for:

  • State Store: Azure SQL Database for character persistence
  • Secret Store: Azure Key Vault for secure configuration
  • Configuration: Azure App Configuration for dynamic settings
  • Bindings: Azure Blob Storage for character images

Component Files:

  • dapr/components/azure-sql.yaml - SQL Database state store
  • dapr/components/azure-keyvault.yaml - Key Vault secrets
  • dapr/components/azure-appconfig.yaml - App Configuration
  • dapr/components/azure-blob-storage.yaml - Blob Storage bindings

πŸ“Š Monitoring & Observability

Health Checks

  • Database Connectivity: Entity Framework health check
  • Azure Services: Connection validation
  • Application Health: Custom health endpoints

Logging

  • Structured Logging: JSON formatted logs
  • Azure Monitor: Application Insights integration
  • Dapr Observability: Built-in metrics and tracing

Aspire Dashboard

The Aspire dashboard provides:

  • Service discovery and status
  • Distributed tracing
  • Metrics and telemetry
  • Configuration management

πŸ“ Project Structure

β”œβ”€β”€ DragonBallLibrary.sln                 # Solution file
β”œβ”€β”€ DragonBallLibrary.AppHost/            # Aspire orchestration
β”‚   β”œβ”€β”€ AppHost.cs                        # Service definitions
β”‚   └── appsettings.json                  # Configuration
β”œβ”€β”€ DragonBallLibrary.ApiService/         # .NET Web API
β”‚   β”œβ”€β”€ Data/                            # Entity Framework context
β”‚   β”œβ”€β”€ Services/                        # Business services
β”‚   β”œβ”€β”€ Program.cs                       # API startup
β”‚   └── Dockerfile                       # Container config
β”œβ”€β”€ DragonBallLibrary.Web/               # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/                  # React components
β”‚   β”‚   β”œβ”€β”€ services/                    # API services
β”‚   β”‚   β”œβ”€β”€ types/                       # TypeScript types
β”‚   β”‚   └── App.tsx                      # Main component
β”‚   β”œβ”€β”€ package.json                     # Dependencies
β”‚   └── Dockerfile                       # Container config
β”œβ”€β”€ DragonBallLibrary.ServiceDefaults/   # Shared configuration
β”œβ”€β”€ dapr/                                # Dapr components
β”‚   └── components/                      # Component definitions
└── deploy/                              # Deployment configs
    └── azure-container-apps/            # Azure Container Apps YAML

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/new-character)
  3. Make your changes
  4. Run tests and ensure build passes
  5. Commit changes (git commit -am 'Add new character feature')
  6. Push to branch (git push origin feature/new-character)
  7. Create a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Dragon Ball franchise by Akira Toriyama
  • Microsoft .NET Aspire team
  • Azure Container Apps team
  • Dapr community
  • React.js community

Built with ❀️ for the Dragon Ball community and modern cloud-native development

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •