"How many are your works, O LORD! In wisdom you made them all; the earth is full of your creatures."
Psalms 104:24
tinystruct is a simple yet powerful framework for Java development. It embraces simple thinking and better design principles, making it easy to use while delivering excellent performance.
- Modern Architecture: No
main()method required, applications start directly via CLI - Dual-Mode Support: CLI and Web are treated as equal citizens
- Built-in Servers: Native support for Netty, Tomcat, and Undertow
- AI-Ready: Designed for AI integration and Model Context Protocol (MCP)
- SSE Support: Native Server-Sent Events for real-time applications
- High Performance: Optimized to handle 86,000+ requests per second
- Minimal Configuration: Zero-boilerplate philosophy
- Annotation-Based Routing: Clean and intuitive routing with
@Action
Add the dependency to your pom.xml:
<dependency>
<groupId>org.tinystruct</groupId>
<artifactId>tinystruct</artifactId>
<version>1.7.21</version>
<classifier>jar-with-dependencies</classifier>
</dependency>package tinystruct.examples;
import org.tinystruct.AbstractApplication;
import org.tinystruct.ApplicationException;
import org.tinystruct.system.annotation.Action;
public class Example extends AbstractApplication {
@Override
public void init() {
// Initialization code
}
@Action("praise")
public String praise() {
return "Praise the Lord!";
}
@Action("say")
public String say(String words) {
return words;
}
@Action(value = "hello", mode = Mode.HTTP_GET)
public String helloGet() {
return "GET";
}
}- No
main()method required: Applications can be started directly using CLI commands likebin/dispatcher, with no boilerplate code needed. - Unified design for CLI and Web: Unlike many frameworks, tinystruct treats CLI and Web as equal citizens. This makes it perfect for AI tasks, script automation, and hybrid applications.
- Built-in lightweight HTTP server: Whether it’s Netty or Tomcat, tinystruct integrates the server lifecycle inside the framework.
- Minimal configuration philosophy: Configuration is minimized to the essentials. No need to wire up hundreds of beans or complex XML/YAML files.
- Annotation-based routing: Clean and intuitive routing using
@Action, eliminating complex controller hierarchies. - Performance-first architecture: Almost zero overhead. No reflection-based bean scanning or unnecessary interceptors.
- AI & MCP Integration: Built-in support for Model Context Protocol (MCP) and AI-driven workflows.
- Getting Started
- Core Concepts
- Web Applications
- CLI Applications
- Configuration
- Database Integration
- Advanced Features
- Best Practices
- AI & MCP Integration
- API Reference
- GitHub Repository: https://github.com/tinystruct/tinystruct
- Issue Tracker: https://github.com/tinystruct/tinystruct/issues
- Discussion Forum: https://github.com/tinystruct/tinystruct/discussions
Licensed under the Apache License, Version 2.0