blockend
Blockend
Source-First Backend Toolkit

Production backend code blocks, generated into your project.

Rate limiting, validation, logging, and error handling — generated as pure TypeScript files you read, edit, and own.

$npx blockend-cli add rate-limiter
src/blocks/rate-limiter.ts
Zero Runtime Dep100% Strict TypeScript
// GENERATED FILE: src/blocks/rate-limiter.ts
// Owned by your repository. Zero black-box wrapper dependencies.

import { Request, Response, NextFunction } from 'express';

export interface RateLimitOptions {
  windowMs: number;
  maxRequests: number;
}

export function createRateLimiter(options: RateLimitOptions) {
  const hits = new Map<string, { count: number; resetTime: number }>();

  return (req: Request, res: Response, next: NextFunction) => {
    const ip = req.ip || '127.0.0.1';
    const now = Date.now();
    const record = hits.get(ip) || { count: 0, resetTime: now + options.windowMs };

    if (now > record.resetTime) {
      record.count = 0;
      record.resetTime = now + options.windowMs;
    }

    record.count++;
    hits.set(ip, record);

    if (record.count > options.maxRequests) {
      return res.status(429).json({ error: 'Too Many Requests' });
    }

    next();
  };
}

Designed for backend teams building modern TypeScript services.

Compatible with Express, Fastify, Hono, and Next.js backend layers.

Essential OnlyNPM Dependencies
100%Source Owned
The Problem

Stop relying on black-box middleware dependencies.

  • Boilerplate Redundancy

    Every new backend microservice requires rewriting rate limiting, error classes, loggers, and header parsers from scratch.

  • Node_Modules Lock-in

    Key infrastructure logic ends up buried inside deeply nested external packages, making minor tweaks impossible.

  • Opaque Stack Traces

    Production failures force developers to step through foreign package code rather than inspecting clean local files.

  • Inconsistent Conventions

    Different developers implement error handling and logging differently, fragmenting the architecture across teams.

Workflow

Three commands to clean, native backend blocks.

  1. 01
    Initialize Blockend in your repository.

    Configure your target backend framework (Express, Fastify, Hono, Next.js) and custom block output path.

    $npx blockend-cli init
  2. 02
    Add production blocks on demand.

    Blockend fetches the block template and generates idiomatic TypeScript source files tailored to your framework.

    $npx blockend-cli add rate-limiter
  3. 03
    Commit code directly to Git.

    Read, audit, and customize the generated files inside your project. The code belongs entirely to you.

    $git add src/blocks/
Output Structure

Real TypeScript files in your workspace.

Blockend generates clear, commented TypeScript files inside your project structure. Every file includes framework adapters, strict types, and usage examples.

  • Pragmatic Dependencies: Imports external packages only for security-critical tasks (JWT, Zod).
  • Framework Native: Emits typed handlers for Express, Fastify, Hono, & Next.js.
  • Fully Editable: Rename options, modify algorithms, or adjust log shapes instantly.
Workspace File Tree
Project Root
my-backend-service/
src/
blocks/Generated Source
  • rate-limiter.ts2.1 KB
  • error-handler.ts1.8 KB
  • logger.ts1.4 KB
  • request-validator.ts2.8 KB
server.ts
package.json
System Properties

Engineered for code ownership and maintainability.

  • Complete Source Ownership

    You own every generated block. Tweak logic, rename variables, or extend algorithms directly inside your codebase.

  • Framework Awareness

    Generates native request contexts and middleware signatures for Express, Fastify, Hono, and Next.js.

  • Pragmatic Dependency Tree

    Uses npm dependencies exclusively for non-negotiable security tasks like JWT verification or schema validation.

  • Strict Type Safety

    Written with strict TypeScript type definitions, generic parameters, and explicit return types.

  • High Code Legibility

    Cleanly formatted, idiomatic code designed for fast code reviews and immediate developer comprehension.

  • Production Defaults

    Pre-configured with industry standard defaults for security headers, graceful termination, and structured logs.

Catalog

Production blocks ready for generation.

Browse Full Catalog
  • Token Service
    Security

    JWT access tokens and rotating opaque refresh tokens with pinned keys and shared stores.

    Framework-agnosticNode >=20v1.0.0Sep 27, 2026
    blockend-cli add token-service
  • Password Hashing
    Security

    Argon2id password hashing with HMAC-SHA256 peppering, automatic salting, and rehash detection.

    Framework-agnosticNode >=20v1.0.0Aug 27, 2026
    blockend-cli add password-hash
  • Idempotency
    Reliability

    Exactly-once request execution with pluggable stores and cache, plus an Express adapter

    express, fastify, honoNode >=20v1.0.0Aug 16, 2026
    blockend-cli add idempotency
  • Graceful Shutdown
    Runtime

    Dependency-free graceful shutdown with in-flight request draining and per-framework adapters

    express, fastify, honoNode >=20v1.0.0Aug 7, 2026
    blockend-cli add graceful-shutdown
  • System Health Check Monitoring
    Ops

    Framework-agnostic health assessment suite.

    express, fastify, honoNode >=20v1.0.0Jul 20, 2026
    blockend-cli add health-check
  • Environment Configuration
    Config

    Type-safe environment variable validation using Zod.

    Framework-agnosticNode >=20v1.0.0Jul 14, 2026
    blockend-cli add env-config
  • Response Formatter
    Response

    Framework-agnostic API response formatting.

    express, hono, fastifyNode >=20v1.0.0Jul 7, 2026
    blockend-cli add response-formatter
  • Request Validator
    Validation

    Framework-agnostic request validation powered by Zod.

    express, hono, fastifyNode >=20v1.0.0Jul 3, 2026
    blockend-cli add request-validator

Showing 8 of 11 blocks · sorted by release date · view full catalog

Ecosystem
Native support across HTTP frameworks.

Blockend tailors type definitions and middleware patterns for your preferred stack.

  • Express
  • Fastify
  • Hono/node-server
Model Context Protocol

Scaffold your infrastructure with natural language.

Blockend includes an MCP server. AI assistants (Cursor, Claude, Windsurf) can query the block catalog, inspect signatures, and generate middleware stacks directly into your repository.

  • Discover Blocks: Live catalog capability discovery for AI.
  • Accurate Generation: Eliminates AI import hallucinations.
  • Automated Adapters: Automatic framework detection.
MCP Agent Session
Cursor / Claude Desktop
"Add rate limiting to my Hono API with custom 429 status code."

Executing Tool: blockend_add_block

Target detected: Hono framework

Generated: src/blocks/rate-limiter.ts

Context: Typed middleware registered

Roadmap

Roadmap & Vision

Now

Core Blocks

Validation, errors, logging, health, shutdown, and response formatting.

Next

Framework Coverage

Refine adapters for Express, Fastify, and Hono.

Next

Security Blocks

JWT, password hashing, CORS, headers, idempotency, and env config.

Later

Starter Kits

SaaS and API starters built from Blockend blocks.

Blockend generates source-first backend code directly into your repository, so you own, inspect, and extend every block.

manifesto // architectural_design

Frontend figured this out years ago.

shadcn/ui proved that developers don't want another dependency—they want raw source control in their own repository to wrap their custom business logic around. Backend infrastructure deserves the exact same approach. No locked black boxes.

  • layer directive
    Read it

    No compiled output to trust blindly. The implementation is sitting right there in your editor.

  • layer directive
    Debug it

    Stack traces point into your own files, not three layers deep in node_modules.

  • layer directive
    Outgrow it

    Refactor or rip it out whenever your architecture changes. Nothing else in your stack depends on it.

production // security_observability

Production-minded from the start.

Blockend is built with real-world backend systems in mind. We use established security and observability tools to continuously improve the reliability and quality of the project.

FAQ

Frequently Asked Questions

Own your backend code.

Generate your first block in seconds and experience pure source code ownership.

$npx blockend-cli init
;