Artyom Chshyogolev

🌐 Frontend Development Workflow

A beginner-friendly template system for creating modern websites that can be easily integrated with backend frameworks (FastAPI, Django, Flask, PHP, etc.).

🎯 What You’ll Build

With this project, you’ll create:

πŸ› οΈ What Tools We Use

πŸ“š Learning Path (Start Here!)

πŸ‘‹ Complete beginner?

πŸ€” Never used these tools before? Read these guides in order:

  1. πŸ“– Understanding the Tools - What are Bun, TypeScript, and Vite?
  2. πŸ—οΈ Project Structure - How files are organized
  3. πŸ“„ Working with Templates - Creating layouts and partials

πŸš€ Ready to build features?

  1. βœ… Adding New Pages - Step-by-step checklist
  2. 🎨 Styling Guide - Working with SCSS
  3. ⚑ TypeScript Basics - Writing safer JavaScript

πŸ”§ Need help with problems?

  1. πŸ”§ Troubleshooting Guide - Common issues and solutions

πŸš€ Essential Commands

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

🎯 What This Project Does

✨ Features for You (Developer)

πŸ“¦ Output for Backend Team

After running bun run build, you get:

πŸ—οΈ TypeScript Integration

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:

πŸ–ΌοΈ Automatic Image Optimization

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

πŸ“ What Gets Built

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
└── ...

πŸ†˜ Getting Help

πŸš€ Just getting started?

πŸ€” Don’t understand a tool?

πŸ—οΈ Want to understand the project?

βž• Adding a new page?

🎨 Styling problems?

⚑ TypeScript errors?

πŸ”§ Something not working?

⚠️ Important Rules

  1. 🚫 Never edit dist/ folder - it gets overwritten when you build
  2. πŸ“„ Always use templates - don’t copy/paste HTML between pages
  3. πŸ“ Write TypeScript, not JavaScript - it prevents bugs
  4. πŸ–ΌοΈ Put images in src/images/ - they’ll be optimized automatically
  5. πŸ”¨ Run bun run build before giving files to backend team

πŸ”§ Prerequisites

Required:

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.