v 0.1.48

Welcome to Ecopages

Ecopages is a modern web framework built on Bun that lets you build fast, static-first websites. The core philosophy is simple: you don't always need a server but, when you do, Ecopages has you covered.

What Makes Ecopages Different?

Most web frameworks force you to choose: either a static site generator or a full server framework. Ecopages gives you both. Start with lightning fast static pages, then add API routes and server-side logic only where you need them.

Key Features

  1. Static-First Architecture: Generate static HTML at build time for maximum performance and minimal hosting costs. No server required for most sites.

  2. Server When You Need It: Full HTTP API with Express-like routing (app.get(), app.post(), etc.) for dynamic features, webhooks, or data endpoints.

  3. Multi-Framework Support: Use the templating engine that fits your project:

    • KitaJS – Fast JSX templates, great for static content
    • React 19 – Full React with hydration and Server Components
    • Lit – Web Components with SSR support
    • MDX – Markdown with embedded components
  4. Image Processing Pipeline: Automatic responsive images with the ecopages:images virtual module. Generate optimized WebP at multiple sizes with zero configuration.

  5. Hot Module Replacement: Fast refresh during development with framework-aware HMR strategies.

  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