solid-boilerplate is a lightweight and modern starter template designed to help developers quickly build web applications using Solid and Vite. This boilerplate provides an optimized development environment with fast builds, hot module replacement, and production-ready configurations.
- Solid: A performant and reactive JavaScript library for building user interfaces.
- Vite: A blazing-fast build tool for modern web projects.
- Development Server: Instant feedback with hot module replacement during development.
- Production Build: Optimized builds ready for deployment.
- Linting: Integrated code quality checks using Biome.
npm run dev- Starts a dev server at http://localhost:5173/npm run build- Builds for production, emitting todist/. Pre-renders all found routes in app to static HTMLnpm run preview- Starts a server at http://localhost:4173/ to test production build locally
npm test- Runs unit tests using Vitestnpm run test:ui- Runs tests with Vitest's interactive UInpm run coverage- Runs tests and generates a code coverage reportnpm run coverage:ui- Runs tests with coverage and opens the HTML report in your browser
npm run lint- Runs Biome to check and automatically fix code style issues
This boilerplate includes a production-ready Docker setup using Caddy as the web server.
Build the Docker image:
docker build -t solid-app .Run the container:
docker run -p 80:80 -p 443:443 solid-appThe application will be available at http://localhost
The included Caddy configuration (etc/caddy/Caddyfile) provides:
- SPA Support: Automatic routing to
index.htmlfor client-side routing - Security Headers: Comprehensive security headers including CSP, COOP, COEP, and more
- Gzip/Zstd Compression: Efficient content encoding for faster loads
- Health Check:
/healthzendpoint for monitoring - Caching: Immutable asset caching for JavaScript files
- Multi-stage Docker build for optimized image size
- Non-root user for enhanced security
- Static file serving with proper MIME types
- Production-ready security configuration