2.3 KiB
2.3 KiB
Copilot Instructions
Project Overview
- Fuchs Intranet is an ASP.NET Core (.NET 10) web application — the intranet IS the entire website, served from
/. - Routes:
/{fn?}/{id?}/{code?}→IntranetController.Index;/do/{fn?}/{id?}/{code?}→IntranetController.Do. - Project structure (relative to
Fuchs/):Controllers/—IntranetControllerpartials (no area)code/— business logic, PDF, email, widgets, data modelscss/intranet/— intranet SCSS source filesjs/intranet/— intranet JS source files (modules injs/intranet/modules/)Data/— static data assets (images for PDF, HTML files)Views/Intranet/— Razor views;Views/Shared/_Layout.cshtml;Views/Partials/
Coding Standards
- All code must be written in C#.
- Keep files to a limit of 400 (max 600) lines of code to ensure maintainability and readability. Proactively refactor larger files into smaller, focused classes or components as needed.
- Follow standard C# naming conventions (PascalCase for classes and methods, camelCase for variables and parameters).
- Use modern, performance-oriented C# .NET 10 features and best practices, such as async/await for asynchronous programming, LINQ for data manipulation, and dependency injection for better testability and maintainability.
Configuration
- All application settings live in
Fuchs/appsettings.json— do not useWeb.configorSystem.Configuration.ConfigurationManager. - App-specific settings are nested under the
"Fuchs"key (e.g.,_config["Fuchs:SMS_APIKey"]). - Connection strings are stored under the standard
"ConnectionStrings"key and read viaIConfiguration.GetConnectionString(...). FuchsOcmsIntranet.Initialize(configuration)must be called at app start (inProgram.cs) before DI registration;Fuchs_intranetreceivesIConfigurationvia its constructor.appsettings.Development.json(git-ignored) can override secrets for local development.
Libraries
- Do not upgrade Spire.PDF beyond version 8.10.5.
- Make use of OCORE libraries where possible, especially for common tasks such as logging, configuration management, and data access.
- Whenever possible, prefer OCORE_web_pdf / OCORE PDF functions for PDF-related tasks over rewriting.
- Do not use OCMS or OCMS_sharp; use only OCORE or OCORE_web.