Get expert guidance for building and maintaining apps with the tinystruct Java framework.
Copy the install command and let the AI configure it · recommended for beginners
Please install the "tinystruct-patterns" skill from askskill: 1. Download https://raw.githubusercontent.com/affaan-m/ECC/main/skills/tinystruct-patterns/SKILL.md 2. Save it as ~/.claude/skills/tinystruct-patterns/SKILL.md 3. Reload skills and tell me it's ready
Show me how to create an Application class in tinystruct and define two @Action-mapped routes: GET /health and POST /users. Provide a complete Java example and explain how to register them in ActionRegistry.
A runnable tinystruct app skeleton with the Application class, Action route implementations, and registry setup guidance.
I have a tinystruct Action that handles user creation requests. Help me design unit tests for three scenarios: success, missing parameters, and invalid JSON, and provide example test code.
Test strategy and sample code for a tinystruct Action, covering both happy-path and error cases.
Using tinystruct, explain how to define a User entity with AbstractData, save and query it, trigger an event after user creation, and push the result to the frontend via SSE. Provide the key code structure.
An implementation approach with core code examples combining AbstractData, the event system, and SSE.
Architecture and implementation patterns for building modules with the tinystruct Java framework – a lightweight, high-performance framework that treats CLI and HTTP as equal citizens, requiring no main() method and minimal configuration.
CLI and HTTP are equal citizens. Every method annotated with @Action should ideally be runnable from both a terminal and a web browser without modification. This "dual-mode" capability is the core design philosophy of tinystruct.
Application modules by extending AbstractApplication.@Action.Context.Builder and Builders components.AbstractData POJOs.generate command.URLRequest and HTTPHandler.application.properties.The tinystruct framework treats any method annotated with @Action as a routable endpoint for both terminal and web environments. Applications are created by extending AbstractApplication, which provides core lifecycle hooks like init() and access to the request Context.
Routing is handled by the ActionRegistry, which automatically maps path segments to method arguments and injects dependencies. For data-only services, the native Builder and Builders components should be used for JSON serialization to maintain a zero-dependency footprint. The database layer uses AbstractData POJOs paired with XML mapping files for CRUD operations without external ORM libraries.
public class MyService extends AbstractApplication {
@Override
public void init() {
this.setTemplateRequired(false); // Disable .view lookup for data/API apps
}
@Override public String version() { return "1.0.0"; }
@Action("greet")
public String greet() {
return "Hello from tinystruct!";
}
// Path parameter: GET /?q=greet/James OR bin/dispatcher greet/James
@Action("greet")
public String greet(String name) {
return "Hello, " + name + "!";
}
}
@Action(value = "login", mode = Mode.HTTP_POST)
public String doLogin(Request<?, ?> request) throws ApplicationException {
request.getSession().setAttribute("userId", "42");
return "Logged in";
}
import org.tinystruct.data.component.Builder;
import org.tinystruct.data.component.Builders;
@Action("api/data")
public String getData() throws ApplicationException {
Builders dataList = new Builders();
Builder item = new Builder();
item.put("id", 1);
item.put("name", "James");
dataList.add(item);
Builder response = new Builder();
response.put("status", "success");
response.put("data", dataList);
return response.toString(); // {"status":"success","data":[{"id":1,"name":"James"}]}
}
import org.tinystruct.http.SSEPushManager;
@Action("sse/connect")
public String connect() {
return "{\"type\":\"connect\",\"message\":\"Connected to SSE\"}";
}
// Push to a specific client
String sessionId = getContext().getId();
Builder msg = new Builder();
msg.put("text", "Hello, user!");
SSEPushManager.getInstance().push(sessionId, msg);
// Broadcast to all
// Broadcast to all
SSEPushManager.getInstance().broadcast(msg);
import org.tinystruct.data.FileEntity;
…
Handle returns, refunds, fraud checks, and warranty claim decisions efficiently.
Use Bun for runtime, bundling, testing, packages, and Node migration decisions.
Use the correct Ethereum Keccak-256 hashing in Node.js and TypeScript.
Apply Nuxt 4 patterns for SSR safety, performance, and data fetching.
Generate images, videos, and audio with one unified AI media workflow.
Design Quarkus 3 backend patterns for messaging, APIs, data, and async workflows.
Build HTTP service patterns with lifecycle hooks, WebSockets, SSE, and proxying.
Connect to Tiny ERP to manage products, stock, orders, and finance data.
Generate, validate, format, and manipulate JSON data structures easily.
Build MCP servers and tools with Node/TypeScript using current SDK patterns.
Learn FastAPI best practices for architecture, auth, service layers, and testing.
Learn Spring AI and MCP to build agents and LLM applications.