Welcome to Ecopages

Ecopages is a modern, basic web framework built on Bun.

No virtual DOM. No complex state management. No framework-specific mental models. Just TypeScript and HTML.

What Makes Ecopages Different?

Most frameworks require you to adopt an entirely new way of thinking: hooks, signals, reactivity systems, and layers of abstraction. Ecopages takes the opposite approach. You write functions that return HTML. That's it.

The result? Fast static pages, minimal dependencies, and code you can actually understand. When you need server-side logic, add it, but you'll find that static is often exactly what you need.

Key Features

  1. Plain TypeScript: No framework DSL, no compiler magic. Write standard TypeScript functions that return HTML strings. Your IDE's autocomplete just works.

  2. Web Fundamentals: Embrace HTML, CSS, and browser APIs directly. No virtual DOM abstraction layer between you and the web.

  3. Static by Default: Generate HTML at build time. Host anywhere. No server costs for most sites.

  4. Server When You Need It: Full HTTP API with Express-like routing (app.get(), app.post(), etc.) for dynamic features can be added incrementally, not as the default.

  5. Choose Your Templating:

    • KitaJS – Fast JSX templates, compiles to string concatenation
    • React 19 – Full React with hydration when you need it
    • Lit – Web Components with SSR
    • MDX – Markdown with embedded components
  6. TypeScript-First: Full type inference for routes, props, and API handlers. No runtime overhead.

  7. Built on Bun: Leverages Bun's speed for fast builds, fast development, and fast production servers.

What Can You Build?

Quick Example

Here's a taste of what Ecopages looks like:

// app.ts
import { EcopagesApp } from '@ecopages/core/adapters/bun/create-app';
import config from './eco.config';
 
const app = new EcopagesApp({ appConfig: config });
 
// Static pages are automatically served from src/pages/
// Add API routes when you need dynamic behavior
app.get('/api/hello', async ({ response }) => {
	return response.json({ message: 'Hello from the API!' });
});
 
await app.start();

Current Status

Ecopages is in active development. The core features are stable and used in production, but APIs may evolve before the 1.0 release. We welcome feedback and contributions via our GitHub repository.

Getting Started

Ready to try Ecopages? Check out the Installation Guide to create your first project.

bunx degit ecopages/ecopages/examples/starter-jsx my-ecopages
cd my-ecopages
bun install
bun run dev