This guide explains the recommended development workflow for contributing to the "Copilot That Jawn" project.
- .NET SDK: Version 9.0 or higher
- IDE: Visual Studio 2022+ or Visual Studio Code with C# extensions
- Git: For version control
-
Clone the repository:
git clone https://github.com/yourusername/CopilotThatJawn.git cd CopilotThatJawn -
Restore packages:
dotnet restore
-
Run the application using .NET Aspire:
dotnet run --project AppHost
-
Access the Aspire dashboard at the URL shown in the console output (typically
https://localhost:15888) -
Access the main application at
https://localhost:5001(or the port shown in the Aspire dashboard)
The project uses .NET Aspire for service orchestration, which manages Redis, Azure Storage, and the web application.
The Aspire dashboard provides:
- Service Status: Monitor all running services (Web, Redis, Azure Storage)
- Logs: Centralized logging from all services
- Metrics: Performance metrics and health checks
- Resource Management: View connection strings and service endpoints
Redis runs automatically through Aspire orchestration:
# Start the full application stack (includes Redis)
dotnet run --project AppHost
# Redis will be available at localhost:6379 (default port)
# RedisInsight dashboard available through Aspire dashboardThe application provides several ways to interact with the Redis cache:
- Through the Application: Content is automatically cached during normal operation
- RedisInsight: Visual Redis management tool accessible through Aspire dashboard
- Cache Refresh API: Manual cache refresh endpoint
# Refresh cache via API (requires API key in production)
curl -X POST https://localhost:5001/api/cache/refresh \
-H "X-API-Key: your-api-key"- Aspire Dashboard: View Redis logs and metrics
- RedisInsight: Inspect keys, values, and performance
- Application Logs: ContentService logs cache hits/misses
The project is configured to take advantage of ASP.NET Core's hot reload capabilities through .NET Aspire:
- Automatic Rebuilding: When you modify C# files, the application automatically rebuilds
- Browser Refresh: Changes to Razor pages, CSS, and JavaScript trigger automatic browser refresh
- Content Updates: Adding or modifying content files will be reflected in the application
- Service Orchestration: All services (Web, Redis, Storage) are managed together
dotnet run --project AppHost: Start the full application stackdotnet watch run --project AppHost: Start with enhanced hot reload monitoringdotnet test: Run tests for the entire solution
The Aspire orchestration ensures proper startup order:
- Redis container starts and becomes ready
- Azure Storage emulator starts and becomes ready
- Web application starts and connects to dependencies
- Controllers:
{Feature}Controller.cs(e.g.,ToolsController.cs) - Models:
{Entity}Model.cs,{Entity}ViewModel.cs,{Entity}Dto.cs - Services:
I{Service}Service.csand{Service}Service.cs - Pages: Descriptive names matching URL structure
- CSS Classes: BEM methodology (block__element--modifier)
- Use dependency injection for services
- Follow async/await patterns for I/O operations
- Implement proper error handling and logging
- Use strongly-typed views and models
- Keep controllers and page models slim, move business logic to services
- Create: Add new content files to the appropriate directory in
Content/ - Test: Run the application and verify the content appears correctly
- Refine: Update content based on how it looks on the site
- Commit: Commit changes to version control
- Plan: Define the feature requirements and scope
- Structure: Decide where the feature fits in the application architecture
- Implement: Develop the feature with appropriate tests
- Document: Update documentation to reflect the new feature
- Test: Verify the feature works as expected
- Commit: Commit the changes to version control
The application is designed to be deployed to Azure App Service:
- Build:
dotnet publish -c Release - Deploy: Use Azure DevOps, GitHub Actions, or manual deployment to Azure
- Verify: Test the deployed application to ensure it works correctly
- Unit Tests: Test business logic and services in isolation
- Integration Tests: Test controllers and data access components together
- End-to-End Tests: Test critical user workflows
- Performance Testing: Ensure content-heavy pages load quickly