https://github.com/managedcode/codeui
https://github.com/managedcode/codeui
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/managedcode/codeui
- Owner: managedcode
- License: mit
- Created: 2025-08-31T15:48:41.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-08-31T18:14:12.000Z (5 months ago)
- Last Synced: 2025-08-31T18:22:15.768Z (5 months ago)
- Language: CSS
- Size: 134 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
- **[.NET 9.0 SDK](https://dotnet.microsoft.com/download/dotnet/9.0)** - **REQUIRED**
- [Docker](https://docs.docker.com/get-docker/) (for Aspire orchestration)
- [Visual Studio 2022](https://visualstudio.microsoft.com/) or [VS Code](https://code.visualstudio.com/) (recommended)
## ๐ ๏ธ Setup Instructions
### 1. Clone the Repository
```bash
git clone https://github.com/managedcode/CodeUI.git
cd CodeUI
```
### 2. Verify .NET 9 Installation
```bash
# 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
```bash
dotnet workload update
dotnet workload install aspire
```
### 4. Restore Dependencies
```bash
# Use .slnx solution format for .NET 9
dotnet restore CodeUI.slnx
```
### 5. Build the Solution
```bash
# Use .slnx solution format for .NET 9
dotnet build CodeUI.slnx
```
## ๐โโ๏ธ Running the Application
### Option 1: Run with Aspire Orchestration (Recommended)
```bash
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
```bash
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
```bash
# Build entire solution using .slnx format
dotnet build CodeUI.slnx
# Build specific project
dotnet build CodeUI.Web
```
### Testing
```bash
# 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)
```bash
# 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
```bash
# 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](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](LICENSE) file for details.
## ๐ Support
For questions and support:
- Create an issue in the GitHub repository
- Check existing documentation and README
- Review the [.NET Aspire documentation](https://learn.microsoft.com/en-us/dotnet/aspire/)
---
**Happy Coding! ๐**