Files
sweet/docs/canary/introduction/index.md
T
Christian Svensson b7f1abb0d0 test(docs): type check docs code examples (#3180)
This PR adds the initial seeds of type checking the code in all code
blocks for the Markdown Docs.

- Adds a unit test, disabled due to the many remaining errors, that can
help find incorrect code
- Fixes a bunch of syntax errors, type errors, and other code issues
found in the docs

## Future improvements

A lot of remaining issues is mostly related to missing imports, e.g.
`App`, `staticFiles`, `HttpError` etc. There's a couple of different
directions to solve this in future PR's.

- Add explicit imports to all docs examples (may become unnecessarily
verbose)
- Add code to docs code blocks, but with a hint to remove it when
rendering the markdown as HTML
   ```tsx
   import { App } from "fresh";
   // #docs-start

   // Everything above marker above is trimmed away
   const app = new App();
   ```
- Add a `types.d.ts` with "global" types used during type checking, so
globals, imports and so on can be handled globally

I do think that some examples probably should be more explicit with
imports, but it would be overkill for a lot of places such as `app.md`
and `context.md`.
2025-08-05 23:56:04 +02:00

2.3 KiB

description
description
Fresh is a full stack modern web framework for JavaScript and TypeScript developers, designed to build high-quality, performant, and personalized web applications.

Fresh is a small, fast and extensible full stack web framework built on Web Standards. It's designed for building high-quality, performant, and personalized web applications.

import { App } from "fresh";

const app = new App()
  .get("/", () => new Response("hello world"))
  .get("/jsx", (ctx) => ctx.render(<h1>render JSX!</h1>));

app.listen();

Quick Start

Create a new Fresh app by running:

deno run -Ar jsr:@fresh/init

Features

The core idea powering Fresh is to render server generated HTML pages and only ship JavaScript for areas in the page that need to be interactive. This is often referred to as the Island Architecture.

  • Fast 🚀 - Rendering is super fast thanks to Preact and Deno's precompile transform
  • Lightweight 🏎️ - Only ship the JavaScript you need
  • Extensible 🧩 - Nearly every aspect can be customized
  • Powerful & small API 🤗 - Familiar APIs make you productive quickly
  • Built-in OpenTelemetry 📈 - Built-in support for OpenTelemetry

When to use Fresh

Fresh is ideal for sites and apps that are primarily server rendered, like a home page, an e-commerce shop or something like GitHub or Bluesky.

  • Web APIs
  • E-Commerce shops
  • Portfolio sites
  • Landing pages & Documentation
  • CRUD apps

That said, if you want to build a Single-Page-App (=SPA), then Fresh is not the right framework.

Who is using Fresh?

Fresh powers deno.com and Deno Deploy among many other projects at Deno. It's also used by deco.cx for e-commerce projects.

Where to host Fresh apps?

Fresh is most often deployed on Deno Deploy where it can be deployed with 1-click and has out of the box integrations with metrics among other things.

Fresh projects can be deployed manually to any platform with Deno like via docker containers too.