{"id":22938413,"url":"https://github.com/jacraig/gestalt","last_synced_at":"2025-08-12T18:33:20.515Z","repository":{"id":227190934,"uuid":"770705156","full_name":"JaCraig/Gestalt","owner":"JaCraig","description":"Gestalt is a comprehensive application module system designed to streamline the development and packaging process of applications. With Gestalt, effortlessly construct robust applications using modular design principles and leverage the power of dependency injection for seamless integration of reusable components.","archived":false,"fork":false,"pushed_at":"2024-10-29T23:40:47.000Z","size":11431,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-30T01:48:22.105Z","etag":null,"topics":["asp-net","modular","reusable-components"],"latest_commit_sha":null,"homepage":"https://jacraig.github.io/Gestalt/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JaCraig.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-12T02:25:58.000Z","updated_at":"2024-10-29T23:40:51.000Z","dependencies_parsed_at":"2024-11-12T00:20:05.301Z","dependency_job_id":"3e828a2b-899a-45bd-a16c-4f47e9c051c3","html_url":"https://github.com/JaCraig/Gestalt","commit_stats":null,"previous_names":["jacraig/gestalt"],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaCraig%2FGestalt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaCraig%2FGestalt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaCraig%2FGestalt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaCraig%2FGestalt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JaCraig","download_url":"https://codeload.github.com/JaCraig/Gestalt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229700197,"owners_count":18109933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asp-net","modular","reusable-components"],"created_at":"2024-12-14T12:17:51.511Z","updated_at":"2024-12-14T12:17:52.142Z","avatar_url":"https://github.com/JaCraig.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"https://jacraig.github.io/Gestalt/images/Icon.png\" style=\"height:25px\" alt=\"Gestalt Icon\" /\u003e Gestalt\n\n[![.NET Publish](https://github.com/JaCraig/Gestalt/actions/workflows/dotnet-publish.yml/badge.svg)](https://github.com/JaCraig/Gestalt/actions/workflows/dotnet-publish.yml) [![Coverage Status](https://coveralls.io/repos/github/JaCraig/Gestalt/badge.svg?branch=main)](https://coveralls.io/github/JaCraig/Gestalt?branch=main)\n\nGestalt is a C# library designed to facilitate the development of modular applications. It allows developers to create reusable modules that can be easily integrated into various applications, enhancing code reusability and maintainability.\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Features](#features)\n- [Getting Started](#getting-started)\n  - [Installation](#installation)\n  - [Creating Modules](#creating-modules)\n  - [Using Modules](#using-modules)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Introduction\n\nModern software development often requires building applications with modular architectures to promote reusability and scalability. Gestalt provides a framework for organizing application functionality into cohesive modules, encapsulating logic and services that can be easily shared across different projects.\n\n## Features\n\n- **Modular Architecture:** Define modules encapsulating configuration, services, and lifecycle events.\n- **Configuration Management:** Easily configure application settings using built-in configuration providers.\n- **Dependency Injection:** Utilize dependency injection for managing dependencies and services.\n- **Lifecycle Management:** Implement lifecycle events such as application start, stop, and shutdown.\n\n## Getting Started\n\n### Installation\n\nGestalt can be installed via NuGet Package Manager:\n\n```bash\ndotnet add package Gestalt.Core\n```\n\nOr for framework specific functionality, install the appropriate package:\n\n```bash\n# For ASP.NET base functionality\ndotnet add package Gestalt.AspNet\n# For ASP.NET MVC functionality\ndotnet add package Gestalt.AspNet.MVC\n# For ASP.NET Controllers functionality (without views)\ndotnet add package Gestalt.AspNet.Controllers\n# For ASP.NET SignalR functionality\ndotnet add package Gestalt.AspNet.SignalR\n# For ASP.NET Razor Pages functionality\ndotnet add package Gestalt.AspNet.RazorPages\n# For console applications\ndotnet add package Gestalt.Console\n```\n\n### Creating Modules\n\nTo create a module, follow these steps:\n\n1. Define a class that inherits from one of the *ModuleBaseClasses or implements one of the IApplicationModule interfaces (IMvcModule, ISignalRModule, IRazorPagesModule, etc).\n\n2. Override methods for configuring settings, services, and lifecycle events.\n\n3. Implement module-specific functionality within the class.\n\nA basic example of a module class is shown below:\n\n```csharp\n/// \u003csummary\u003e\n/// This is an example of a basic module that configures the application with the usual default settings when creating a new web application.\n/// It implements the MvcModuleBaseClass which simplifies the process of creating a module that needs to modify MVC settings.\n/// However, you can implement the IMvcModule interface directly if you prefer.\n/// \u003c/summary\u003e\npublic class BasicModule : MvcModuleBaseClass\u003cBasicModule\u003e\n{\n    /// \u003csummary\u003e\n    /// This is called to configure the IApplicationBuilder object. Since this is an MVC app, that would be the WebApplication object.\n    /// \u003c/summary\u003e\n    /// \u003cparam name=\"applicationBuilder\"\u003eThe application builder object.\u003c/param\u003e\n    /// \u003cparam name=\"configuration\"\u003eThe configuration object.\u003c/param\u003e\n    /// \u003cparam name=\"environment\"\u003eThe host environment object.\u003c/param\u003e\n    /// \u003creturns\u003eThe application builder object should be returned.\u003c/returns\u003e\n    public override IApplicationBuilder? ConfigureApplication(IApplicationBuilder? applicationBuilder, IConfiguration? configuration, IHostEnvironment? environment)\n    {\n        if (applicationBuilder is null)\n            return applicationBuilder;\n\n        // Configure the HTTP request pipeline.\n        if (environment?.IsDevelopment() == false)\n        {\n            // This is the default exception handler for the application when in production.\n            _ = applicationBuilder.UseExceptionHandler(\"/Home/Error\");\n\n            // We will add a strict transport security header to the response.\n            _ = applicationBuilder.UseHsts();\n        }\n\n        // This will redirect HTTP requests to HTTPS.\n        _ = applicationBuilder.UseHttpsRedirection();\n        // And let's serve static files.\n        _ = applicationBuilder.UseStaticFiles();\n        // We will also add authorization to the application.\n        _ = applicationBuilder.UseAuthorization();\n        // And lastly, we will return the application builder.\n        return applicationBuilder;\n    }\n\n    /// \u003csummary\u003e\n    /// This is called to configure the MVC options. We will just return the options object as is.\n    /// \u003c/summary\u003e\n    /// \u003cparam name=\"mVCBuilder\"\u003eThe MVC builder object.\u003c/param\u003e\n    /// \u003cparam name=\"configuration\"\u003eThe configuration object.\u003c/param\u003e\n    /// \u003cparam name=\"environment\"\u003eThe host environment object.\u003c/param\u003e\n    /// \u003creturns\u003eThe MVC builder object.\u003c/returns\u003e\n    public override IMvcBuilder? ConfigureMVC(IMvcBuilder? mVCBuilder, IConfiguration? configuration, IHostEnvironment? environment)\n    {\n        return mVCBuilder;\n    }\n\n    /// \u003csummary\u003e\n    /// This is called to configure our endpoint routes. For our example, we will just use the default route.\n    /// \u003c/summary\u003e\n    /// \u003cparam name=\"endpoints\"\u003eThe endpoint route builder.\u003c/param\u003e\n    /// \u003cparam name=\"configuration\"\u003eThe configuration object.\u003c/param\u003e\n    /// \u003cparam name=\"environment\"\u003eThe host environment object.\u003c/param\u003e\n    /// \u003creturns\u003eThe endpoint route builder.\u003c/returns\u003e\n    public override IEndpointRouteBuilder? ConfigureRoutes(IEndpointRouteBuilder? endpoints, IConfiguration? configuration, IHostEnvironment? environment)\n    {\n        if (endpoints is null)\n            return endpoints;\n\n        // Map the default route.\n        endpoints.MapControllerRoute(\n                name: \"default\",\n                pattern: \"{controller=Home}/{action=Index}/{id?}\");\n\n        return endpoints;\n    }\n}\n```\n\n### Using Modules\n\nTo have your application start using modules, you just need to call UseGestalt on the application builder:\n\n```csharp\n// Program.cs\npublic class Program\n{\n    public static void Main(string[] args)\n    {\n        var builder = WebApplication.CreateBuilder(args);\n        var app = builder.UseGestalt(args);\n        app.Run();\n    }\n}\n```\nFor more advanced usage, refer to the [documentation](https://jacraig.github.io/Gestalt/articles/intro.html).\n\n## Contributing\nContributions to Gestalt are welcome! If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request. Before contributing, please review the [contribution guidelines](https://github.com/JaCraig/Gestalt/blob/main/CONTRIBUTING.md).\n\n## License\n\nGestalt is licensed under the [Apache 2.0 License](https://github.com/JaCraig/Gestalt/blob/main/LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacraig%2Fgestalt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacraig%2Fgestalt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacraig%2Fgestalt/lists"}