A minimal, typed Fresh (Deno) starter focused on clarity, DX, strict rules, and modern defaults. It includes a small example of middleware, islands with signals, typed helpers via a factory, and ergonomic path aliases.
- Redis - Service with caching, JSON operations, and atomic counters.
git clone https://github.com/NeaByteLab/Deno-Fresh.git
cd Deno-Fresh/# Start the dev server
deno task dev
# Production build
deno task build
# Run the built server
deno task start
# Keep Fresh up-to-date
deno task updatesrc/
├─ assets/
│ └─ styles.css # Global styles imported by client.ts
├─ components/
│ └─ Button.tsx # Reusable UI component
├─ islands/
│ └─ Counter.tsx # Interactive island using @preact/signals
├─ routes/
│ ├─ api/
│ │ └─ [name].tsx # Example API route (/api/:name)
│ ├─ _app.tsx # Document shell (html/body)
│ ├─ _error.tsx # Error boundary with common HTTP codes
│ └─ index.tsx # Home page (+ example island)
├─ client.ts # Client entry (loads global CSS)
├─ main.ts # Exposes typed `define` and `State`
├─ server.ts # App wiring: middleware, static files, fs routes
Other root files:
_fresh/— generated output after build/dev (ignored from tooling)deno.json— imports, tasks, compiler options, lint/format configvite.config.ts— Vite integration
If you encounter hydration errors like n is not defined or r is not defined, this is typically caused by corrupted build cache. To fix:
rm -rf _fresh node_modules/
deno install --allow-scriptsReference: Fresh Troubleshooting Guide
- Module resolution errors - Clear build cache with
rm -rf _fresh - Import path issues - Ensure
@app/alias is properly configured indeno.json - Signal serialization - Fresh handles signal serialization automatically
For the full Fresh documentation, guides, and API reference, see the official site:
- Getting Started: https://fresh.deno.dev/docs/getting-started
- Introduction: https://fresh.deno.dev/docs/introduction
MIT License - see LICENSE file for details.