explaingit

lets-blade/blade

5,882JavaAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

Blade is a tiny Java web framework under 500KB that lets you build REST APIs and websites with minimal setup, define a route in one line and run the whole app as a single JAR file.

Mindmap

mindmap
  root((blade))
    What it does
      Web framework
      REST routing
      Template rendering
    Tech stack
      Java 8+
      Netty
      Single JAR deploy
    Features
      File uploads
      Session handling
      CSRF protection
      Cron tasks
    Use cases
      REST APIs
      Small web apps
      No-server deploy
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build a lightweight REST API in Java without the overhead of a large framework like Spring Boot.

USE CASE 2

Create a small web app that serves HTML pages using a template engine and handles form submissions.

USE CASE 3

Add scheduled background tasks to a Java web app using cron-style expressions.

USE CASE 4

Deploy a Java web service as a single executable JAR with no separate application server needed.

Tech stack

JavaNettyMaven

Getting it running

Difficulty · easy Time to first run · 30min
Use freely for any purpose, including commercial use, keep the copyright notice and the Apache 2.0 license file.

In plain English

Blade is a lightweight web framework for Java that makes it quick to build websites and web APIs without pulling in a large stack of dependencies. The entire library weighs under 500 kilobytes, which is small by Java standards. It runs on top of Netty, a high-performance networking library, and targets Java 8 and above. The main idea is to reduce the amount of setup and boilerplate code a developer needs to write. A working web server can be started in a single line of Java: define a route, provide a handler, and call start. Routes follow the REST pattern, meaning you define what happens when a browser or app makes a GET, POST, PUT, or DELETE request to a specific URL. Parameters can come from the URL path, query strings, form submissions, or request bodies, and the framework provides clear ways to read each type. Blade also includes built-in support for template engines so you can return HTML pages, basic authentication, cookie and session handling, file uploads and downloads, scheduled tasks using cron-style expressions, and a middleware system for adding logic that runs before or after route handlers. It has some security defaults built in, including protection against CSRF and XSS, two common web attack patterns. Deployment is straightforward: build the project into a single JAR file and run it directly. No separate application server is needed. The project is open source under the Apache 2.0 license and available through Maven Central.

Copy-paste prompts

Prompt 1
Using the Blade framework in Java, write a minimal REST API with GET /users and POST /users endpoints that store users in an in-memory list.
Prompt 2
Show me how to add middleware in Blade that logs every request's HTTP method, URL path, and response time.
Prompt 3
How do I enable CSRF protection in Blade and apply it to a POST form submission endpoint?
Prompt 4
Write a Blade route that accepts a file upload, saves it to a local directory, and returns a JSON response with the saved filename.
Open on GitHub → Explain another repo

← lets-blade on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.