Coalesce Framework

website·Indexed 33 days ago

https://coalesce.intellitect.com

A code generation framework by IntelliTect designed to build modern web applications. It features a C# attribute-based modeling system (including IntelliTect.Coalesce.DataAnnotations), a Vue and Vuetify-based frontend stack with pre-built admin pages and components, and support for Model Context Protocol (MCP) servers for AI assistant interaction.

Tokens
69.1K
Snippets
279
Records
475
Agent score
58%

What's inside Coalesce

  1. Overview of Coalesce ViewModels

    Coalesce generates TypeScript ViewModels in viewmodels.g.ts that provide stateful wrappers around CRUD Models and Services. They handle common UI concerns such as loading, saving, validation, and auto-save functionality. They serve as the primary interface between Vue components and backend APIs, featuring automatic dirty tracking on property changes and API callers with loading/error states.

    Generated types include:

    • <TypeName>ViewModel for each CRUD Model.
    • ListViewModel for each CRUD Model.
    • ServiceViewModel for each Service.
  2. Overview of the Coalesce Vue stack architecture

    The Coalesce Vue stack is designed for building modern web applications using Vite, ES Modules, and Vue.js. It supports Single Page Applications (SPAs) and integrates with component frameworks like Vuetify. The stack relies on the coalesce-vue NPM package for core functionality, which should be kept in sync with the corresponding IntelliTect.Coalesce NuGet packages.
  3. Overview of the Coalesce framework

    Coalesce is a full-stack meta-framework for ASP.NET Core and Vue that automates the creation of the "plumbing" between domain models and the user interface. It generates API controllers, DTOs, TypeScript models, and API clients based on Entity Framework data models. Key features include auto-generated ViewModels with dirty tracking and loading states, declarative role-based and row-level security, and ready-made Vue components for data-driven UIs.
  4. Overview of the Coalesce meta-framework

    Coalesce is a full-stack meta-framework created by IntelliTect for ASP.NET Core and Vue.js. It automates the creation of the API layer, TypeScript clients, ViewModels, and admin UI, allowing developers to focus on data models, business logic, and custom UI pages.

    Technical Foundation:

    • Backend: C#, .NET, and ASP.NET Core.
    • Database Interface: Entity Framework (EF Core) is used to generate extensible CRUD APIs.
    • Frontend Language: TypeScript for type safety and Intellisense.
    • Frontend Framework: Vue.js for data binding and interactivity.
    • Build Tooling: Vite for fast single-page application development, integrated with ASP.NET Core for streamlined local development (e.g., via dotnet run).
  5. Overview of c-loader-status component

    The c-loader-status component provides a standardized way to display progress and error information for API Callers. It uses a Vuetify v-progress-linear for progress and v-alert for error and success messages, with smooth transitions between states. It is recommended for any API Caller that lacks its own error handling to ensure users are notified of failures.
  6. Overview of CRUD Model capabilities in Coalesce

    Coalesce provides three methods for defining models that support Create, Read, Update, and Delete (CRUD) operations: EF Entity Models, Standalone Entities, and Custom DTOs. All three model types automatically provide the following features:

    • Generated API Controllers: Includes /get, /list, /count, and /save endpoints (Note: /bulkSave is not available for Standalone Entities).
    • Frontend Integration: Generated TypeScript ViewModels and ListViewModels.
    • Extensibility: Support for C# Property Types, field-level Attributes, and Custom Methods for non-CRUD operations.
    • Customization: Data Sources for read operations and Behaviors for create/update/delete operations.
    • Tooling: Generated Semantic Kernel plugins for CRUD operations and full CRUD support in Admin pages.
  7. Overview of Coalesce Admin Pages

    Coalesce provides pre-built admin pages that offer complete CRUD (Create, Read, Update, Delete) functionality for data models. These pages automatically adapt to the data model structure and are powered by the c-admin-table-page and c-admin-editor-page components.
  8. Understand the purpose of the IncludeTree

    In Coalesce, an IncludeTree is used when mapping POCO objects from EF Core queries to DTOs. It defines which relationships to follow and the depth of the traversal. Without an IncludeTree, Coalesce maps the entire reachable object graph, which can lead to exponential growth in the serialized JSON response (O(n^2) depth and Ω(n!) size) due to circular or deep relationships in many-to-many mappings.
  9. Install and use Coalesce C# Roslyn analyzers

    Coalesce provides a set of C# Roslyn analyzers to enforce best practices and detect common issues during development. These analyzers run within the IDE and during the build process, issuing warnings or errors when problems are detected. The analyzers are distributed via the IntelliTect.Coalesce.Analyzer NuGet package and are automatically included when referencing the main Coalesce packages.
  10. Map a Coalesce security overview endpoint

    The MapCoalesceSecurityOverview extension method maps a route to an HTML page that provides a comprehensive overview of Coalesce security rules. The page displays class-level security attributes ([Read], [Create], [Edit], [Delete]), property-level restrictions, custom data sources, method security rules, and service endpoints.
    // Maps the security overview to /coalesce-security and restricts access to Admin role
    app.MapCoalesceSecurityOverview("coalesce-security")
        .RequireAuthorization(new AuthorizeAttribute { Roles = "Admin" });
  11. Understand the Coalesce project structure

    A Coalesce project is divided into three primary project types:

    1. AppHost Project: A .NET Aspire orchestration project used as the startup project for development.
    2. Data Project: Contains entity models, services, and custom backend code. This project serves as the input for Coalesce's code generation.
    3. Web Project: An ASP.NET Core application that houses the generated outputs from Coalesce and the Vue frontend.

    Key Web Project directories:

    • /src: Frontend source files (CSS/SCSS, TypeScript, Vue SFCs).
    • /public: Static assets served directly.
    • /wwwroot: Target for Vite's compiled output (excluded from git).
    • Program.cs: ASP.NET Core entry point.
    • ProgramServiceDefaults.cs: .NET Aspire Service Defaults (Open Telemetry, health checks, resiliency).
    • /Controllers/HomeController.cs: Serves the root page of the Vue SPA.
  12. Understand the purpose of generated metadata in Coalesce Vue

    Because Vue applications are compiled to static assets and lack runtime reflection (unlike .NET), Coalesce generates a metadata.g.ts file. This file acts as a static analog to the .NET ReflectionRepository, providing a client-side representation of the backend data model's structure and behavior. It enables the Vue application to perform type-aware operations and build dynamic interfaces based on the backend's types, properties, and methods.