TypedBlazor is a showcase implementation of Blazor Server combined with TypeScript and Node.js.
This project demonstrates how to use TypeScript to write strongly-typed code for Blazor components and services using JSInterop.
It utilizes the P5.js library alongside TypeScript to create a simple drawing application, benefiting from TypeScript's type checking, IntelliSense, and refactoring capabilities through the @types/p5 library.
- Strongly Typed Scripts: Leverage TypeScript for strongly typed scripts to ensure type safety and enhance development efficiency.
- Node.js and NPM Integration: Use Node.js with NPM for managing library type definitions and TypeScript dependencies.
- Webpack Bundling: Employ Webpack for bundling and minifying TypeScript code, essential for Blazor.
- .NET 8.0: Ensure you have .NET 8.0 installed.
- Node.js with NPM: Install Node.js along with NPM for managing dependencies.
To set up the project using Docker, follow these steps:
- Generate HTTPS development certificates:
dotnet dev-certs https -ep "$env:USERPROFILE\.aspnet\https\TypedBlazor.pfx" -p "mysupersecretpassword" --trust
- Build and start the Docker containers:
docker compose up --build
Here is an example of what the application looks like: