You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

stoicdreams.blazorframework

Package Overview
Dependencies
Maintainers
0
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

stoicdreams.blazorframework

0.8.186
unpublished
nugetNuGet
Maintainers
0
Source

Stoic Dreams Blazor Framework

The purpose of this Framework project is to eliminate common setup and boilerplate when creating a new website. Specifically in this case a client-only Blazor project.

This framework includes pre-built static files, such as index.html, along with a common library of .razor components and c# classes.

Setting up the Framework

Setting up your .csproj file to include required static files in your deployments

This project includes some basic front-end files that will behave as your site initiator.

To include these files, add the following snippet to your Project.csproj file.

<ItemGroup>
	<Content Update="wwwroot\**\*">
		<CopyToPublishDirectory>Always</CopyToPublishDirectory>
	</Content>
</ItemGroup>

<ItemGroup>
	<Content Update="$(PkgStoicDreams_BlazorFramework)\content\**\*">
		<CopyToOutputDirectory>Always</CopyToOutputDirectory>
		<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
	</Content>
</ItemGroup>

Settings File

Add a AppSettings.cs (IAppSettings interface) file to your project and include with dependency injection in your Startup.cs or Program.cs file.

App.razor file

In your App.razor file, which is the entrypoint for your Blazor content, you will need to wrap your app content with StoicDreamsApp tag.

<StoicDreamsFrameworkEntry AppAssembly="@typeof(App).Assembly">
	<HeaderQuickLinksLeft></HeaderQuickLinksLeft>
	<HeaderQuickLinksMiddle></HeaderQuickLinksMiddle>
	<HeaderQuickLinksRight></HeaderQuickLinksRight>
	<NavRenderAfterHome></NavRenderAfterHome>
	<NavRenderAfterLogin></NavRenderAfterLogin>
	<NavRenderMenuOnly></NavRenderMenuOnly>
</StoicDreamsFrameworkEntry>

Setup your index.html file

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<title></title>
	<base href="/" />
</head>
<body>
	<app id="app" class="faded"></app>
	<script src="https://cdn.myfi.ws/i/appstartup.js"></script>
	<script src="_framework/blazor.webassembly.js"></script>
</body>
</html>

Site.css file

Add a file /wwwroot/css/site.css to your project and include any overwrites you want

Overwrite color variables

:root {
	--primary-dark: #000000;
	--primary-glass: rgba(0,0,0,0.7);
	--primary-light: #FFFFFF;
	--splash-primary: #000000;
	--splash-glass: rgba(0,0,0,0.7);
	--splash-secondary: #FFFFFF;
	--color-dark: #333;
	--color-light: #FFF;
	--color-link: #c0ffff;
	--primary-button: #15771a;
	--primary-button-offset: #FFF;
	--active-button-background: #111;
	--active-button-color: #EEE;
	--glass-light: rgba(255,255,255,0.7);
	--glass-dark: rgba(0,0,0,0.7);
	--primary-page: #2626A8;
	--color-page: #FFFFFF;
}

Local Development

Set API to localhost endpoint

This framework allows overriding the api endpoint used from within the browser.

  • Launch the API endpoint in your local environment and get the url for the root domain.
  • Open the website. Navigate to the privacy and opt-in to one of the storage options.
  • Run one of these commands in the console window to update your browser storage.
    • sessionStorage.setItem('apirooturl', '"https://localhost:7071/api/"')
    • localStorage.setItem('apirooturl', '"https://localhost:7071/api/"')

Author

  • Erik Gassler - Just a simpleton who likes making stuff with bits and bytes. Visit my Patreon page if you would like to provide support.

Keywords

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.