← Winnitude! Search  ·  Reader Mode (882 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 116 LINKS

GitHub - tinystruct/tinystruct.github.io: The documentation for tinystruct framework.

Repository navigation

tinystruct.github.io
Public

About

The documentation for tinystruct framework.

tinystruct.org/

Resources

Readme Activity Custom properties

Stars

0 stars

Watchers

1 watching

Forks

0 forks Report repository
Branches

Tags
Go to Branches page Go to Tags page

Latest commit

 

History


155 Commits
View commit history for this file.

Folders and files

Name Name Last commit message Last commit date
.idea .idea    
_layouts _layouts    
assets/ css assets/ css    
en en    
zh zh    
.gitattributes .gitattributes    
CNAME CNAME    
README.md README.md    
_config.yml _config.yml    
architecture.gif architecture.gif    
create create    
create.ps1 create.ps1    
favicon.ico favicon.ico    
index.html index.html    
llms.txt llms.txt    

Repository files navigation

tinystruct framework Documentation

English | 中文

Welcome to the tinystruct framework documentation. This documentation provides comprehensive guidance for using and developing with the tinystruct framework.

欢迎查阅 tinystruct 框架文档。本文档为使用和开发 tinystruct 框架提供全面的指导。

What's New in v1.8.0

  • Behavior Changes : templates HTML-escape variables by default (use HtmlVariable for trusted markup), only server-issued session ids are accepted (regenerateSession() on login), request bodies over default.http.max_content_length get 413, malformed arguments get 400, Settings.set()/remove() no longer write to disk, and bin/dispatcher exits 1 when an action fails
  • SQL Injection Defense : SQLIdentifier allow-lists table, column and ORDER BY identifiers at every boundary, with SQLInjectionDetector kept as defense in depth and parameterized SQL Server inserts
  • Reliable sql-execute Scripts : stops at the first failing statement, prints rows for queries, and splits scripts with SQLScriptSplitter (comments, quoted identifiers, dollar quotes, DELIMITER)
  • Hardening & Bounded Resources : XXE-safe Document parsing, Host header validation, LRU-bounded Container, bounded HTTP executor, SSE cleanup on disconnect and shutdown
  • Detailed Release Notes : See What's New in 1.8.0 (中文版 )

Previous: v1.7.40 Highlights

  • AI Coding-Agent Instructions & bin/dispatcher agents : Automatically generates AGENTS.md, CLAUDE.md, and the bundled tinystruct-patterns skill (.agents/skills/ and .claude/skills/) when missing in build-file projects; also available via bin/dispatcher agents [--force]
  • Default Auto-Incrementing Application.version() : AbstractApplication.version() now defaults to build-time Git-history versioning via ApplicationVersionGenerator (META-INF/tinystruct-versions.properties)
  • MCP Execution & Schema Hardening : Split MCPTool.ToolMethod into bind() and invoke() to prevent retrying overloads after runtime errors, enabled -parameters for name-based @Argument binding, and hardened required/enum schema validation for JSON-parsed schemas
  • API Modernization & Bug Fixes : Replaced JWTCodec with JWTSerializer/JWTDeserializer (AbstractSerializer/AbstractDeserializer), updated DistributedRedisLock to RedisURI.Builder.withAuthentication(...), and preserved original exception causes in SQLiteGenerator and Watcher
  • Detailed Release Notes : See What's New in 1.7.40 (中文版 )

Previous: v1.7.39 Highlights

  • TokenGuard Pre-Authentication Defense : Added configurable TokenGuard defending against malformed, oversized, or malicious token inputs (length enforcement, whitespace/control char rejection, Base64 padding semantics, and compact JWT RFC 7515/7519 structure verification)
  • Catastrophic Backtracking Mitigation : Configurable token block patterns with a bounded evaluation step budget (50,000 steps) to prevent Regular Expression Denial of Service (ReDoS)
  • HTTP & MCP Security Status Mapping : HttpServer and AuthorizationHandler integrate TokenGuard, returning 400 Bad Request for malformed/oversized tokens, 401 Unauthorized for failed auth, and 403 Forbidden for policy-blocked tokens
  • Template Engine & ClassLoader Portability : Standardized on cross-platform '/' template path separators in AbstractApplication, removed hardcoded Locale.CHINA comparison, added hierarchical ClassLoader resolution fallbacks, and prevented stream leaks with try-with-resources
  • DOM & Core Stability Fixes : Fixed infinite loop in Element.removeElement(String), preserved original IOException causes in Document.load(...), and safely parsed URI user info in ConnectionManager
  • Detailed Release Notes : See What's New in 1.7.39 (中文版 )

Previous: v1.7.38 Highlights

  • Security & Dependency Upgrades : Pinned org.ow2.asm (9.11.1) to resolve CVEs pulled transitively via nashorn-core, and upgraded reactor-core (3.8.8) and sqlite-jdbc (3.54.1.0)
  • JSON Round-Trip & Escaping Fixes : Escaped object keys and quoted lookalike strings in Builder; preserved Boolean/null array literals and unescaped array strings in Builders
  • Faster Lock-File I/O & Configurable Timeouts : Single-read .lock scanning in Watcher plus distributed.lock.timeout and distributed.lock.file.timeout settings (5000 ms default)
  • Concurrency, Logging & App Lifecycle : Eliminated DistributedMessageQueue.take() lock starvation, switched LogFormatter to thread-safe DateTimeFormatter, enabled FileHandler logging by default, cleaned up ApplicationManager.uninstall(), and undeprecated Application.setAction(String, String)
  • Ecosystem & Server Modules Updated : tinystruct-netty-http-server (1.1.12), tinystruct-tomcat-server (1.1.12), tinystruct-undertow-server (1.1.3), tinystruct-workflow (1.0.3), and tinystruct-typesafe (1.0.1)
  • Detailed Release Notes : See What's New in 1.7.38 (中文版 )

Previous: v1.7.37 Highlights

  • Static File Serving Protection : Strict static directory whitelisting (server.static.dirs / server.static.dir); project root files, configs, and sources cannot be downloaded
  • Path Traversal & Alias Mitigation : Rejection of traversal sequences, null bytes, Windows NTFS alternate data streams (::$DATA), and trailing dot/space aliases
  • HTTP Caching & Conditional Requests : Full support for If-Modified-Since (304 Not Modified), Cache-Control, and Expires headers
  • Server Modules Updated : tinystruct-netty-http-server (1.1.11), tinystruct-tomcat-server (1.1.11), and tinystruct-undertow-server (1.1.2)
  • Detailed Release Notes : See What's New in 1.7.37 (中文版 )

Previous: v1.7.36 Highlights

  • Configurable Logging Handlers : handlers property with FileHandler support (rotation, size limit)
  • Hardened MCP Server : Initialization enforced, active sessions kept alive, auth token no longer logged
  • Kafka Client Removed : KafkaClient and Kafka dependencies dropped from the framework
  • Detailed Release Notes : See What's New in 1.7.36 (中文版 )

Previous: v1.7.35 Highlights

  • Dependency Upgrades : Lettuce 7.8.0, H2 2.5.252, Mockito 5.24.0, and Netty BOM 4.2.18.Final
  • CVE Patches : Patched versions of vulnerable transitive dependencies (Netty, zstd-jni, lz4-java, snappy-java, Reactor)
  • Reliable Interrupt Handling : DistributedMessageQueue and AlarmClock now restore the thread interrupt flag
  • Detailed Release Notes : See What's New in 1.7.35 (中文版 )

Previous: v1.7.34 Highlights

  • Annotation-Driven ORM : @Table, @Id and @Column for code-first POJO mapping, with opt-in table auto-creation
  • Enum-Collection Arguments : @Action methods accept List<EnumType> from comma-separated input

Previous: v1.7.30 Highlights

  • PostgreSQL Database Support : Type.PostgreSQL and PostgreSQLServer, including a dedicated POJO generator

Previous: v1.7.29 Highlights

  • Asymmetric RSA & Configurable JWT Security : RSA public/private key pairs and flexible configuration via application.properties
  • Advanced HTTP Server Security : Host header filtering (server.name), path traversal prevention, and secure cookies
  • Decoupled Architecture : Domain-independent HttpServer and SSEPushManager for seamless multi-domain deployments
  • Enhanced MCP & AI Support : Overloaded tool methods, schema merging, idle session watchdogs, and auto-cleanup
  • ANSI Console Logging : Modern color-coded console logs with Java 9+ StackWalker caller tracing
  • Configurable HTTP Timeouts : Custom connect and read timeouts on URLRequest and HTTPHandler
  • High Performance : Handling over 86,000 requests per second with ultra-low latency (~17ms)
  • Full Release Notes : What's New in 1.7.29 (中文版 )

Choose Your Language / 选择语言

English Documentation

中文文档

Quick Start

Using the tinystruct Archetype

The fastest way to get started is using the tinystruct archetype:

# Follow the archetype to create a project quickly
https://github.com/tinystruct/tinystruct-archetype

Manual Installation

Add the dependency to your pom.xml:

<dependency>
    <groupId>org.tinystruct</groupId>
    <artifactId>tinystruct</artifactId>
    <version>1.8.0</version>
    <classifier>jar-with-dependencies</classifier>
</dependency>

Basic Example

package tinystruct.examples;

import org.tinystruct.AbstractApplication;
import org.tinystruct.ApplicationException;
import org.tinystruct.system.annotation.Action;
import org.tinystruct.system.annotation.Action.Mode;

public class Example extends AbstractApplication {

    @Override
    public void init() {
        // Initialization code
    }

    @Override
    public String version() {
        return "1.0";
    }

    @Action("praise")
    public String praise() {
        return "Praise the Lord!";
    }

    @Action("say")
    public String say(String words) {
        return words;
    }

    // HTTP method-specific actions
    @Action(value = "hello", mode = Mode.HTTP_GET)
    public String helloGet() {
        return "GET";
    }

    @Action(value = "hello", mode = Mode.HTTP_POST)
    public String helloPost() {
        return "POST";
    }
}

Why Choose tinystruct?

Modern Design Philosophy

  1. No main() method required - Applications start directly with CLI commands
  2. Unified CLI and Web - Write once, run anywhere (CLI or Web)
  3. Built-in lightweight HTTP servers - Netty, Tomcat, or Undertow
  4. Minimal configuration - No excessive XML or YAML
  5. Performance-first architecture - Zero overhead, no reflection-based scanning
  6. AI-ready - Designed for AI integration with MCP support

Performance Benchmarks

Running 30s test @ http://127.0.0.1:8080/?q=say/Praise the Lord!
12 threads and 400 connections

Requests/sec:  86753.98
Transfer/sec:  17.46MB
Latency:       17.44ms (avg)

Architecture

tinystruct follows a modular, action-oriented architecture that enables:

  • Code reuse between CLI and web applications
  • Unified interface through @Action annotation
  • Plugin-based extensibility
  • Low-latency direct method invocation
  • Flexible deployment options (monolithic, microservices, or hybrid)

Support / 赞助

If tinystruct is useful to you, please consider supporting the project: opencollective.com/tinystruct 如果 tinystruct 对您有帮助,欢迎通过 Open Collective 赞助本项目。

Contributing / 贡献

If you'd like to contribute to this documentation, please: 如果您想为此文档做出贡献,请:

  1. Fork the repository / 复刻仓库
  2. Create a new branch for your changes / 创建新的分支
  3. Submit a pull request with your improvements / 提交拉取请求

License / 许可证

This documentation is licensed under the same terms as the tinystruct framework (Apache License 2.0). 本文档采用与 tinystruct 框架相同的许可条款。

About

The documentation for tinystruct framework.

tinystruct.org/

Resources

Readme Activity Custom properties

Stars

0 stars

Watchers

1 watching

Forks

0 forks Report repository

Releases

Packages

Contributors

Languages