https://github.com/flexipexi/vertical-slice-architecture
Explore the Vertical Slice Architecture template for .NET 9. Build scalable Web APIs with modular design. Perfect for modern web applications! ππ
https://github.com/flexipexi/vertical-slice-architecture
asp-net-core aspire aspnetcore bdd cqrs ddd-architecture domain-driven-design dotnet ef-core event-sourcing grpc kubernetes message-broker oauth2 opentelemetry software-architecture typescript vertical-slice-architecture
Last synced: 8 months ago
JSON representation
Explore the Vertical Slice Architecture template for .NET 9. Build scalable Web APIs with modular design. Perfect for modern web applications! ππ
- Host: GitHub
- URL: https://github.com/flexipexi/vertical-slice-architecture
- Owner: flexipexi
- License: mit
- Created: 2025-07-26T22:10:07.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-07-28T23:25:37.000Z (8 months ago)
- Last Synced: 2025-07-29T01:13:48.321Z (8 months ago)
- Topics: asp-net-core, aspire, aspnetcore, bdd, cqrs, ddd-architecture, domain-driven-design, dotnet, ef-core, event-sourcing, grpc, kubernetes, message-broker, oauth2, opentelemetry, software-architecture, typescript, vertical-slice-architecture
- Language: C#
- Size: 730 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Vertical Slice Architecture: A .NET 9 Web API Starter Template π

[](https://github.com/flexipexi/vertical-slice-architecture/releases)
## Overview
This repository provides a modern starter template for building Web APIs using .NET 9. It employs the Vertical Slice Architecture and REPR+V pattern to create a clean, maintainable, and scalable codebase. This architecture focuses on organizing code by feature rather than by type, allowing for better separation of concerns and easier testing.
## Table of Contents
- [Key Features](#key-features)
- [Architecture](#architecture)
- [Getting Started](#getting-started)
- [Usage](#usage)
- [Folder Structure](#folder-structure)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)
## Key Features
- **Modern .NET 9 Framework**: Built on the latest .NET 9 technology for optimal performance and security.
- **Vertical Slice Architecture**: Organizes code by feature, enhancing maintainability and scalability.
- **REPR+V Pattern**: Implements the Request-Entity-Response-Plus-View pattern for clear data flow.
- **Minimal API**: Utilizes the minimal API approach for simplicity and speed.
- **Well-Documented**: Includes comprehensive documentation for easy onboarding and usage.
## Architecture
Vertical Slice Architecture divides the application into slices, each representing a feature. Each slice contains all the necessary components such as commands, queries, and handlers. This allows for clear boundaries and reduces the complexity of the codebase.
### REPR+V Pattern
The REPR+V pattern enhances the traditional Request-Response model by adding a view layer. This separation allows for better handling of responses and simplifies the client-side integration.
## Getting Started
To get started with this template, you need to clone the repository and set up your environment.
1. Clone the repository:
```bash
git clone https://github.com/flexipexi/vertical-slice-architecture.git
cd vertical-slice-architecture
```
2. Install the necessary dependencies:
```bash
dotnet restore
```
3. Run the application:
```bash
dotnet run
```
You can now access the API at `http://localhost:5000`.
## Usage
This template is designed to be easily customizable. You can add new features by creating new slices. Each slice should follow the structure outlined in the folder structure section.
### Example Endpoint
Hereβs an example of how to create a new feature:
1. Create a new folder under `Features` for your slice.
2. Add a command, query, and handler.
3. Define the necessary routes in the `Startup.cs`.
For more detailed examples, check the documentation within the repository.
## Folder Structure
The folder structure is crucial for maintaining clarity in a Vertical Slice Architecture. Hereβs a breakdown of the key folders:
```
/vertical-slice-architecture
|-- /Features
| |-- /FeatureName
| |-- Command.cs
| |-- Query.cs
| |-- Handler.cs
| |-- ResponseModel.cs
|-- /Common
|-- /Tests
|-- /wwwroot
|-- Startup.cs
|-- Program.cs
```
- **Features**: Contains all the slices of the application.
- **Common**: Shared utilities and helpers.
- **Tests**: Unit and integration tests for the application.
- **wwwroot**: Static files and assets.
## Contributing
Contributions are welcome! If you want to improve this template or fix issues, please follow these steps:
1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Make your changes and commit them (`git commit -m 'Add new feature'`).
4. Push to the branch (`git push origin feature-branch`).
5. Create a pull request.
Please ensure that your code adheres to the existing style and includes tests where applicable.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## Contact
For questions or feedback, please reach out via the Issues section or directly at my GitHub profile.
Check out the [Releases](https://github.com/flexipexi/vertical-slice-architecture/releases) for the latest updates and version changes. You can download the latest version and execute it as needed.


Feel free to explore the topics associated with this repository:
- **Architectural Patterns**: Understanding different design methodologies.
- **ASP.NET Core**: Building robust web applications.
- **Software Design**: Principles and practices for effective software engineering.
- **Vertical Slices**: Organizing code for better maintainability.
For more information, visit the repository and check out the resources available.