Vite启动器

Deno-Fresh — Vite 启动器模板

作者 NeaByteLab

基于 Deno Fresh 的最小化 TypeScript 起始模板,包含中间件、islands 与 signals 示例、类型化工厂辅助函数、路径别名以及 Redis 集成说明。

看看你的网站会是什么样

浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。

2 个预览视图
桌面端首页1 / 2
桌面端截图首屏预览

由服务器浏览器实际访问页面后截取。

全部页面与视图 2

截图用于了解视觉与布局,交互效果请以实际项目为准。

采集于 2026-10-16查看来源

值得关注的模板亮点

从已有项目资料中,快速了解它的特点。

01

最小化且类型化的 Deno Fresh 起始模板,强调清晰度与严格规则

02

包含中间件、islands 与 @preact/signals 的示例代码

03

通过工厂提供类型化辅助函数,并配置 @app/ 路径别名

04

内置 Redis 集成,涵盖缓存、JSON 操作和原子计数器

05

使用 deno.json 统一管理导入、任务、编译器选项和 lint/format 配置

06

提供 Vite 集成与常见 hydration 错误的排查说明

模板详细介绍

该模板是一个面向 Deno Fresh 的最小化 TypeScript 起始项目,README 将其定位为注重清晰度、开发体验、严格规则和现代默认配置。项目结构在 src/ 下划分 assets、components、islands、routes、client.ts、main.ts 和 server.ts,其中 routes 包含首页、_app 文档外壳、_error 错误边界以及 /api/:name 示例 API 路由;islands/Counter.tsx 展示使用 @preact/signals 的交互式 island。server.ts 负责应用装配,包括中间件、静态文件和文件系统路由。main.ts 暴露类型化的 define 和 State。deno.json 集中管理导入、任务、编译器选项以及 lint/format 配置,vite.config.ts 提供 Vite 集成。README 还说明内置 Redis 集成,包含缓存、JSON 操作和原子计数器,详细内容指向 docs/REDIS.md。安装方式为克隆仓库后进入目录,使用 deno task dev、build、start 和 update 等任务。README 未提供关于生产就绪程度、性能表现或除 Redis 之外其他集成的说明。

Vite启动器

适合你的项目吗?

适用场景

  • 作为新 Deno Fresh 项目的起点,按现有目录结构组织路由、islands 和组件
  • 参考 islands/Counter.tsx 与 signals 用法实现交互式 UI 组件
  • 参考 routes/api/[name].tsx 编写示例 API 路由
  • 参考 server.ts 的中间件、静态文件和文件系统路由装配方式
  • 按 docs/REDIS.md 接入 Redis 缓存、JSON 操作或原子计数器

适合人群

  • 希望使用 Deno 与 Fresh 构建类型化 Web 应用的开发者
  • 需要最小化起始模板并自行扩展的开发者
  • 希望参考中间件、islands、signals 和 API 路由示例的开发者
  • 计划在 Fresh 项目中使用 Redis 的开发者

上手与定制指南

结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。

  1. 1

    克隆仓库:git clone https://github.com/NeaByteLab/Deno-Fresh.git 并进入 Deno-Fresh/ 目录

  2. 2

    开发服务器:deno task dev

  3. 3

    生产构建:deno task build,运行构建后的服务器:deno task start

  4. 4

    保持 Fresh 更新:deno task update

  5. 5

    遇到 hydration 报错时可执行 rm -rf _fresh node_modules/ 后运行 deno install --allow-scripts

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。

使用时需要遵守

  • 允许免费使用、修改、商用和分发该版本代码。
  • 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
  • 代码按现状提供;担保与责任限制以原许可证及适用法律为准。

额外费用与待核对事项

  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据

DeepSeek 根据仓库许可证和 README 整理 ·2026-10-16。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。

项目核对记录与介绍依据

模板资料

来源平台
GitHub
资料与维护参考分
资料较完整 · 80 / 100
技术栈
Vite
网站类型
启动器
这个分数如何计算

本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。

这个项目需要核对什么

记录的仓库更新时间
2025-10-21
截图检查日期
2026-10-16

已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。

目录记录的主要技术栈是 Vite。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。

查看具体选型方法 →

介绍的制作与核对状态

介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。

审核声明: codex-user-requested-batch-review-20261017 · 2026-10-16

查看当时使用的来源资料

SHA-256: 1087ccd18108f2e1a5837bcda416b8e08a69273d84047a95b1f62a8ed9c9a24f

2026-10-16T16:06:08.941Z

来源文件 / 仓库
# Deno Fresh Starter [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/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](docs/REDIS.md) - Service with caching, JSON operations, and atomic counters.

## Installation

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

## Quick start

```bash
# 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

```text
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:

```bash
rm -rf _fresh node_modules/
deno install --allow-scripts
```

> Reference: [Fresh Troubleshooting Guide](https://fresh.deno.dev/docs/advanced/troubleshooting#install-or-re-install-dependencies)

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

- Getting Started: https://fresh.deno.dev/docs/getting-started
- Introduction: https://fresh.deno.dev/docs/introduction

## License

MIT License - see [LICENSE](LICENSE) file for details.
反馈内容错误

看看同类模板

对比同技术栈与用途的模板,找到更适合的视觉与内容结构。