Skip to content

Commit af116f7

Browse files
authored
feat(templates): add interactive AI based wiki to Boilerplate #11544 (#11545)
1 parent b7f7f3d commit af116f7

19 files changed

+933
-295
lines changed

src/Templates/Boilerplate/Bit.Boilerplate/.github/copilot-instructions.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,15 @@ After applying changes, you **MUST** verify the integrity of the application.
9696

9797
* **Be Decisive**: Do not ask for permission to proceed or for a review of your plan. Directly state your plan and proceed with the implementation.
9898
* **Execute Commands Individually**: **Never** chain CLI commands with `&&`. Execute each command in a separate step.
99+
* **Getting started**: When a developer first interacts with you with a message like `Run getting started`, you **MUST** proactively follow `.github/prompts/getting-started.prompt.md`.
99100

100101
## 7. Critical Command Reference
101102

102103
- **Build the project**: Run `dotnet build` in Boilerplate.Server.Web project root directory.
103104
- **Run the project**: Run `dotnet run` in Boilerplate.Server.Web project root directory.
104105
- **Run tests**: Run `dotnet test` in Boilerplate.Tests project root directory.
105106
- **Add new migrations**: Run `dotnet ef migrations add <MigrationName> --verbose` in Boilerplate.Server.Api project root directory.
106-
- **Generate Resx C# code**: Run `dotnet build -t:PrepareResources` in Boilerplate.Shared project root directory.
107+
- **Generate Resx C# code**: Run `dotnet build -t:PrepareResources` in Boilerplate.Shared project root directory (It's automatically done during build).
107108

108109
## 8. Coding Conventions & Best Practices
109110

src/Templates/Boilerplate/Bit.Boilerplate/.github/prompts/getting-started.prompt.md

Lines changed: 815 additions & 0 deletions
Large diffs are not rendered by default.

src/Templates/Boilerplate/Bit.Boilerplate/Bit.ResxTranslator.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"DefaultLanguage": "en",
55

66
"SupportedLanguages": [ "nl", "fa", "sv", "hi", "zh", "es", "fr", "ar", "de" ],
7-
"SupportedLanguages__Comment": "Update MainActivity's DataPathPrefixes and CultureInfoManager's SupportedCultures as required.",
7+
"SupportedLanguages__Comment__1": "Add or remove languages as needed. Use ISO language codes (e.g., 'es' for Spanish, 'fr' for French).",
8+
"SupportedLanguages__Comment__2": "Update MainActivity's DataPathPrefixes and CultureInfoManager's SupportedCultures as required.",
89

910
"ResxPaths": [ "/src/**/*.resx" ],
1011

src/Templates/Boilerplate/Bit.Boilerplate/Boilerplate.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "prompts", "prompts", "{4A5D
5555
ProjectSection(SolutionItems) = preProject
5656
.github\prompts\resx.prompt.md = .github\prompts\resx.prompt.md
5757
.github\prompts\bitify.prompt.md = .github\prompts\bitify.prompt.md
58+
.github\prompts\getting-started.prompt.md = .github\prompts\getting-started.prompt.md
5859
.github\prompts\scaffold.prompt.md = .github\prompts\scaffold.prompt.md
5960
EndProjectSection
6061
EndProject

src/Templates/Boilerplate/Bit.Boilerplate/Boilerplate.slnx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
<Folder Name="/.SolutionItems/.github/prompts/">
3232
<File Path=".github/prompts/resx.prompt.md" />
3333
<File Path=".github/prompts/bitify.prompt.md" />
34+
<File Path=".github/prompts/getting-started.prompt.md" />
3435
<File Path=".github/prompts/scaffold.prompt.md" />
3536
</Folder>
3637
<!--#if (pipeline == "GitHub")-->

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Products/ProductController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public async Task<ProductDto> Create(ProductDto dto, CancellationToken cancellat
8383

8484
await Validate(entityToAdd, cancellationToken);
8585

86-
//#if (database == "PostgreSQL" || database == "SqlServer" || signalR == true)
86+
//#if (database == "PostgreSQL" || database == "SqlServer")
8787
//#if (IsInsideProjectTemplate == true)
8888
if (DbContext.Database.ProviderName!.EndsWith("PostgreSQL", StringComparison.InvariantCulture) ||
8989
DbContext.Database.ProviderName!.EndsWith("SqlServer", StringComparison.InvariantCulture))
@@ -116,7 +116,7 @@ public async Task<ProductDto> Update(ProductDto dto, CancellationToken cancellat
116116

117117
await Validate(entityToUpdate, cancellationToken);
118118

119-
//#if (database == "PostgreSQL" || database == "SqlServer" || signalR == true)
119+
//#if (database == "PostgreSQL" || database == "SqlServer")
120120
//#if (IsInsideProjectTemplate == true)
121121
if (DbContext.Database.ProviderName!.EndsWith("PostgreSQL", StringComparison.InvariantCulture) ||
122122
DbContext.Database.ProviderName!.EndsWith("SqlServer", StringComparison.InvariantCulture))

src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates05CreateProjectPage.razor

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -97,32 +97,34 @@
9797
@GetFileStorageCommand()
9898
</CodeBox>
9999

100-
@if (fileStorage.Value == "Local")
101-
{
102-
<div>
103-
The API project includes an Attachment Controller responsible for handling user images,
104-
including resizing and saving them in the WebP format using <a href="https://github.com/robinrodricks/FluentStorage" target="_blank">FluentStorage</a>
105-
<br />
106-
<br />
107-
Local option stores files on local hard drive.
108-
</div>
109-
}
110-
@if (fileStorage.Value == "AzureBlobStorage")
111-
{
112-
<div>
113-
Download and install Azure blob storage emulator <a href="https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=npm%2Cblob-storage#install-azurite">here</a>.
114-
</div>
115-
}
116-
@if (fileStorage.Value == "Other")
117-
{
118-
<div>
119-
Install and configure any of the <a href="https://www.nuget.org/profiles/hgupta" target="_blank">FluentStorage packages</a>.
120-
<br />
121-
<br />
122-
One noteable implementation is <a href="https://nuget.org/packages/FluentStorage.AWS" target="_blank">FluentStorage.AWS</a>, which supports Amazon S3.
123-
This allows you to use any file storage solution compatible with S3, such as DigitalOcean Spaces or MinIO.
124-
</div>
125-
}
100+
@switch (fileStorage.Value)
101+
{
102+
case "Local":
103+
<div>
104+
The API project includes an Attachment Controller responsible for handling user images,
105+
including resizing and saving them in the WebP format using <a href="https://github.com/robinrodricks/FluentStorage" target="_blank">FluentStorage</a>
106+
<br />
107+
<br />
108+
Local option stores files on local hard drive.
109+
</div>
110+
break;
111+
case "AzureBlobStorage":
112+
<div>
113+
Download and install Azure blob storage emulator <a href="https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=npm%2Cblob-storage#install-azurite">here</a>.
114+
</div>
115+
break;
116+
case "S3":
117+
<div>
118+
Install and configure <a href="https://www.nuget.org/packages/FluentStorage.AWS" target="_blank">FluentStorage.AWS</a>, which supports Amazon S3.
119+
This allows you to use any file storage solution compatible with S3, such as AWS, DigitalOcean Spaces, MinIO, Hetzner, Contabo etc.
120+
</div>
121+
break;
122+
case "Other":
123+
<div>
124+
Install and configure any of the <a href="https://www.nuget.org/profiles/hgupta" target="_blank">FluentStorage packages</a>.
125+
</div>
126+
break;
127+
}
126128
</BitGridItem>
127129

128130
<BitGridItem Class="grid-item md">
@@ -171,9 +173,18 @@
171173
</CodeBox>
172174
<br />
173175
<BitText Typography="BitTypography.Body2">
174-
Aspire helps you build, test, and deploy distributed applications with ease. Learn more at <a href="https://learn.microsoft.com/en-us/dotnet/aspire/" target="_blank">ASP.NET Core Aspire</a>.
176+
Aspire helps you build, test, and deploy distributed applications with ease. Learn more at <a href="https://learn.microsoft.com/en-us/dotnet/aspire/" target="_blank">ASP.NET Core Aspire</a>.
177+
<div class="video-container">
178+
<iframe width="800" height="450"
179+
allowfullscreen frameborder="0"
180+
title="Aspire"
181+
src="https://www.youtube.com/embed/-vd7quVCP1k?si=mf4GZrdqRYK6zZ25"
182+
referrerpolicy="strict-origin-when-cross-origin"
183+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"></iframe>
184+
</div>
175185
<CodeBox>dotnet tool install -g Aspire.Cli</CodeBox>
176-
</BitText>
186+
Aspire requires Docker Desktop to be installed and running. Download and install Docker Desktop from <a href="https://www.docker.com/products/docker-desktop/" target="_blank">here</a>.
187+
</BitText>
177188
</BitGridItem>
178189

179190
<BitGridItem Class="grid-item md" ColumnSpan="2">

src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates05CreateProjectPage.razor.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,10 @@
101101
}
102102
}
103103
}
104+
105+
.video-container {
106+
width: 100%;
107+
display: flex;
108+
justify-content: center;
109+
}
104110
}

src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates06RunProjectPage.razor

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,22 @@
77
Description="Run project of the project templates of the bit platform" />
88

99
<div class="page-container">
10-
<BitText Typography="BitTypography.H3" Gutter>Project Run Guidelines</BitText>
10+
<BitText Typography="BitTypography.H3" Gutter>Project Run</BitText>
1111
<br />
1212
<br />
1313
<section class="section-card">
1414
<div class="section-card-txt">
15-
The process for running the project varies based on the Api parameter set during project initiation:
15+
The process for running the project varies based on the <b>Api</b> parameter set during project initiation:
1616
<br />
1717
<ul>
1818
<li>
19-
<b>--api Integrated:</b> Simply run the Server.Web project (Running Server.Api is optional but not required).
19+
<b>--api Integrated (default):</b> Simply run the Server.Web project (Running Server.Api is optional but not required).
2020
</li>
2121
<li>
2222
<b>--api Standalone:</b> Run both the Server.Api and Server.Web projects.
2323
</li>
2424
</ul>
25+
<b>Note:</b> You have to make sure that the connection strings section of the Server.Api is properly configured based on the database of your choice installation. However, if you've created the project with Aspire (which is enabled by default) and you've installed Docker Desktop, you can simply run the AppHost project. This will run all dependencies as Docker containers and provide you with an awesome handy dashboard as well.
2526
</div>
2627
</section>
2728
<br />
@@ -63,13 +64,6 @@
6364
"BlazorMode": "BlazorServer",
6465
"BlazorMode_Comment": "BlazorServer, BlazorWebAssembly and BlazorAuto."
6566
}</CodeBox>
66-
<BitText Typography="BitTypography.H5" Gutter>Debugging in Blazor WebAssembly</BitText>
67-
To debug the project in Blazor WebAssembly mode, change the Current value to BlazorWebAssembly for development. To fully
68-
utilize debugging features, set the Launch profile to Server.Web-BlazorWebAssembly.
69-
<br />
70-
<div class="image-container">
71-
<img class="image" src="images/templates/launch-options.webp" />
72-
</div>
7367
<br />
7468
<BitText Typography="BitTypography.H5" Gutter>Running in Blazor WebAssembly Standalone Mode</BitText>
7569
To run the project in Blazor WebAssembly Standalone mode, run Client.Web in addition to server project.
@@ -221,4 +215,4 @@
221215
<br />
222216
<br />
223217
</div>
224-
<NavigationButtons Prev="Create project" PrevUrl="/templates/create-project" Next="Add new feature" NextUrl="/templates/add-new-feature" />
218+
<NavigationButtons Prev="Create project" PrevUrl="/templates/create-project" Next="Interactive Wiki" NextUrl="/templates/wiki" />

0 commit comments

Comments
 (0)