A .NET project template designed to enforce consistent project structures, integrate Swiss Confederation design standards, and streamline development processes. This template supports Web APIs, Blazor applications, and microservices.
- About the Project
- Features
- Folder Structure
- Getting Started
- Contributing
- Documentation
- Designe Integration
This template ensures consistent project structures while adhering to the Swiss Confederation design standards. It integrates key technologies like Oblique CSS and MudBlazor and includes preconfigured health checks and logging for OpenShift readiness.
The template reduces setup time, promotes best practices, and aligns with organizational branding and security standards.
- Swiss Confederation Design Standards: Includes Oblique CSS and fonts for branding consistency.
- Component-Based UI: Integrated with MudBlazor for modern UI development.
- Health Checks: Preconfigured
/health
endpoint for readiness/liveness probes. - Logging and Dependency Injection: Prebuilt configurations for ease of use.
- Customizable: Easily adaptable with namespace and project-specific parameters.
The repository is organized as follows:
├── README.md # High-level overview of the project and instructions
├── docs/ # Documentation folder
│ ├── how_to_template.md # Instructions on creating and maintaining the template
│ ├── stakeholder-input.md # Notes from discussions with stakeholders
│ ├── usage.md # How to use the template
│ ├── swiss-confederation-mudblazor.md # Details on integrating Swiss Confederation design system
│ ├── requirements.md # Requirements for the project
├── src/ # Template source code
│ ├── blazor_server_template/ # Main template folder
│ │ ├── .template.config/ # Template metadata
│ │ │ └── template.json # Metadata and settings for the .NET template
│ │ ├── Components/ # Blazor components
│ │ │ ├── Layout/ # Layout components (MainLayout, Header, Footer, etc.)
│ │ │ ├── Pages/ # Application pages
│ │ │ │ ├── Examples/ # Example Razor pages (Weather, Counter, etc.)
│ │ ├── Extensions/ # Extensions for reusable functionality
│ │ │ ├── HealthCheckExtensions.cs # Health check logic for OpenShift readiness/liveness probes
│ │ │ ├── SwaggerExtensions.cs # Swagger/OpenAPI documentation setup
│ │ ├── Controllers/ # Example API controllers
│ │ │ ├── TodoController.cs # Example controller for testing API functionality
| | ├── tests/ # Template testing folder
│ | | └── TemplateTest.csproj # Unit tests for verifying the template functionality
│ │ ├── wwwroot/ # Static assets
│ │ │ ├── swiss-confederation/ # Swiss Confederation styles and resources
│ │ │ │ ├── v1.0.26.css # Swiss Confederation main CSS
│ │ │ │ ├── scripts/ # JavaScript functionality
│ │ │ │ ├── fonts/ # Fonts used in the project
│ │ │ │ ├── icons/ # SVG icons for visual consistency
│ │ │ │ ├── favicon.ico # Project favicon
│ │ ├── Program.cs # Application entry point
│ │ ├── appsettings.json # Default application settings
│ │ ├── appsettings.Development.json # Development-specific settings
├── .gitignore # Files and directories to be ignored by Git
Follow these steps to install and use the Swiss .NET Project Template.
- .NET SDK 8.0 or later (Install .NET SDK on Ubuntu)
- Git for version control
- Clone the repository:
git clone ssh://[email protected]/ps-irs-apa/swiss-dotnet-template.git
cd swiss-dotnet-template
- Install the template locally
dotnet new --install ./src/swiss-blazor-server-template
Generate a new project using the template:
dotnet new swissblazorserver -n MyProjectName
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature/my-feature
. - Commit your changes:
git commit -m 'Add new feature'
. - Push to the branch:
git push origin feature/my-feature
. - Open a pull request.
Please ensure your changes align with the project standards and include documentation if necessary.
For a detailed guide on how to create a .NET template, refer to the Template Creation Guide.
This project integrates the Swiss Confederation Design System to ensure compliance with federal design standards. The integration includes custom CSS and fonts, which are seamlessly incorporated into the Blazor template.
For detailed steps and explanations about how the design system was integrated into this template, refer to the Design System Integration Guide.