Skip to content

Commit

Permalink
replace refs to old blazor-server + blazor-tailwind templates
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Dec 13, 2023
1 parent 63f2c60 commit 64afc9d
Show file tree
Hide file tree
Showing 24 changed files with 121 additions and 324 deletions.
2 changes: 0 additions & 2 deletions MyApp/_pages/_includes/web-new-netcore.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
|----------------------------------------------------------------------------|---------------------------------------------------------------------|
| [angular-spa](https://github.com/NetCoreTemplates/angular-spa) | .NET 8 Angular 15 App with Bootstrap |
| [blazor](https://github.com/NetCoreTemplates/blazor) | .NET 8 Blazor Tailwind App Template |
| [blazor-server](https://github.com/NetCoreTemplates/blazor-server) | .NET 8 Blazor Server App with Tailwind |
| [blazor-tailwind](https://github.com/NetCoreTemplates/blazor-tailwind) | .NET 8 Blazor WASM App with Tailwind |
| [blazor-vue](https://github.com/NetCoreTemplates/blazor-vue) | .NET 8 Blazor Static Rendered Vue interactivity App with Tailwind |
| [blazor-wasm](https://github.com/NetCoreTemplates/blazor-wasm) | .NET 8 Blazor WASM App with Bootstrap |
| [empty](https://github.com/NetCoreTemplates/empty) | .NET 8 Empty Single Project App |
Expand Down
6 changes: 3 additions & 3 deletions MyApp/_pages/admin-ui-users.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Plugins.Add(new AdminUsersFeature());
```

<div class="not-prose">
<a href="https://blazor-tailwind-api.jamstacks.net/admin-ui">
<a href="https://razor-pages.web-templates.io/admin-ui">
<h3 class="text-center font-medium text-3xl mb-3">/admin-ui/users</h3>
<div class="block p-4 rounded shadow hover:shadow-lg">
<img src="/img/pages/admin-ui/users.png">
Expand All @@ -37,7 +37,7 @@ An `IAuthRepository` is a required registered dependency to be able to use the `
By default, the Add and Edit Users forms contains the default layout of common properties in [UserAuth.cs](https://github.com/ServiceStack/ServiceStack/blob/master/src/ServiceStack/Auth/UserAuth.cs)

<div class="flex justify-center py-8">
<a href="https://blazor-tailwind-api.jamstacks.net/admin-ui/users?edit=2">
<a href="https://razor-pages.web-templates.io/admin-ui/users?edit=2">
<img src="/img/pages/admin-ui/users-edit-default.png" style="max-width:800px;">
</a>
</div>
Expand Down Expand Up @@ -124,7 +124,7 @@ appHost.Plugins.Add(new ServiceStack.Admin.AdminUsersFeature {
Enabling the use of custom properties as well as formatting for ease of use. `UserFormLayout` updates the `Create` and `Edit` screens in the Admin UI.

<div class="flex justify-center py-8">
<a href="https://blazor-tailwind-api.jamstacks.net/admin-ui/users?edit=2">
<a href="https://razor-pages.web-templates.io/admin-ui/users?edit=2">
<img src="/img/pages/admin-ui/users-edit-custom.png" style="max-width:800px;">
</a>
</div>
Expand Down
55 changes: 0 additions & 55 deletions MyApp/_pages/blazor-diffusion.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,58 +294,3 @@ public class ImageDetails
- Write Files to R2
- Recalculating temporal scores and ranking of Artifacts and Albums
- Recording Analytics
- Prerendering pages at runtime

### Prerendering Blazor Pages at runtime

The [current prerendering solution](https://blazor-tailwind.jamstacks.net/docs/prerender) built into the Blazor WASM template follows the [JAMStack](https://jamstack.org/) approach of pre-rendering pages at build time, however in order to keep the home page "fresh" and show the newest & most liked images first we needed a solution that pre-renders pages at runtime and publishes them to R2 object storage where the Blazor WASM static assets are deployed to.
This feature is implemented in [Configure.Ui.cs](https://github.com/NetCoreApps/BlazorDiffusion/blob/main/BlazorDiffusion/Configure.Ui.cs) where it lets you specify the pages to render, any custom parameters and where to save it:
```csharp
container.Register<IPrerenderer>(c => new Prerenderer
{
BaseUrl = appConfig.BaseUrl,
VirtualFiles = virtualFiles,
PrerenderDir = "/prerender",
Renderer = c.Resolve<IComponentRenderer>(),
Pages = {
new(typeof(Pages.Index), "/index.html", new() { [nameof(Pages.Index.LazyLoad)] = "false" }),
new(typeof(Pages.Albums), "/albums.html", new() { [nameof(Pages.Index.LazyLoad)] = "false" }),
}
});
```

To avoid a dependency to bUnit in our App we've created a new `ComponentRenderer` to render Blazor components to string that's useful if needing to render a Blazor Component to HTML in an API, e.g. you can create a generic API to render any component with:

```csharp
[Route("/render/{Type}")]
public class RenderComponent : IGet, IReturn<string>
{
public string Type { get; set; }
}

//...
public async Task<object> Any(RenderComponent request)
{
var componentType = GetComponentType(request.Type); //TODO resolve Component Type from Name
var httpContext = ((NetCoreRequest)Request).HttpContext;
var args = Request.GetRequestParams().ToObjectDictionary();
var renderer = new ComponentRender();
var html = await renderer.RenderComponentAsync(componentType, httpContext, args);
return html;
}
```

Where it will populate a component instance from a QueryString then render it to string that can be called like:

/render/MyPage?Param1=A&Param2=B

Or if needing to render a component outside of a HTTP Context (e.g. in a Background Task or Console App), you can create a empty HttpContext with the new `HttpContextFactory`, e.g:

```csharp
var testContext = HttpContextFactory.CreateHttpContext(baseUrl);
var renderer = new ComponentRender();
var html = await renderer.RenderComponentAsync(componentType, testContext, args);
```
16 changes: 8 additions & 8 deletions MyApp/_pages/blazor-litestream.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ This can be used directly below to create a new Blazor Tailwind project directly
<section class="not-prose my-20 text-center">
<div class="flex">
<div class="flex flex-1 flex-col items-center">
<a href="https://account.servicestack.net/archive/NetCoreTemplates/blazor-tailwind?Name=MyApp&Mix=blazor-litestream-aws">
<a href="https://account.servicestack.net/archive/NetCoreTemplates/blazor?Name=MyApp&Mix=blazor-litestream-aws">
<img src="/img/pages/litestream/aws_square.svg" alt="AWS S3" class="w-44">
</a>
<span class="block text-xl font-medium text-gray-900">
S3 Simple Storage Service
</span>
</div>
<div class="flex flex-1 flex-col items-center">
<a href="https://account.servicestack.net/archive/NetCoreTemplates/blazor-tailwind?Name=MyApp&Mix=blazor-litestream-azure">
<a href="https://account.servicestack.net/archive/NetCoreTemplates/blazor?Name=MyApp&Mix=blazor-litestream-azure">
<img src="/img/pages/litestream/azure_square.svg" alt="Azure Blob Storage" class="w-44">
</a>
<span class="block text-xl font-medium text-gray-900">
Azure Blob Storage
</span>
</div>
<div class="flex flex-1 flex-col items-center">
<a href="https://account.servicestack.net/archive/NetCoreTemplates/blazor-tailwind?Name=MyApp&Mix=blazor-litestream-sftp">
<a href="https://account.servicestack.net/archive/NetCoreTemplates/blazor?Name=MyApp&Mix=blazor-litestream-sftp">
<img src="/img/pages/litestream/sftp.png" alt="SFTP" class="w-44">
</a>
<span class="block text-xl font-medium text-gray-900">
Expand All @@ -65,8 +65,8 @@ Since Litestream is tied to deployment, hosting environment & preferred configur
| Project Template | AWS S3 | Azure Blob Storage | SFTP (generic) |
|----------------------|-------------------------|---------------------------|--------------------------|
| **web** | litestream-aws | litestream-azure | litestream-sftp |
| **blazor-server** | blazor-litestream-aws | blazor-litestream-azure | blazor-litestream-sftp |
| **blazor-tailwind** | blazor-litestream-aws | blazor-litestream-azure | blazor-litestream-sftp |
| **blazor** | blazor-litestream-aws | blazor-litestream-azure | blazor-litestream-sftp |
| **blazor-vue** | blazor-litestream-aws | blazor-litestream-azure | blazor-litestream-sftp |
| **blazor-wasm** | blazor-litestream-aws | blazor-litestream-azure | blazor-litestream-sftp |
| **vue-ssg** | jamstack-litestream-aws | jamstack-litestream-azure | jamstack-litestream-sftp |
| **vue-vite** | jamstack-litestream-aws | jamstack-litestream-azure | jamstack-litestream-sftp |
Expand Down Expand Up @@ -117,7 +117,7 @@ A compatibility script can be used for `docker-compose` via the following script

Now that we have our host created with Docker and Docker Compose installed, we need to do some one-off configuration to make it easy to host and deploy our application to it using GitHub Actions and docker-compose.

As a part of the `blazor-tailwind` project template, you will have a file called `nginx-proxy-compose.yml` in the `.deploy` directory. This contains a docker compose configuration to run an NGINX reverse proxy and a companion container to automatically manage TLS certificates via LetsEncrypt.
As a part of the `blazor` project template, you will have a file called `nginx-proxy-compose.yml` in the `.deploy` directory. This contains a docker compose configuration to run an NGINX reverse proxy and a companion container to automatically manage TLS certificates via LetsEncrypt.

```yaml
version: '2'
Expand Down Expand Up @@ -182,7 +182,7 @@ Your Linux host is now ready to deploy to using GitHub Actions.

## GitHub Actions

The Blazor-Tailwind project templates and Litestream mix templates have a `release.yml` GitHub Action workflow to deploying your application to a Linux host like the one we just set up.
The Blazor project templates and Litestream mix templates have a `release.yml` GitHub Action workflow to deploying your application to a Linux host like the one we just set up.
This workflow uses SSH access to remotely copy files and execute `docker compose` commands on the remote host.

Docker images are stored on GitHub Container Repository packages, and pulled down on the remote host during deployment.
Expand All @@ -199,7 +199,7 @@ To get this working, repository secrets in your GitHub repository need to be pop
| LETSENCRYPT_EMAIL | Email address where you want notifications to go specifically related to this application domain | me@email.com |
| AWS_S3_BUCKET | An S3 bucket name where Litestream will be replicating data | my-s3-bucket-name |
| AWS_ACCESS_KEY_ID | The key ID for programmatic access to AWS with read/write access to the S3 bucket | |
| AWS_SECRET_ACCESS_KEY | The access key for programmatic access to AWS with read/write access to the S3 bucket |
| AWS_SECRET_ACCESS_KEY | The access key for programmatic access to AWS with read/write access to the S3 bucket |

These repository secrets can be added by using the GitHub repository under `Settings`, `Secrets`, `Actions`.

Expand Down
2 changes: 1 addition & 1 deletion MyApp/_pages/javascript-add-servicestack-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ to override any server defaults.
Date: 2023-02-08 13:13:28
Version: 6.60
Tip: To override a DTO option, remove "//" prefix before updating
BaseUrl: https://blazor-server.jamstacks.net
BaseUrl: https://blazor.web-templates.io
//AddServiceStackTypes: True
//AddDocAnnotations: True
Expand Down
4 changes: 2 additions & 2 deletions MyApp/_pages/litestream-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ Below is a table matching project templates to mix templates including different
| Project Template | AWS S3 | Azure Blob Storage | SFTP (generic) |
|----------------------|-------------------------|---------------------------|--------------------------|
| **web** | litestream-aws | litestream-azure | litestream-sftp |
| **blazor-server** | blazor-litestream-aws | blazor-litestream-azure | blazor-litestream-sftp |
| **blazor-tailwind** | blazor-litestream-aws | blazor-litestream-azure | blazor-litestream-sftp |
| **blazor** | blazor-litestream-aws | blazor-litestream-azure | blazor-litestream-sftp |
| **blazor-vue** | blazor-litestream-aws | blazor-litestream-azure | blazor-litestream-sftp |
| **blazor-wasm** | blazor-litestream-aws | blazor-litestream-azure | blazor-litestream-sftp |
| **vue-ssg** | jamstack-litestream-aws | jamstack-litestream-azure | jamstack-litestream-sftp |
| **vue-vite** | jamstack-litestream-aws | jamstack-litestream-azure | jamstack-litestream-sftp |
Expand Down
4 changes: 2 additions & 2 deletions MyApp/_pages/ormlite/litestream.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ Since Litestream is tied to deployment, hosting environment & preferred configur
| Project Template | AWS S3 | Azure Blob Storage | SFTP (generic) |
|----------------------|-------------------------|---------------------------|--------------------------|
| **web** | litestream-aws | litestream-azure | litestream-sftp |
| **blazor-server** | blazor-litestream-aws | blazor-litestream-azure | blazor-litestream-sftp |
| **blazor-tailwind** | blazor-litestream-aws | blazor-litestream-azure | blazor-litestream-sftp |
| **blazor** | blazor-litestream-aws | blazor-litestream-azure | blazor-litestream-sftp |
| **blazor-vue** | blazor-litestream-aws | blazor-litestream-azure | blazor-litestream-sftp |
| **blazor-wasm** | blazor-litestream-aws | blazor-litestream-azure | blazor-litestream-sftp |
| **vue-ssg** | jamstack-litestream-aws | jamstack-litestream-azure | jamstack-litestream-sftp |
| **vue-vite** | jamstack-litestream-aws | jamstack-litestream-azure | jamstack-litestream-sftp |
Expand Down
64 changes: 31 additions & 33 deletions MyApp/_pages/releases/v5_05.md
Original file line number Diff line number Diff line change
Expand Up @@ -2513,45 +2513,43 @@ These are the only sources `web new` looks at to create ServiceStack projects, w
[NetCoreTemplates](https://github.com/NetCoreTemplates), [NetFrameworkTemplates](https://github.com/NetFrameworkTemplates) and
[NetFrameworkCoreTemplates](https://github.com/NetFrameworkCoreTemplates) GitHub Organizations, whose repos will be listed when running:

$ web new
$ x new

```
.NET Core C# Templates:
1. angular-spa .NET 8 Angular 15 App with Bootstrap
2. blazor .NET 8 Blazor Tailwind App Template
3. blazor-server .NET 8 Blazor Server App with Tailwind
4. blazor-tailwind .NET 8 Blazor WASM App with Tailwind
5. blazor-vue .NET 8 Blazor Static Rendered Vue interactivity App with Tailwind
6. blazor-wasm .NET 8 Blazor WASM App with Bootstrap
7. empty .NET 8 Empty Single Project App
8. grpc .NET 8 gRPC Services
9. mvc .NET 8 MVC Identity Auth App with Tailwind
10. mvc-bootstrap .NET 8 MVC Identity Auth App with Bootstrap
11. mvcauth .NET 8 MVC App with ServiceStack Auth and Bootstrap
12. mvcidentityserver .NET 8 MVC App with ServiceStack and IdentityServer4 Auth
13. nextjs .NET 8 Jamstack Next.js SSG React App with Tailwind
14. razor .NET 8 Razor Pages App with Tailwind
15. razor-bootstrap .NET 8 Razor Pages Identity Auth App with Bootstrap
16. razor-pages .NET 8 Razor Pages App with ServiceStack Auth and Bootstrap
17. razor-press .NET 8 Statically Generated, CDN hostable Razor Pages Documentation
18. razor-ssg .NET 8 Statically Generated, CDN hostable Razor Pages Website
19. react-spa .NET 8 React Create App with Bootstrap
20. script .NET 8 #Script Pages App with Bootstrap
21. selfhost .NET 8 self-hosting Console App
22. svelte-spa .NET 8 Svelte v3 Rollup App with Bootstrap
23. vue-desktop .NET 8 Chromium Vue Desktop App
24. vue-mjs .NET 8 Simple, Modern Vue ServiceStack Auth App with Tailwind
25. vue-nuxt .NET 8 Nuxt.js SPA App with Bootstrap
26. vue-spa .NET 8 Vue App with Bootstrap
27. vue-ssg .NET 8 Jamstack Vue SSG App with Tailwind
28. vue-vite .NET 8 Jamstack Vue Vite App with Tailwind
29. web .NET 8 Empty App
30. web-tailwind .NET 8 Empty App with Tailwind
31. worker-rabbitmq .NET 8 Rabbit MQ Worker Service
32. worker-redismq .NET 8 Redis MQ Worker Service
33. worker-servicebus .NET 8 Azure Service Bus MQ Worker Service
34. worker-sqs .NET 8 AWS SQS MQ Worker Service
3. blazor-vue .NET 8 Blazor Static Rendered Vue interactivity App with Tailwind
4. blazor-wasm .NET 8 Blazor Server & WebAssembly Interactive Auto App with Tailwind
5. empty .NET 8 Empty Single Project App
6. grpc .NET 8 gRPC Services
7. mvc .NET 8 MVC Identity Auth App with Tailwind
8. mvc-bootstrap .NET 8 MVC Identity Auth App with Bootstrap
9. mvcauth .NET 8 MVC App with ServiceStack Auth and Bootstrap
10. mvcidentityserver .NET 8 MVC App with ServiceStack and IdentityServer4 Auth
11. nextjs .NET 8 Jamstack Next.js SSG React App with Tailwind
12. razor .NET 8 Razor Pages App with Tailwind
13. razor-bootstrap .NET 8 Razor Pages Identity Auth App with Bootstrap
14. razor-pages .NET 8 Razor Pages App with ServiceStack Auth and Bootstrap
15. razor-press .NET 8 Statically Generated, CDN hostable Razor Pages Documentation
16. razor-ssg .NET 8 Statically Generated, CDN hostable Razor Pages Website
17. react-spa .NET 8 React Create App with Bootstrap
18. script .NET 8 #Script Pages App with Bootstrap
19. selfhost .NET 8 self-hosting Console App
20. svelte-spa .NET 8 Svelte v3 Rollup App with Bootstrap
21. vue-desktop .NET 8 Chromium Vue Desktop App
22. vue-mjs .NET 8 Simple, Modern Vue ServiceStack Auth App with Tailwind
23. vue-nuxt .NET 8 Nuxt.js SPA App with Bootstrap
24. vue-spa .NET 8 Vue App with Bootstrap
25. vue-ssg .NET 8 Jamstack Vue SSG App with Tailwind
26. vue-vite .NET 8 Jamstack Vue Vite App with Tailwind
27. web .NET 8 Empty App
28. web-tailwind .NET 8 Empty App with Tailwind
29. worker-rabbitmq .NET 8 Rabbit MQ Worker Service
30. worker-redismq .NET 8 Redis MQ Worker Service
31. worker-servicebus .NET 8 Azure Service Bus MQ Worker Service
32. worker-sqs .NET 8 AWS SQS MQ Worker Service
.NET Framework C# Templates:
Expand Down
6 changes: 3 additions & 3 deletions MyApp/_pages/releases/v6_00.md
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ Plugins.Add(new AdminUsersFeature());
Now after a restart you'll get an instant UI **Admin** users can use to perform Admin tasks and access protected information at:
<a href="https://blazor-tailwind-api.jamstacks.net/admin-ui">
<a href="https://razor-pages.web-templates.io/admin-ui">
<h3 class="text-center font-medium text-3xl mb-3">/admin-ui</h3>
<div class="block p-4 rounded shadow hover:shadow-lg">
<img src="/img/pages/admin-ui/dashboard.png">
Expand Down Expand Up @@ -803,7 +803,7 @@ As it shares the same backend configuration and `AdminUsersFeature` functionalit
The new implementation does gain a few new tricks courtesy of the UI customizability features in this release. By default the Add and Edit Users forms contains the default layout of common properties in [UserAuth.cs](https://github.com/ServiceStack/ServiceStack/blob/master/src/ServiceStack/Auth/UserAuth.cs)

<div class="flex justify-center py-8">
<a href="https://blazor-tailwind-api.jamstacks.net/admin-ui/users?edit=2">
<a href="https://razor-pages.web-templates.io/admin-ui/users?edit=2">
<img src="/img/pages/admin-ui/users-edit-default.png" style="max-width:800px;">
</a>
</div>
Expand Down Expand Up @@ -868,7 +868,7 @@ Plugins.Add(new AdminUsersFeature {
Where it will display our custom Form Layout in both **New User** and **Edit User** UI Forms:

<div class="flex justify-center py-8">
<a href="https://blazor-tailwind-api.jamstacks.net/admin-ui/users?edit=2">
<a href="https://razor-pages.web-templates.io/admin-ui/users?edit=2">
<img src="/img/pages/admin-ui/users-edit-custom.png" style="max-width:800px;">
</a>
</div>
Expand Down
Loading

0 comments on commit 64afc9d

Please sign in to comment.