Skip to content

managedcode/CodeUI

Repository files navigation

CodeUI

A modern .NET 9 application with Aspire orchestration, Blazor Server-side rendering, and Central Package Management.

πŸ—οΈ Project Structure

CodeUI/
β”œβ”€β”€ CodeUI.slnx                   # Modern XML-based solution file (.NET 9+)
β”œβ”€β”€ Directory.Packages.props      # Central Package Management configuration
β”œβ”€β”€ global.json                   # .NET 9 SDK enforcement
β”œβ”€β”€ CodeUI.AppHost/               # Aspire orchestration project
β”œβ”€β”€ CodeUI.Web/                   # Blazor Server application
β”œβ”€β”€ CodeUI.Core/                  # Core business logic and data models
β”œβ”€β”€ CodeUI.Orleans/               # Orleans grain definitions
β”œβ”€β”€ CodeUI.Tests/                 # Unit tests using xUnit
β”œβ”€β”€ CodeUI.AspireTests/           # Integration tests using Aspire testing framework
└── README.md                     # This file

πŸš€ Technology Stack

  • .NET 9.0 - Latest version of .NET with C# 13 language features
  • Aspire 9.4.1 - Latest .NET Aspire for cloud-native orchestration
  • Central Package Management - Unified dependency management across solution
  • Blazor Server - Server-side rendering with real-time updates
  • ASP.NET Core Identity - Built-in authentication and authorization
  • Entity Framework Core - Data access with SQLite database
  • Orleans - Virtual Actor Model for distributed applications

πŸ“‹ Prerequisites

⚠️ Important: You must install .NET 9 before you start!

Before running this application, ensure you have:

πŸ› οΈ Setup Instructions

1. Clone the Repository

git clone https://github.com/managedcode/CodeUI.git
cd CodeUI

2. Verify .NET 9 Installation

# Verify .NET 9 is installed
dotnet --version
# Should show 9.0.x or higher

# List installed SDKs
dotnet --list-sdks
# Should include 9.0.x

3. Install .NET Aspire Workload

dotnet workload update
dotnet workload install aspire

4. Restore Dependencies

# Use .slnx solution format for .NET 9
dotnet restore CodeUI.slnx

5. Build the Solution

# Use .slnx solution format for .NET 9
dotnet build CodeUI.slnx

πŸƒβ€β™‚οΈ Running the Application

Option 1: Run with Aspire Orchestration (Recommended)

dotnet run --project CodeUI.AppHost

This will:

  • Start the Aspire dashboard at http://localhost:18888
  • Launch the Blazor Server app
  • Provide monitoring and observability features

Option 2: Run Blazor Server App Directly

dotnet run --project CodeUI.Web

The application will be available at http://localhost:5225 (or the port shown in the console).

πŸ” Authentication

The application includes basic ASP.NET Core Identity authentication with:

  • Registration - Create new user accounts
  • Login/Logout - User authentication
  • In-Memory Database - For development (switch to SQLite/SQL Server/PostgreSQL for production)
  • Relaxed Password Policy - For development convenience

Default Settings:

  • Minimum password length: 6 characters
  • No special character requirements
  • No email confirmation required

πŸ—οΈ Project Details

CodeUI.AppHost

  • Purpose: Aspire orchestration host
  • Features: Service discovery, monitoring, distributed tracing
  • Dependencies: Aspire.Hosting

CodeUI.Web

  • Purpose: Blazor Server application
  • Features: Interactive server-side rendering, authentication, responsive UI
  • Dependencies: ASP.NET Core Identity, Entity Framework Core

CodeUI.Core

  • Purpose: Shared business logic and data models
  • Features: Entity Framework DbContext, Identity models
  • Dependencies: Entity Framework Core, ASP.NET Core Identity

CodeUI.Orleans

  • Purpose: Orleans grain definitions for distributed computing
  • Features: Virtual Actor Model interfaces
  • Dependencies: Microsoft.Orleans.Abstractions

πŸ§ͺ Development

Building

# Build entire solution using .slnx format
dotnet build CodeUI.slnx

# Build specific project
dotnet build CodeUI.Web

Testing

# Run all tests using .slnx format
dotnet test CodeUI.slnx

# Run tests with coverage
dotnet test CodeUI.slnx --collect:"XPlat Code Coverage"

Adding Migrations (when using a real database)

# Add migration
dotnet ef migrations add InitialCreate --project CodeUI.Core --startup-project CodeUI.Web

# Update database
dotnet ef database update --project CodeUI.Core --startup-project CodeUI.Web

πŸ“ Key Files

  • CodeUI.slnx - Modern XML-based solution file for .NET 9
  • Directory.Packages.props - Central Package Management configuration
  • global.json - .NET 9 SDK enforcement
  • CodeUI.AppHost/Program.cs - Aspire orchestration configuration
  • CodeUI.Web/Program.cs - Web application startup and services configuration
  • CodeUI.Core/Data/ApplicationDbContext.cs - Entity Framework database context
  • CodeUI.Core/Data/ApplicationUser.cs - Identity user model
  • CodeUI.Orleans/Grains/IHelloGrain.cs - Sample Orleans grain interface

πŸš€ Deployment

Self-Contained Deployment (Recommended)

CodeUI supports self-contained deployment for production environments without requiring Docker or external dependencies.

Quick Start

# Build for all platforms
./deployment/scripts/build-all.sh

# Manual build commands
dotnet publish CodeUI.Web -c Release -r win-x64 --self-contained -p:PublishSingleFile=true
dotnet publish CodeUI.Web -c Release -r linux-x64 --self-contained -p:PublishSingleFile=true
dotnet publish CodeUI.Web -c Release -r osx-x64 --self-contained -p:PublishSingleFile=true

Platform Installation

  • Windows: Run install-windows.ps1 as Administrator
  • Linux: Run sudo ./install-unix.sh
  • macOS: Run sudo ./install-unix.sh

Features

  • βœ… Single executable (~150MB per platform)
  • βœ… SQLite database for data persistence
  • βœ… Windows Service / systemd / LaunchDaemon auto-start
  • βœ… No external dependencies required
  • βœ… Production-ready configuration

See deployment/README.md for detailed instructions.

Traditional Deployment

For development or containerized environments:

  1. Update Database Provider: Change from In-Memory to SQL Server/PostgreSQL in Program.cs
  2. Configure Connection Strings: Update appsettings.json with production database
  3. Security Settings: Review and harden authentication settings
  4. Environment Variables: Configure for production environment

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature-name
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin feature/your-feature-name
  5. Submit a pull request

πŸ“„ License

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

πŸ“ž Support

For questions and support:


Happy Coding! πŸŽ‰

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors 3

  •  
  •  
  •