A modern security awareness application built with Svelte and Vite. Clean architecture, optimized workflow, and developer-friendly structure.
Don't Click That/
βββ src/
β βββ App.svelte # Root app component (blank slate)
β βββ app.css # Global styles, layout, colors, spacing
β βββ main.js # App entry point
β βββ lib/
β βββ components/ # Reusable Svelte components
β β βββ Counter.svelte (example)
β βββ assets/
β βββ images/ # All app images live here
β βββ index.js (centralized exports)
βββ public/ # Static files (favicons, etc.)
βββ package.json # Dependencies and scripts
βββ vite.config.js # Vite build configuration
βββ jsconfig.json # JavaScript/TypeScript config
public/ vs src/lib/assets/images/public/ directoryfavicon.ico, favicon.svg)/favicon.icosrc/lib/assets/images/ (Recommended for app images)// β
Good: Import images from src/lib/assets/images/
import { logoImage } from './lib/assets/images/index.js'
// Use in templates
<img src={logoImage} alt="Logo" />
All npm scripts are optimized for your workflow:
| Command | Purpose |
|---|---|
npm run dev |
Start dev server (localhost:5173) |
npm run dev:host |
Dev server on 0.0.0.0 (network access) |
npm run build |
Production build to dist/ |
npm run preview |
Preview production build locally |
npm run preview:host |
Preview on 0.0.0.0 (network access) |
npm run check |
Type-check Svelte files |
npm run check:watch |
Watch mode type-checking |
npm run validate |
Full check: type-check + build test |
npm run type-check |
Alias for check |
npm run lint:check |
Alias for check |
# Daily development
npm run dev # Start, make changes (auto-reloads)
npm run check # Check for errors before commit
npm run build # Test production build
# Full validation before merge
npm run validate # Type-check + build (comprehensive)
# Sharing your work locally
npm run dev:host # Share on network
npm run preview:host # Preview production on network
src/App.sveltesrc/app.csssrc/lib/assets/images/index.jsimport { logo, icon } from './lib/assets/images/index.js'Example index.js:
import logo from './logo.svg'
import heroImage from './hero.png'
import icon from './icon.svg'
export { logo, heroImage, icon }
src/lib/components/Install dependencies
npm install
Start developing
npm run dev
Add your content
src/App.svelte to build your pagessrc/app.csssrc/lib/components/Before pushing code
npm run validate
Build for production
npm run build
Output in dist/ directory
.svelte files in src/lib/components/app.css + scoped styles in componentssrc/lib/assets/images/index.jsnpm run check:watch while coding for instant feedbackvite.config.js (build & dev settings)vite.config.js via pluginjsconfig.json (path aliases, type checking)MIT (or your chosen license)
Happy coding! π