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
-
Static-First Architecture: Generate static HTML at build time for maximum performance and minimal hosting costs. No server required for most sites.
-
Server When You Need It: Full HTTP API with Express-like routing (
app.get(),app.post(), etc.) for dynamic features, webhooks, or data endpoints. -
Multi-Framework Support: Use the templating engine that fits your project:
-
Image Processing Pipeline: Automatic responsive images with the
ecopages:imagesvirtual module. Generate optimized WebP at multiple sizes with zero configuration. -
Hot Module Replacement: Fast refresh during development with framework-aware HMR strategies.
-
TypeScript-First: Full type inference for routes, props, and API handlers. No runtime overhead.
-
Built on Bun: Leverages Bun's speed for fast builds, fast development, and fast production servers.
What Can You Build?
- Marketing sites – Static pages with excellent SEO
- Documentation – MDX-powered docs like the one you're reading
- Blogs – Dynamic routes with
getStaticPathsfor each post - Portfolios – Beautiful static sites with interactive components
- Dashboards – React or Lit components with live API data
- APIs – REST endpoints alongside your static pages
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