|
13 | 13 |
|
14 | 14 | [comment]: <> (Table of contents generated with markdown-toc http://ecotrust-canada.github.io/markdown-toc/) |
15 | 15 | <!-- TOC --> |
16 | | -- [SSW Vertical Slice Architecture Template](#ssw-vertical-slice-architecture-template) |
17 | | - * [🤔 What is it?](#---what-is-it-) |
18 | | - * [✨ Features](#--features) |
19 | | - * [🎉 Getting Started](#---getting-started) |
20 | | - * [🎓 Learn More](#---learn-more) |
21 | | - * [🚀 Publishing Template](#---publishing-template) |
22 | | - * [🤝 Contributing](#---contributing) |
| 16 | +[SSW Vertical Slice Architecture Template](#ssw-vertical-slice-architecture-template) |
| 17 | + |
| 18 | +* [🤔 What is it?](#---what-is-it-) |
| 19 | +* [✨ Features](#--features) |
| 20 | +* [🎉 Getting Started](#---getting-started) |
| 21 | +* [🎓 Learn More](#---learn-more) |
| 22 | +* [🚀 Publishing Template](#---publishing-template) |
| 23 | +* [🤝 Contributing](#---contributing) |
| 24 | + |
23 | 25 | <!-- TOC --> |
24 | 26 |
|
25 | 27 | ## 🤔 What is it? |
@@ -89,93 +91,84 @@ Read more on [SSW Rules to Better Vertical Slice Architecture](https://www.ssw.c |
89 | 91 | ## 🎉 Getting Started |
90 | 92 |
|
91 | 93 | ### Prerequisites |
| 94 | + |
92 | 95 | - [Docker](https://www.docker.com/get-started/) / [Podman](https://podman.io/get-started) |
93 | 96 | - [Dotnet 9](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) |
94 | 97 |
|
95 | 98 | ### Installing the Template |
96 | 99 |
|
97 | | -1. Install the SSW CA template |
98 | | - |
99 | | - ```bash |
100 | | - dotnet new install SSW.VerticalSliceArchitecture.Template |
101 | | - ``` |
| 100 | +1. Install the SSW VSA template |
| 101 | + ```bash |
| 102 | + dotnet new install SSW.VerticalSliceArchitecture.Template |
| 103 | + ``` |
102 | 104 |
|
103 | 105 | > NOTE: The template only needs to be installed once. Running this command again will update your version of the template. |
104 | 106 |
|
105 | 107 | 2. Create a new directory |
106 | | - |
107 | | - ```bash |
108 | | - mkdir Sprout |
109 | | - cd Sprout |
110 | | - ``` |
| 108 | + ```bash |
| 109 | + mkdir Sprout |
| 110 | + cd Sprout |
| 111 | + ``` |
111 | 112 |
|
112 | 113 | 3. Create a new solution |
113 | | - |
114 | | - ```bash |
115 | | - dotnet new ssw-vsa |
116 | | - ``` |
| 114 | + ```bash |
| 115 | + dotnet new ssw-vsa |
| 116 | + ``` |
117 | 117 |
|
118 | 118 | > NOTE: `name` is optional; if you don't specify it, the directory name will be used as the solution name and project namespaces. |
119 | 119 |
|
120 | 120 | Alternatively, you can specify the `name` and `output` directory as follows: |
121 | 121 |
|
122 | | - ```bash |
123 | | - dotnet new ssw-vsa --name {{SolutionName}} --output .\ |
124 | | - ``` |
| 122 | +```bash |
| 123 | +dotnet new ssw-vsa --name {{SolutionName}} |
| 124 | +``` |
125 | 125 |
|
126 | 126 | ### Adding a Feature Slice |
127 | 127 |
|
128 | 128 | To speed up development there is a `dotnet new` template to create a full Vertical Slice: |
| 129 | + |
129 | 130 | - Creates a domain object in `Common/Domain/*` |
130 | 131 | - Adds domain configuration in `Common/Persistence/*` |
131 | 132 | - Creates Command & Query API endpoints in `Features/*` |
132 | 133 |
|
133 | 134 | 1. Add a new Feature |
134 | | -
|
135 | | - ```bash |
136 | | - cd src/WebApi/ |
137 | | -
|
138 | | - dotnet new ssw-vsa-slice --feature Person --feature-plural People |
139 | | - ``` |
| 135 | + ```bash |
| 136 | + cd src/WebApi/ |
| 137 | + dotnet new ssw-vsa-slice --feature Person --feature-plural People |
| 138 | + ``` |
140 | 139 |
|
141 | 140 | `--feature` or `-f` where the value is the **singular** name of the feature. |
142 | 141 | `--feature-plural` or `-fp` where the value is the **plural** name of the feature. |
143 | 142 |
|
144 | 143 | 2. Configure this Feature |
145 | | -
|
146 | | -This project uses [strongly typed IDs](https://www.ssw.com.au/rules/do-you-use-strongly-typed-ids/), which require registration in the `VogenEfCoreConverters` class: |
147 | | -
|
148 | | - ```csharp |
149 | | - // Register the newly created Entity ID here |
150 | | - [EfCoreConverter<PersonId>] |
151 | | - internal sealed partial class VogenEfCoreConverters; |
152 | | - ``` |
| 144 | + This project uses [strongly typed IDs](https://www.ssw.com.au/rules/do-you-use-strongly-typed-ids/), which require registration in the `VogenEfCoreConverters` class: |
| 145 | + ```csharp |
| 146 | + // Register the newly created Entity ID here |
| 147 | + [EfCoreConverter<PersonId>] |
| 148 | + internal sealed partial class VogenEfCoreConverters; |
| 149 | + ``` |
153 | 150 |
|
154 | 151 | 3. Add a migration for the new Entity |
155 | | -
|
156 | | - ```bash |
157 | | - dotnet ef migrations add --project src/WebApi/WebApi.csproj --startup-project src/WebApi/WebApi.csproj --output-dir Common/Database/Migrations PersonTable |
158 | | - ``` |
| 152 | + ```bash |
| 153 | + dotnet ef migrations add --project src/WebApi/WebApi.csproj --startup-project src/WebApi/WebApi.csproj --output-dir Common/Database/Migrations PersonTable |
| 154 | + ``` |
159 | 155 |
|
160 | 156 | ### Running the Solution |
161 | 157 |
|
162 | 158 | 1. Change directory |
163 | | -
|
164 | 159 | Windows: |
165 | | - ```ps |
166 | | - cd tools\AppHost\ |
167 | | - ``` |
168 | | -
|
| 160 | + ```ps |
| 161 | + cd tools\AppHost\ |
| 162 | + ``` |
169 | 163 | Mac/Linux: |
170 | | - ```bash |
171 | | - cd tools/AppHost/ |
172 | | - ``` |
| 164 | + ```bash |
| 165 | + cd tools/AppHost/ |
| 166 | + ``` |
173 | 167 |
|
174 | 168 | 2. Run the solution |
175 | | -
|
176 | | - ```bash |
177 | | - dotnet run |
178 | | - ``` |
| 169 | + ```bash |
| 170 | + dotnet run |
| 171 | + ``` |
179 | 172 |
|
180 | 173 | > **NOTE:** The first time you run the solution, it may take a while to download the docker images, create the DB, and seed the data. |
181 | 174 |
|
@@ -219,4 +212,4 @@ Template will be published to NuGet.org when changes are made to `VerticalSliceA |
219 | 212 |
|
220 | 213 | ## 🤝 Contributing |
221 | 214 |
|
222 | | -Contributions, issues and feature requests are welcome! See [Contributing](./CONTRIBUTING.md) for more information. |
| 215 | +Contributions, issues and feature requests are welcome! See [Contributing](./CONTRIBUTING.md) for more information. |
0 commit comments