A beginner-friendly template system for creating modern websites that can be easily integrated with backend frameworks (FastAPI, Django, Flask, PHP, etc.).
With this project, youβll create:
π Complete beginner?
π€ Never used these tools before? Read these guides in order:
π Ready to build features?
π§ Need help with problems?
# First time setup (installs all tools)
bun install
# Start development server with live preview
bun run dev
# β Opens http://localhost:5173
# Build for production (creates dist/ folder)
bun run build
# Preview the production build locally
bun run preview
π Brand new to this? Start with the π Quick Start Guide - get running in 5 minutes!
After running bun run build
, you get:
style-abc123.css
)This project includes full TypeScript support:
// β
Type-safe functions
function calculateTotal(price: number, tax: number): number {
return price + tax;
}
// β
DOM manipulation with types
const button = document.getElementById('submit') as HTMLButtonElement;
button.addEventListener('click', handleSubmit);
// β
Automatic compilation to JavaScript
// TypeScript β JavaScript happens automatically during build
Benefits:
Images are automatically optimized during build:
// vite.config.js - Image optimization settings
viteImagemin({
mozjpeg: { quality: 80 }, // JPEG compression
pngquant: { quality: [0.6, 0.8] }, // PNG optimization
svgo: true, // SVG optimization
webp: { quality: 75 }, // WebP conversion
})
What happens to your images:
src/images/photo.jpg (2MB)
β Vite processes it
dist/assets/photo-abc123.jpg (400KB) β 80% smaller!
dist/assets/photo-abc123.webp (300KB) β Modern format
dist/ # π¦ Production-ready files for backend
βββ index.html # Compiled homepage
βββ assets/ # π¨ Optimized assets
β βββ index-a1b2c3.js # Minified TypeScript β JavaScript
β βββ style-d4e5f6.css # Compiled SCSS β CSS
β βββ photo-g7h8i9.jpg # Compressed images
β βββ photo-g7h8i9.webp # Modern image formats
βββ ...
π Just getting started?
π€ Donβt understand a tool?
ποΈ Want to understand the project?
β Adding a new page?
π¨ Styling problems?
β‘ TypeScript errors?
π§ Something not working?
dist/
folder - it gets overwritten when you buildsrc/images/
- theyβll be optimized automaticallybun run build
before giving files to backend teamRequired:
Check if installed:
node --version # Should be v18+
bun --version # Should be 1.0+
π Ready to start? Read Understanding the Tools to learn what each tool does.