Skip to content

NeaByteLab/Deno-Fresh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deno Fresh Starter License: MIT

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.

Built-in Integrations

  • Redis - Service with caching, JSON operations, and atomic counters.

Installation

git clone https://github.com/NeaByteLab/Deno-Fresh.git
cd Deno-Fresh/

Quick start

# 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 update

Project structure

src/
├─ 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 config
  • vite.config.ts — Vite integration

Troubleshooting

Fresh Hydration "x is not defined" Error

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-scripts

Reference: Fresh Troubleshooting Guide

Common Issues

  1. Module resolution errors - Clear build cache with rm -rf _fresh
  2. Import path issues - Ensure @app/ alias is properly configured in deno.json
  3. Signal serialization - Fresh handles signal serialization automatically

Official documentation

For the full Fresh documentation, guides, and API reference, see the official site:

License

MIT License - see LICENSE file for details.