A modern, production-ready skeleton for building web applications with Fresh 2 and Tailwind CSS.
-
Start the development server:
deno task dev
-
Open your browser: Visit
http://localhost:5173to see the skeleton app.
- Fresh 2.0 - The next-gen web framework for Deno
- Tailwind CSS 3.4 - Utility-first CSS framework
- Vite 7.1 - Fast build tool and dev server
- TypeScript - Type-safe development
- ✅ Hot module reloading (HMR)
- ✅ Server-side rendering (SSR)
- ✅ PostCSS with Tailwind processing
- ✅ Custom Tailwind components
- ✅ Beautiful gradient themes
- ✅ Inter font integration
- ✅ Responsive design utilities
The skeleton includes pre-built component classes:
<div class="card">Basic card with shadow and hover effects</div>
<div class="card-selected">Selected state card</div>
<div class="card shadow-glow">Card with blue glow effect</div><button class="btn-primary">Primary action button</button>
<button class="btn-secondary">Secondary button</button><input class="input-field" type="text" placeholder="Styled input">
<select class="select-field">...</select><h1 class="text-gradient">Gradient text</h1>
<div class="bg-gradient-fresh">Fresh gradient background</div>fresh-blue-50tofresh-blue-900- Primary:
fresh-blue-500(#3b82f6)
fresh-green-50tofresh-green-900- Primary:
fresh-green-500(#22c55e)
fresh-tailwind-skeleton/
├── components/ # Reusable components
├── islands/ # Interactive client-side components
├── routes/ # File-based routing
│ ├── _app.tsx # Root app component
│ └── index.tsx # Home page
├── static/ # Static assets
│ └── styles.css # Tailwind CSS file
├── tests/ # Test files
├── client.ts # Client entry point
├── main.ts # Server entry point
├── utils.ts # Utilities
├── deno.json # Deno configuration
├── vite.config.ts # Vite configuration
└── tailwind.config.js # Tailwind configuration
- Task definitions (dev, build, test)
- Import map with all dependencies
- TypeScript compiler options
- JSX configuration for Preact
- Fresh plugin integration
- PostCSS with Tailwind processing
- Auto-prefixer for browser compatibility
- Content paths for purging unused CSS
- Custom color palette (fresh-blue, fresh-green)
- Inter font family
- Custom animations and keyframes
- CSS imports for HMR
- Client-side hydration setup
-
Build the application:
deno task build
-
Start the production server:
deno task start
deno task testFor browser testing, use Playwright via MCP (Model Context Protocol) rather than installing it as a dependency. This provides better integration and avoids bloating your project with testing dependencies.
If you're using Claude Code or similar tools with MCP support, Playwright will be available as a server for automated testing.
Create files in the routes/ directory:
routes/about.tsx→/aboutroutes/api/users.ts→/api/usersroutes/blog/[slug].tsx→/blog/:slug
Add client-side components in the islands/ directory:
// islands/counter.tsx
import { signal } from "@preact/signals";
const count = signal(0);
export default function Counter() {
return (
<div class="card p-6 text-center">
<p class="text-2xl mb-4">{count.value}</p>
<button
class="btn-primary"
onClick={() => count.value++}
>
Increment
</button>
</div>
);
}Add new component classes in static/styles.css:
@layer components {
.my-custom-button {
@apply bg-purple-500 hover:bg-purple-600 text-white px-4 py-2 rounded-lg transition-colors;
}
}- Tailwind directives in
static/styles.css - CSS imported in
client.tsfor Vite processing - PostCSS processes Tailwind with purging
- Auto-prefixer adds browser compatibility
- Vite serves processed CSS with HMR
- Pages render on the server for SEO and performance
- Islands hydrate on the client for interactivity
- Shared state via Preact Signals
- Routes automatically generated from file structure
- Support for dynamic routes, API endpoints, and middleware
- Layouts via
_app.tsxand_layout.tsx
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - feel free to use this skeleton for any project!
Happy coding! 🎉