Skip to content

Commit

Permalink
setup solution as a dotnet template
Browse files Browse the repository at this point in the history
folders reorganizations
docker not tested (relative paths need to be updated)
This is only a technical preview. You could make a local template on your machine and create a new solution.
See createLocalTemplate.cmd
  • Loading branch information
GioviQ committed Apr 11, 2020
1 parent 3be6020 commit e51b812
Show file tree
Hide file tree
Showing 305 changed files with 525 additions and 421 deletions.
3 changes: 3 additions & 0 deletions createLocalTemplate.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cd src
dotnet new -i .\
pause
26 changes: 26 additions & 0 deletions src/.template.config/template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "Keith Fimreite",
"classifications": [ "Web", "Blazor", "WebAssembly", "WebApi", "IdentityServer4" ],
"name": "Blazor Boilerplate & Starter Kit",
"defaultName": "BlazorBoilerplate",
"description": "Blazor Boilerplate SPA Admin Template for Blazor Server and Client",
"identity": "BlazorBoilerplate.CSharp",
"groupIdentity": "BlazorBoilerplate",
"shortName": "blazorboilerplate",
"tags": {
"language": "C#",
"type":"project"
},
"sourceName": "BlazorBoilerplate",
"preferNameDirectory": true,
"sources": [
{
"source": "./",
"target": "./",
"exclude": [
".template.config/**"
]
}
]
}
Binary file removed src/BlazorBoilerplate.Server/AuthSample.pfx
Binary file not shown.
12 changes: 0 additions & 12 deletions src/BlazorBoilerplate.Shared/Dto/Admin/IdentityServerDtos.txt

This file was deleted.

715 changes: 371 additions & 344 deletions src/BlazorBoilerplate.sln

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<Version>0.8.0</Version>
<Authors>Keith Fimreite</Authors>
<Company>EnkodeLLC</Company>
<Title>Blazor Boilerplate Client</Title>
<Title>BlazorBoilerplate Client</Title>
<Description>Blazor Boilerplate is starter kit / SPA Admin Template for Blazor</Description>
<WebPage>https://blazorboilerplate.com/</WebPage>
<PackageProjectUrl>https://blazorboilerplate.com/</PackageProjectUrl>
Expand Down Expand Up @@ -49,7 +49,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BlazorBoilerplate.CommonUI\BlazorBoilerplate.CommonUI.csproj" />
<ProjectReference Include="..\..\Shared\Themes\BlazorBoilerplate.CommonUI\BlazorBoilerplate.CommonUI.csproj" />
</ItemGroup>

</Project>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Version>0.8.0</Version>
<Authors>Keith Fimreite</Authors>
<Company>EnkodeLLC</Company>
<Title>Blazor Boilerplate Server</Title>
<Title>BlazorBoilerplate Server</Title>
<Description>Blazor Boilerplate is starter kit / SPA Admin Template for Blazor</Description>
<WebPage>https://blazorboilerplate.com/</WebPage>
<PackageProjectUrl>https://blazorboilerplate.com/</PackageProjectUrl>
Expand Down Expand Up @@ -74,11 +74,10 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BlazorBoilerplate.Client\BlazorBoilerplate.Client.csproj" />
<ProjectReference Include="..\BlazorBoilerplate.CommonUI\BlazorBoilerplate.CommonUI.csproj" />
<ProjectReference Include="..\BlazorBoilerplate.Shared\BlazorBoilerplate.Shared.csproj" />
<ProjectReference Include="..\..\Client\BlazorBoilerplate.Client\BlazorBoilerplate.Client.csproj" />
<ProjectReference Include="..\..\Shared\BlazorBoilerplate.Shared\BlazorBoilerplate.Shared.csproj" />
<ProjectReference Include="..\..\Shared\Microsoft.AspNetCore.ProtectedBrowserStorage\Microsoft.AspNetCore.ProtectedBrowserStorage.csproj" />
<ProjectReference Include="..\BlazorBoilerplate.Storage\BlazorBoilerplate.Storage.csproj" />
<ProjectReference Include="..\Microsoft.AspNetCore.ProtectedBrowserStorage\Microsoft.AspNetCore.ProtectedBrowserStorage.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static EmailMessageDto BuildTestEmail(this EmailMessageDto emailMessage)
.Replace("{user}", emailMessage.ToAddresses[0].Name)
.Replace("{testDate}", DateTime.Now.ToString());

emailMessage.Subject = string.Format("Hello {0} from Blazor Boilerplate", emailMessage.ToAddresses[0].Name);
emailMessage.Subject = string.Format("Hello {0} from BlazorBoilerplate Team", emailMessage.ToAddresses[0].Name);

return emailMessage;
}
Expand Down Expand Up @@ -60,7 +60,7 @@ public static EmailMessageDto BuildNewUserConfirmationEmail(this EmailMessageDto
.Replace("{userId}", userId)
.Replace("{token}", token);

emailMessage.Subject = string.Format("Welcome {0} to Blazor Boilerplate", recepientName);
emailMessage.Subject = string.Format("Welcome {0} to BlazorBoilerplate", recepientName);

return emailMessage;
}
Expand All @@ -76,7 +76,7 @@ public static EmailMessageDto BuildNewUserEmail(this EmailMessageDto emailMessag
.Replace("{email}", emailAddress)
.Replace("{password}", password);

emailMessage.Subject = string.Format("Welcome {0} to Blazor Boilerplate", fullName);
emailMessage.Subject = string.Format("Welcome {0} to BlazorBoilerplate", fullName);

return emailMessage;
}
Expand All @@ -93,7 +93,7 @@ public static EmailMessageDto BuilNewUserNotificationEmail(this EmailMessageDto
.Replace("{roles}", roles)
.Replace("{company}", company);

emailMessage.Subject = string.Format("A new user [{0}] has registered on Blazor Boilerplate", userName);
emailMessage.Subject = string.Format("A new user [{0}] has registered on BlazorBoilerplate", userName);

return emailMessage;
}
Expand All @@ -107,7 +107,7 @@ public static EmailMessageDto BuildForgotPasswordEmail(this EmailMessageDto emai
.Replace("{token}", token)
.Replace("{callbackUrl}", callbackUrl);

emailMessage.Subject = string.Format("Blazor Boilerplate Forgot your Passord? [{0}]", name);
emailMessage.Subject = string.Format("BlazorBoilerplate Forgot your Passord? [{0}]", name);

return emailMessage;
}
Expand All @@ -119,7 +119,7 @@ public static EmailMessageDto BuildPasswordResetEmail(this EmailMessageDto email
emailMessage.Body = passwordResetTemplate
.Replace("{userName}", userName);

emailMessage.Subject = string.Format("Blazor Boilerplate Password Reset for {0}", userName);
emailMessage.Subject = string.Format("BlazorBoilerplate Password Reset for {0}", userName);

return emailMessage;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div>
<h1>
<img style="width:100px; vertical-align: middle;" src="https://blazorboilerplate.com/images/logo.png" alt="Blazor Boilerplate"/> Blazor Boilerplate
<img style="width:100px; vertical-align: middle;" src="https://blazorboilerplate.com/images/logo.png" alt="Blazor Boilerplate"/> BlazorBoilerplate
</h1>
<h3>Dear {name},</h3>
<p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div>
<h1>
<img style="width:100px; vertical-align: middle;" src="https://blazorboilerplate.com/images/logo.png" alt="Blazor Boilerplate"/> Blazor Boilerplate
<img style="width:100px; vertical-align: middle;" src="https://blazorboilerplate.com/images/logo.png" alt="Blazor Boilerplate"/> BlazorBoilerplate
</h1>
<p>Hello {userName},</p>
<p>
Expand All @@ -10,5 +10,5 @@
<strong>UserId:</strong> {userId}<br />
<strong>Token:</strong> {token}<br/>
</p>
<p>Thank you, and welcome to the Blazor Boilerplate</p>
<p>Thank you, and welcome to the BlazorBoilerplate</p>
</div>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div>
<h1>
<img style="width:100px; vertical-align: middle;" src="https://blazorboilerplate.com/images/logo.png" alt="Blazor Boilerplate"/> Blazor Boilerplate
<img style="width:100px; vertical-align: middle;" src="https://blazorboilerplate.com/images/logo.png" alt="Blazor Boilerplate"/> BlazorBoilerplate
</h1>
<p>Hello {fullName},</p>
<p>
Expand All @@ -22,5 +22,5 @@
<p>
<br />
</p>
<p>Thank you, and welcome aboard the Blazor Boilerplate</p>
<p>Thank you, and welcome aboard the BlazorBoilerplate</p>
</div>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div>
<h1>
<img style="width:100px; vertical-align: middle;" src="https://blazorboilerplate.com/images/logo.png" alt="Blazor Boilerplate"/> Blazor Boilerplate
<img style="width:100px; vertical-align: middle;" src="https://blazorboilerplate.com/images/logo.png" alt="Blazor Boilerplate"/> BlazorBoilerplate
</h1>
<p>Hello {name},</p>
<p>
Expand All @@ -18,5 +18,5 @@
<br />
</p>
<p>Regards,</p>
<p>Blazor Boilerplate Team</p>
<p>BlazorBoilerplate Team</p>
</div>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div>
<h1>
<img style="width:100px; vertical-align: middle;" src="https://blazorboilerplate.com/images/logo.png" alt="Blazor Boilerplate"/> Blazor Boilerplate
<img style="width:100px; vertical-align: middle;" src="https://blazorboilerplate.com/images/logo.png" alt="Blazor Boilerplate"/> BlazorBoilerplate
</h1>
<h3>Dear {userName},</h3>
<p>Your password has been successfully reset, you can now login with your new password.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ This email was sent using the plain text test email template.
The test was on {date}.

Regards,
Blazor Boilerplate Template
Blazor BoilerplateTemplate
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</h1>
<p>Hello {user},</p>
<p>
This is a <strong>TEST</strong> email. If you are using Blazor Boilerplate please <a href="https://github.com/enkodellc/blazorboilerplate">star the repo on Github</a>.
This is a <strong>TEST</strong> email. If you are using BlazorBoilerplate please <a href="https://github.com/enkodellc/blazorboilerplate">star the repo on Github</a>.
We are looking for more contributors to grow the project. There are several areas of improvement needed and if you are using the repo in your project please submit your PR's or suggestions.
</p>
<p>
Expand All @@ -15,5 +15,5 @@
<br />
</p>
<p>Regards,</p>
<p>Blazor Boilerplate Email Template</p>
<p>BlazorBoilerplate Email Template</p>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<key id="b6a42733-fabf-4e5f-964d-422a590b443c" version="1">
<creationDate>2020-04-10T08:00:41.2053779Z</creationDate>
<activationDate>2020-04-10T08:00:40.9851421Z</activationDate>
<expirationDate>2020-07-09T08:00:40.9851421Z</expirationDate>
<descriptor deserializerType="Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=3.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60">
<descriptor>
<encryption algorithm="AES_256_CBC" />
<validation algorithm="HMACSHA256" />
<masterKey p4:requiresEncryption="true" xmlns:p4="http://schemas.asp.net/2015/03/dataProtection">
<!-- Warning: the key below is in an unencrypted form. -->
<value>GKORi/dBw6SrF2P7zj6e/K03dawbK/E5Dp4FB5FdkD1ewyuxRokaxwsIgBsGyp16zmBszJipOYbo5pgns24/Kg==</value>
</masterKey>
</descriptor>
</descriptor>
</key>
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,15 @@ private async Task HandleExceptionAsync(HttpContext httpContext, System.Exceptio
}
else
{
//-:cnd:noEmit
#if !DEBUG
var msg = "An unhandled error occurred.";
string stack = null;
#else
var msg = exception.GetBaseException().Message;
string stack = exception.StackTrace;
#endif

//-:cnd:noEmit
apiError = new ApiError(msg)
{
Details = stack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,15 @@ private async Task HandleExceptionAsync(HttpContext httpContext, System.Exceptio
}
else
{
//-:cnd:noEmit
#if !DEBUG
var msg = "An unhandled error occurred.";
string stack = null;
#else
var msg = exception.GetBaseException().Message;
string stack = exception.StackTrace;
#endif

//-:cnd:noEmit
apiError = new ApiError(msg)
{
Details = stack
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Threading.Tasks;

using AutoMapper;
//-:cnd:noEmit
#if ServerSideBlazor

using BlazorBoilerplate.CommonUI;
Expand All @@ -20,6 +21,7 @@
using System.Net.Http;

#endif
//-:cnd:noEmit

using BlazorBoilerplate.Server.Authorization;
using BlazorBoilerplate.Server.Helpers;
Expand Down Expand Up @@ -313,13 +315,17 @@ public void ConfigureServices(IServiceCollection services)
config.PostProcess = document =>
{
document.Info.Version = typeof(Startup).GetTypeInfo().Assembly.GetName().Version.ToString();
document.Info.Title = "Blazor Boilerplate";
document.Info.Title = "BlazorBoilerplate";
//-:cnd:noEmit
#if ServerSideBlazor
document.Info.Description = "Blazor Boilerplate / Starter Template using the Server Side Version";
#endif
//-:cnd:noEmit
//-:cnd:noEmit
#if ClientSideBlazor
document.Info.Description = "Blazor Boilerplate / Starter Template using the Client Side / Webassembly Version.";
#endif
//-:cnd:noEmit
};
});

Expand Down Expand Up @@ -350,6 +356,7 @@ public void ConfigureServices(IServiceCollection services)

services.AddSingleton(autoMapper);

//-:cnd:noEmit
#if ServerSideBlazor

services.AddScoped<IAuthorizeApi, AuthorizeApi>();
Expand Down Expand Up @@ -390,6 +397,7 @@ public void ConfigureServices(IServiceCollection services)
services.AddScoped<AuthenticationStateProvider, IdentityAuthenticationStateProvider>();

#endif
//-:cnd:noEmit

Log.Logger.Debug($"Total Services Registered: {services.Count}");
foreach (var service in services)
Expand Down Expand Up @@ -421,9 +429,11 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
//-:cnd:noEmit
#if ClientSideBlazor
app.UseWebAssemblyDebugging();
#endif
//-:cnd:noEmit
}
else
{
Expand All @@ -434,9 +444,11 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
app.UseHttpsRedirection();
app.UseStaticFiles();

//-:cnd:noEmit
#if ClientSideBlazor
app.UseBlazorFrameworkFiles();
#endif
//-:cnd:noEmit

app.UseRouting();
//app.UseAuthentication(); //Removed for IS4
Expand All @@ -457,12 +469,14 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
// new SignalR endpoint routing setup
endpoints.MapHub<Hubs.ChatHub>("/chathub");

//-:cnd:noEmit
#if ClientSideBlazor
endpoints.MapFallbackToFile("index_csb.html");
#else
endpoints.MapBlazorHub();
endpoints.MapFallbackToPage("/index_ssb");
#endif
//-:cnd:noEmit
});

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
},
"ConnectionStrings": {
"DefaultConnection": "Data Source=.\\SQLEXPRESS2014;Initial Catalog=blazor_boilerplate;Trusted_Connection=True;MultipleActiveResultSets=true"
"DefaultConnection": "Data Source=.\\SQLEXPRESS2014;Initial Catalog=BlazorBoilerplate;Trusted_Connection=True;MultipleActiveResultSets=true"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"ConnectionStrings": {
"PostgresConnection": "host=localhost;database=blazor_boilerplate;user id=postgres;password=password123",
"DefaultConnection": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=blazor_boilerplate;Trusted_Connection=True;MultipleActiveResultSets=true",
"PostgresConnection": "host=localhost;database=BlazorBoilerplate;user id=postgres;password=password123",
"DefaultConnection": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=BlazorBoilerplate;Trusted_Connection=True;MultipleActiveResultSets=true",
"SqlLiteConnectionFileName": "data.db"
},

Expand Down Expand Up @@ -43,7 +43,7 @@
},

"EmailConfiguration": {
"FromName": "Blazor Boilerplate",
"FromName": "BlazorBoilerplate Team",
"FromAddress": "[email protected]",
"ReplyToAddress": "[email protected]",
"SmtpServer": "smtp.gmail.com",
Expand Down
Loading

0 comments on commit e51b812

Please sign in to comment.