Skip to content

The simplest web framework and site generator yet – no bloat, no bundler, no client-side JS by default.

License

Notifications You must be signed in to change notification settings

mastrojs/mastro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mastro

The simplest web framework and site generator yet.

Website | Try Mastro online

  • Minimal yet powerful: Mastro fills in the few missing pieces that aren't yet built into the platform: a file-based router and a handful of composable functions to return standard Response objects.
  • Static site generation and on-demand server rendering of HTML or JSON works all the same.
  • No bloat: written in just ~700 lines of TypeScript, Mastro feels like a framework but is just a library.
  • No client-side JavaScript (until you add some): create MPA websites that load blazingly fast.
  • No bundler (until you add one): your code arrives in the browser exactly how you wrote it.
  • No magic: use normal <img> and <a> tags referencing HTTP-first assets.
  • No VC-money: no eventual enshitification – selling a service is not what we're interested in.
  • No update treadmill: we use web standards instead of relying on complex dependencies.
  • No lock-in: swap out calls to the Mastro library later on. Or fork it – it's only ~700 lines after all.

How to run

In the browser

Deploy to GitHub Pages without installing anything: Get started

Command line

Deno (recommended)

After installing Deno, either use the Mastro template for Deno or run:

deno run -A npm:@mastrojs/[email protected]

Node.js

Either use the Mastro template for Node.js or run:

pnpm create @mastrojs/[email protected]

(npm and yarn also work, but pnpm is recommended.)

Bun

Either use the Mastro template for Bun or run:

bun create @mastrojs/[email protected]

Documentation

Deploy to production

To deploy your website, see Different ways to run Mastro.

Extensions

The core of Mastro is tiny. But to get you started quickly for common use-cases, there is a growing list of extensions that are tailored to be used with Mastro. Usually, it's just a single file wrapping a carefully chosen external dependency.

Join the community / contribute

It’s still early days. But we’re looking to build an inclusive community, where people of all kinds of backgrounds and experience levels feel welcome and safe. A place to ask questions and learn new things, where people help each other out.

Do you have a question, need help, or would like to talk about future plans? Please start a GitHub Discussion.

Something not working as expected or confusing? We consider that a bug. Please open a GitHub issue.

About

The simplest web framework and site generator yet – no bloat, no bundler, no client-side JS by default.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project