Tag

Development

49 articles tagged with Development.

Front end

Replacing Disqus with Giscus

Move a blog's comments from Disqus to Giscus and GitHub Discussions: why, the setup, a React component that loads on demand and follows the site's theme, the Content Security Policy and a test.

4 min read

Security

Cookie consent on a static blog

Measure the cookies a static site really sets, see what the rules ask of a blog, and load Google Analytics only after consent, with a small store, a fair banner and tests that check it.

7 min read

Security

A Content Security Policy for an Astro site

Add a Content Security Policy to a static Astro site with security.csp: hashed inline scripts, third parties, why strict-dynamic broke the islands, and tests that fail on any violation.

5 min read

Front end

Tailwind CSS 3 to 4: what the upgrade tool does not catch

Twelve differences found by comparing a site pixel by pixel before and after moving to Tailwind CSS 4: borders, line heights, cascade layers, table cells, stacking, colours.

6 min read

Testing

Moving a blog from Gatsby to Astro without a regression

How this blog moved from Gatsby to Astro with the same URLs, HTML and behaviour, and how we proved it: an HTML oracle, pixel diffs and interaction tests on both builds.

6 min read

Architecture

Expose your ASP.NET Core API as an MCP server

Learn how to let agents read and change what their user can through an MCP server in ASP.NET Core, with OAuth, scopes, a per-organization switch and rate limits.

8 min read

Architecture

An AI gateway for your SaaS in ASP.NET Core: one path to the model

Learn how to route every AI call of an ASP.NET Core application through one gateway that checks the organization's switch, the person's allowance and writes a usage ledger.

7 min read

Security

SSO and SCIM 2.0 for a B2B SaaS in ASP.NET Core

Learn how to let each customer sign in through its own identity provider and provision its people with SCIM 2.0, in ASP.NET Core, with no third-party service.

8 min read

Security

GDPR data export and account erasure in an ASP.NET Core SaaS

Learn how to implement a GDPR data export and a real account erasure in a modular ASP.NET Core application, without breaking domain boundaries or other people's history.

7 min read

Architecture

A billing module behind an adapter: Stripe that runs unconfigured

Learn how to keep Stripe inside one billing module in ASP.NET Core, with its own DbContext, a payment-gateway port and an adapter that lets the app run with no key at all.

8 min read

Testing

End-to-end tests of a distributed .NET app with Aspire.Hosting.Testing

Learn how to run Gherkin scenarios against your real Aspire graph, gateway, identity server and RabbitMQ included, in a couple of minutes and without a browser.

8 min read

Messaging

Signed outgoing webhooks in ASP.NET Core

Learn how to send signed outgoing webhooks from ASP.NET Core: a stable envelope, an HMAC signature a subscriber can verify, durable retries, delivery history and redelivery.

7 min read

Messaging

Server-sent events with ASP.NET Core and Angular: a frame is a signal, never the data

Learn how to push real-time updates from ASP.NET Core to Angular with server-sent events, across several replicas, without a dropped frame ever showing a wrong screen.

7 min read

Security

An audit log that can't lie: building one in ASP.NET Core with the outbox

Learn how to build an ASP.NET Core audit log that records a change if and only if it committed, and an architecture test that keeps it complete as the product grows.

8 min read

Data

A migration runner instead of Database.Migrate() at startup

Learn how to move EF Core migrations out of your services and into a small worker that runs once, exits, and gates everything else.

7 min read

Security

A strict Content Security Policy for an Angular SPA served by ASP.NET Core

Learn how to send a real Content Security Policy from ASP.NET Core in front of an Angular application, and which concessions you cannot avoid.

7 min read

Messaging

Idempotent message handlers in .NET: deterministic IDs from the message ID

Learn how to make a .NET message handler idempotent by deriving the ids of the rows it writes from the id of the message it consumes.

7 min read

Testing

Visual review for an Angular app: a Playwright gallery of every page

Learn how to build a Playwright gallery that photographs every route of an Angular app, in both themes and three widths, so a human can review the layout unit tests never see.

7 min read

Security

Personal access tokens in ASP.NET Core: reference tokens, not hashes

Learn how to give users personal access tokens for their scripts and agents, minted by OpenIddict as reference tokens and introspected by an ASP.NET Core API.

7 min read

Data

Optimistic concurrency with PostgreSQL xmin in EF Core

Learn how to let exactly one of several writers win the same row, without locks, using PostgreSQL's xmin column as an EF Core concurrency token, plus a claim and a lease.

7 min read

Data

Caching authenticated API responses in ASP.NET Core without leaking data

Learn how to cache authenticated responses in an ASP.NET Core API without serving one user's data to another, or to a user whose access was revoked.

7 min read

Front end

Building overlays on the Angular CDK: tooltip, drawer and menu

Learn how to build accessible, well-positioned and themeable tooltips, drawers and menus on the Angular CDK, and which CDK primitive fits each one.

7 min read

Testing

Testing EF Core repositories on a real PostgreSQL with Testcontainers

Learn how to test EF Core repositories against a real PostgreSQL started by Testcontainers, with the real migrations and one DbContext each to arrange, act and assert.

7 min read

Security

SSRF-proof outgoing HTTP calls in .NET: resolve, check, then connect

Learn how to call URLs your users type (webhooks, imports, metadata documents) without letting them reach your own network, with a SocketsHttpHandler that checks the address it actually connects to.

8 min read

Architecture

Architecture tests that fail the build: keeping a .NET solution honest

Learn how to turn the boundaries of a .NET solution into tests that read the compiled assemblies, so that a wrong reference fails the build instead of a code review.

7 min read

Front end

Runtime theming in Angular with CSS tokens and Tailwind CSS 4

Learn how to change the accent colour and switch dark mode at runtime in an Angular application, with CSS custom properties, Tailwind CSS 4 and a contrast check that keeps every colour legible.

7 min read

Architecture

Separating reads and writes in ASP.NET Core without MediatR

Learn how to split an ASP.NET Core API into a read side and a write side with plain interfaces, projections and a result type, chosen by HTTP verb, with no mediator in between.

8 min read

C# & .NET

The AddStandardResilienceHandler trap: when Aspire's defaults retry a POST you shouldn't

Learn why Aspire's ServiceDefaults add retries, a circuit breaker and service discovery to every HttpClient, and how to take them off a client that calls URLs your users chose.

7 min read

Messaging

Replacing MassTransit with Wolverine: keep the bus library in one project

Learn how to put your message bus behind ports and adapters, so that replacing MassTransit with Wolverine means rewriting one adapter instead of every domain.

8 min read

Front end

Just use <input type="date">: a date control for Angular without a library

Learn how to build an accessible, mobile-friendly date field in Angular on the native input, with dark mode, min/max, reactive forms and a date range.

7 min read

Messaging

Domain events vs integration events in .NET, and the transactional outbox

Learn the difference between domain events and integration events in .NET, and how a transactional outbox on EF Core and PostgreSQL makes an event exist if and only if the change committed.

7 min read

Security

Moving from Duende IdentityServer to OpenIddict in ASP.NET Core

Learn how to replace Duende IdentityServer with OpenIddict while keeping the same OpenID Connect shape for your gateway, your API and your other clients.

8 min read

Data

Strongly typed IDs in C# with EF Core and PostgreSQL

Learn how to replace primitive int keys with strongly typed IDs in C#, and wire them into EF Core, HiLo sequences on PostgreSQL and your API controllers.

7 min read

Security

Keep the access token out of the browser: a BFF for Angular with ASP.NET Core and YARP

Learn how to build a Backend-for-Frontend with ASP.NET Core and YARP so that your Angular application never holds an access token.

8 min read

Architecture

Hexagonal architecture in .NET: going beyond Clean Architecture

Learn how to move from a layered Clean Architecture to ports and adapters in .NET, with one project per domain and explicit doors between domains.

8 min read

Tooling

Introducing HTTP File Generator: Generate .http Files from OpenAPI Specifications

Turn an OpenAPI specification into ready-to-run .http files in the browser: what the tool generates, how to use it and how to run it locally.

3 min read

Security

Implementing Rate Limiting Middleware in ASP.NET Core

Learn how to configure ASP.NET Core's built-in rate limiting in .NET 10: the four algorithms, per-client partitions, a global limiter and 429 responses.

7 min read

C# & .NET

Validating requests with FluentValidation

Learn how to validate ASP.NET Core requests with FluentValidation 12, in a controller and in a Minimal API endpoint filter, and return standard problem details.

7 min read

Architecture

Introduction to Clean Architecture

Learn the four rings of Clean Architecture and how to apply them in a small .NET 10 Web API, with use cases, a repository port and request records.

7 min read

Front end

Enhancing User Experience with track in Angular

Choose the right track expression for Angular's @for block, measured in the DOM, to avoid recreating list rows and losing their state.

6 min read

Tooling

Configure Husky with Angular

Run lint-staged (ESLint and Prettier) and commitlint before every commit in an Angular 22 project with Husky 9 Git hooks.

6 min read

Tooling

Configure ESLint with Angular

Add ESLint to an Angular 22 project with ng add angular-eslint, understand the generated flat config and lint and fix your TypeScript and templates.

4 min read

Tooling

Configure Prettier with Angular

Configure the Prettier that the Angular CLI installs, format Angular templates with the angular parser, ignore files and add format scripts.

5 min read

Front end

Install Angular Material in an Angular project

Install Angular Material 22 in a standalone Angular 22 project, understand the Material 3 theme that ng add generates and add your first Material button.

5 min read

Testing

Introduction to BenchmarkDotNet

Learn how to write, run and read a BenchmarkDotNet benchmark in .NET 10, with parameters, setup and memory diagnostics.

6 min read

C# & .NET

Using nullable reference types in C# projects

How nullable reference types let the C# compiler catch null references: enabling them, the ? and ! operators, [NotNullWhen], #nullable and warnings as errors.

4 min read

C# & .NET

Some features of C# 8.0 to reduce our code

Switch expressions, property and tuple patterns, using declarations, ??= and indices and ranges: the C# 8.0 features that make code shorter and clearer.

4 min read

C# & .NET

Difference between const and readonly in C#

What really separates const from readonly in C#: which types each accepts, where it can be declared, and why a public const can go stale across assemblies.

3 min read

Architecture

Introduction to S.O.L.I.D principles

The five SOLID principles of object-oriented design, applied one after the other to a single C# example: a product catalog that computes prices with VAT.

7 min read