Tinystruct
A lightweight, modular Java application framework for web and CLI development, designed for AI integration and plugin-based architecture. Enabling developers to create robust solutions with ease for building efficient and scalable applications.
Last verified:
What is Tinystruct?
tinystruct is a lightweight, modular Java application framework designed for building efficient and scalable web and command-line interface (CLI) applications. It embraces a philosophy of simple thinking and better design, enabling developers to create robust solutions without the complexity of heavyweight frameworks like Spring Boot. The framework's core innovation is its unified @Action annotation mechanism, which allows developers to write code once and run it anywhere—whether as a web service or a CLI tool.
Key features include modern architecture requiring no main() method, dual-mode support treating CLI and Web as equal citizens, built-in servers (Netty, Tomcat, Undertow), AI-ready design with Model Context Protocol (MCP) integration, native Server-Sent Events (SSE) support for real-time applications, and high performance handling 86,000+ requests per second. The framework follows a zero-boilerplate philosophy with minimal configuration and annotation-based routing.
tinystruct is ideal for Java developers building hybrid applications that need both web and CLI interfaces, AI integration projects, script automation tasks, real-time applications requiring SSE, and developers who value performance and simplicity over complex enterprise features. It's particularly suited for those who want transparente, predictable, and extensible framework mechanics without fighting with excessive configuration.
The framework is open-source under the Apache License 2.0, has 199 stars on GitHub, and maintains active development with 161 releases. It requires Java 17 or higher and Maven for dependency management.
Tinystruct pricing
Pricing model: Freemium
tinystruct is completely free and open-source, licensed under the Apache License Version 2.0. There are no paid plans, premium tiers, or commercial licensing fees. The framework can be downloaded from Maven Central (groupId: org.tinystruct, artifactId: tinystruct) or from the GitHub repository. All features including AI integration, MCP support, SSE, database operations, and all server integrations are included free of charge.
Tinystruct pros
- No main() method required - applications start directly via CLI
- Unified CLI and Web design - same code works for both interfaces
- Built-in HTTP servers - Netty, Tomcat, and Undertow support
- AI-ready with built-in Model Context Protocol (MCP) integration
- Native Server-Sent Events (SSE) support for real-time applications
- Exceptional performance - handles 86,000+ requests per second
- Zero-boilerplate philosophy with minimal configuration
- Annotation-based @Action routing - clean and intuitive
- Lightweight and modular architecture with no third-party dependencies
- No reflection-based bean scanning or unnecessary interceptors
- Built-in event system for decoupled component communication
- Comprehensive database operations with transaction management
- Object-Relational Mapping through AbstractData class
- Built-in JSON data handling utilities with Builder class
- Internationalization (i18n) support for multilingual applications
- 161 releases showing active maintenance and development
- Open-source under permissive Apache License 2.0
Tinystruct cons
- Requires Java 17 or higher - not compatible with older Java versions
- Smaller community - only 199 GitHub stars and 3 contributors
- Limited documentation compared to established frameworks like Spring
- No official IDE integration or plugins available
- Fewer pre-built components and libraries than enterprise frameworks
- MCP and AI features are relatively new (added in v1.7.17)
- No built-in security framework - must implement authentication manually
- Limited third-party ecosystem and plugin availability
Frequently asked questions about Tinystruct
What is tinystruct?
tinystruct is a simple yet powerful lightweight Java framework for building efficient and scalable web and CLI applications. It embraces simple thinking and better design principles, featuring a modular, action-oriented architecture with the @Action annotation that enables code reuse between command-line applications and web services.
What Java version do I need?
tinystruct requires Java Development Kit (JDK) 17 or higher. This is a prerequisite for using the framework, along with Maven for dependency management and a text editor or IDE like IntelliJ IDEA, Eclipse, or VS Code.
How do I install tinystruct?
Add the dependency to your pom.xml: <dependency><groupId>org.tinystruct</groupId><artifactId>tinystruct</artifactId><version>1.7.23</version><classifier>jar-with-dependencies</classifier></dependency>. Then extend AbstractApplication in your Java class and use @Action annotations for your methods.
What makes tinystruct different from Spring Boot?
Unlike Spring Boot which is primarily web-centric, tinystruct treats CLI and Web as equal citizens. It requires no main() method, has minimal configuration with no XML/YAML boilerplate, no reflection-based bean scanning, and almost zero overhead. It's designed for transparency and predictability without sacrificing control or performance.
How do I start the HTTP server?
Start the built-in HTTP server with: bin/dispatcher start --import org.tinystruct.system.NettyHttpServer (or TomcatServer/UndertowServer). You can then access your application at http://localhost:8080/?q=your-action-name. The framework integrates the server lifecycle inside, no separate containers needed.
Does tinystruct support AI integration?
Yes, version 1.7.17+ includes built-in AI integration with Model Context Protocol (MCP) support. Configure with mcp.auth.token in config.properties, then build AI-enabled actions. It also includes AI-driven exception diagnosis and automatic recovery for production resilience.
How do I implement Server-Sent Events (SSE)?
tinystruct 1.7.17+ has native SSE support. Set headers Content-Type: text/event-stream, Cache-Control: no-cache, Connection: keep-alive, then write data in SSE format: 'data: {json} '. This enables real-time streaming for chat interfaces or live feeds without third-party dependencies.
Where can I get support?
Support is available through the GitHub Repository (https://github.com/tinystruct/tinystruct), Issue Tracker (https://github.com/tinystruct/tinystruct/issues), and Discussion Forum (https://github.com/tinystruct/tinystruct/discussions). The framework is maintained by contributor James M. ZHOU with active development showing 161 releases.