@xlsft/htsx image 0

About project

**HTSX** — Hyper Text (on) Server eXtended

@xlsft/htsx

HTSX is a minimal SSR framework for Deno built around a “vanilla HTML first” philosophy. The name stands for Hyper Text (on) Server eXtended and reflects its core idea: extending plain HTML with server-side capabilities, filesystem-based routing, and built-in REST API handling—without introducing a virtual DOM, JSX, or heavy abstractions. HTSX runs on top of Oak, leveraging its Application and Router while automatically wiring routes and handlers based on your project structure.

The framework provides automatic HTTP request handling, filesystem-based routing, endpoint-level HTML minification, pure server-rendered components, and a built-in REST API constructor. The main entry point is the HTSX class, which receives the root directory of your web layer, the server instances, and optional global props such as a payload function available in every view. The +root.ts file acts similarly to an App component, defining the global HTML layout and injecting props.body where route content is rendered. Global and local styles are handled through standard CSS files colocated with components or routes.

Routes are defined by directory structure inside the routes folder. Server-side views are implemented in +view.ts files, optional client-side JavaScript lives in +view.js, and route-specific styles in +view.css. A route may also export a HEAD constant to define page-specific metadata such as title, preload links, CDN scripts, or inline styles. Components are simple functions returning HTML strings, making the system extremely transparent and interoperable with any frontend approach—from React to HTMX—since the output is always plain HTML.

HTSX also acts as a REST API builder. Any directory within routes can contain files like +get.ts, +post.ts, and other supported HTTP method handlers, which are automatically registered by the framework. This enables combining SSR pages and API endpoints within the same project without additional configuration. Error handling is managed through a dedicated +error.ts file that renders when the response status is not 200.

Originally created for Telegram Mini Apps, where a lightweight SSR solution is often more appropriate than a full-scale framework, HTSX is equally suitable for internal dashboards, microservices with HTML interfaces, prototypes, and small production applications. It prioritizes simplicity, direct control over markup, and a clean developer experience while remaining flexible enough to integrate with external libraries when needed.

Public archive

About:

HTSX — Hyper Text (on) Server eXtended

Tags:

oss

Technology stack:

denots

Links:

https://github.com/xlsft/htsx